View previous topic :: View next topic |
Author |
Message |
pattousai
Joined: 23 Aug 2006 Posts: 37
|
Doubt about the pic or the code |
Posted: Wed Sep 20, 2006 7:29 am |
|
|
Hi everybody!!
Well, first of all, in my project i don't use the ccs compiler, but i guess that someone can help me here, sorry if i'm wrong. By the way, i'm using the boost C compiler and the 16f84a.
In my project is crutial to know if one input is high or low. When the input is low it works just fine, but when no signal are send (nor low or high) is like the input is high.
My question is, this is right, i mean, the pic is suposse to work that way?? Or could that be an software error??
thanks |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
|
Posted: Wed Sep 20, 2006 9:53 am |
|
|
This is a CCS board supported by CCS. They are extremely tolerant but this board won't last long if it becomes a help desk for competitive compilers.
Either ask your compiler vendor to start a board or start one yourself.
Some PIC pins are open drain and need pull ups for output. If you compiler has a pseudo assembler list file as CCS does you could look at the actual machine instructions. The in pin should tristate and in the abscence of a driven input signal will float. Look at Microchips documentation and good luck with the Boost C board.
Last edited by Douglas Kennedy on Wed Sep 20, 2006 10:02 am; edited 1 time in total |
|
|
rberek
Joined: 10 Jan 2005 Posts: 207 Location: Ottawa, Canada
|
|
Posted: Wed Sep 20, 2006 9:58 am |
|
|
Well, you give us no detail about the circuit, but PORTB of the 16F84A has weak pullups on the input, so if you tristate the input signal (as you imply by saying you don't drive a one or a zero) then you will read a one.
If you are using port A as an input and tristate the input signal, then reading the input pin may give a one or zero, depending on your circuit configuration. |
|
|
|