I've been tinkering with this all day, and I think I need some help.
I want to use a PIC16F916 to control LEDs. Pretty simple stuff here, but I can't get PORTA to behave normally. I've tried dozens of options, and I keep getting wacko results. I commonly get desired LED blinking on two pins but the rest just sit low or seem to float (ignoring commands).
Here is an example of some code that should flash 6 LEDs, but only PORTA.4 and PORTA.5 work properly:
B1 VAR BYTE
TRISA = 0
loop:
B1 = 0
GOSUB blueon
pause 500
B1 = 1
gosub blueon
pause 500
goto loop
blueon:
PORTA.0 = B1
PORTA.1 = B1
PORTA.2 = B1
PORTA.3 = B1
PORTA.4 = B1
PORTA.5 = B1
RETURN
And this might be a hint: If I light up the entire PORTA (PORTA = 255) then things seem to work, but I need to reserve Pins A6 and A7 for serial communication.
I'm using PBP via Microcode Studio, and I'm activating the internal timer by selecing INTOSCIO before programming with MPLAB.
I've searched around and found a few examples of problems with analog/digital settings, but none of these seem to apply here. Any ideas?
Bookmarks