Hello, I'm having extremely bad luck with my "a" ports on my PIC 18F2525. I've included a snippet from a large program to help demostrate my program.
In effect, port a causes me nothing but trouble if I use for anything other than a simple on/off output. I understand it houses the A/D stuff and is consequently fickle to begin with. Thus, I've limited its use to turning on and off LEDs and powering a couple of switches (strictly output).
However, in my program I turn on one LED on porta.1 then immediately put power to a BCD switch on porta.4. As soon as porta.4 goes high, porta.1 goes low and turns off the LED! Here's a sample of code:
trisa = %00000000 'Set all port a's to outputs
porta = %00000000 'Set all ports on a to low
adcon1 = 7 'Make porta all digital I/O's
Main:
porta.1 = 1 'Light an LED
goto Switch_On
Switch_On:
porta.4 = 1 'porta.1 goes off for no apparent reason
'Do something
goto Main
And porta.1 goes off! Anyone have any ideas or suggestions?
Bookmarks