Hi maybe someone con help me with this odd problem.
I've been using a 6723 recently and all's been fine except for one problem, I'm using port B.6 to drive a fet to turn on a relay on a board and all is ok just after i program the pic but if i cycle the power it wont work, I've tried pulling the output high with a resistor but the output seems to be driven low permanently.
ps
I've tried this with 2 different main pcb's
pic is on a 40pin dil header and i've tried 2 different 6723 pics in the same pcb without luck.
But if i replace the 6723 with a 4550 then everything works fine.
Any suggestions?
odd pic problem on 18f6723
Moderators: David Barker, Jerry Messina
grrr
ok so i fixed the problem..... but it seems like a compiler bug
i removed all places in my code where i set the output low and
left the place where i set it high and the output still wouldn't come on.
but if i moved the portb.6 = 1 to just before the main code it would work.
i removed all places in my code where i set the output low and
left the place where i set it high and the output still wouldn't come on.
but if i moved the portb.6 = 1 to just before the main code it would work.
Hmmm..
-
- Registered User
- Posts: 185
- Joined: Mon Mar 10, 2008 8:20 am
- Location: Seattle, WA USA
- Contact:
One thing I found recently......
If you use a variable name as a port pin:
dim LED as PORTB.0
and then do something like:
LED = 1
LED = 0
You won't see any change on the port pin.
If you add a lin near the top of the program:
HIGH (LED)
or
LOW(LED)
the above works fine.
I believe the added HIGH or LOW command makes PORTB.0 (in this case) an output.
Jon
If you use a variable name as a port pin:
dim LED as PORTB.0
and then do something like:
LED = 1
LED = 0
You won't see any change on the port pin.
If you add a lin near the top of the program:
HIGH (LED)
or
LOW(LED)
the above works fine.
I believe the added HIGH or LOW command makes PORTB.0 (in this case) an output.
Jon