PDA

View Full Version : Setting a pin twice



RUBiksCUbe
- 17th September 2006, 02:31
Is there something wrong with having this as code:



pause 500
low PortA.0
low PortA.1

pause 500
high PortA.0
low PortA.1

pause 500
low PortA.0
high PortA.1


When I run this code where a pin set to the same value twice (A.1 is set low twice) A.1 never goes high when it is supposed to. Does setting a pin to a value disable it?

RUBiksCUbe
- 17th September 2006, 02:54
I now seem to have a much deeper problem. The following code results in ONLY portA.1 being high:



DEFINE OSC 20
high PortA.0
high PortA.1
end

RUBiksCUbe
- 17th September 2006, 03:09
Alright, never mind. I switched to PortB instead of PortA and all is good. I guess I just have a PIC with a messed up PortA.

mister_e
- 18th September 2006, 04:04
No! you have a PIC with 'features' on PORTA that must be disabled first!

RUBiksCUbe
- 19th September 2006, 01:45
*Reads datasheet*
Doh!
:)