At this point I feel like a total idiot. I was debugging a very simple program for a 16F870. It appears that the reason the program would not work properly was that PORTC.4 was not going high when instructed. Removing all unessential parts of the code, I wrote High PORTC.4. When I checked for a high state on the appropriate pin, I found it to be low. I changed chips with the same result. I added High PORTC.5 and, of course, that pin went high while PORTC.4 remained low. Is there something special about PORTC.4 on this chip that I missed?
My code follows:
ADCON1 = 7
TRISA.0 = 1
TRISB = 0
TRISC = 0
HH VAR BYTE
MM VAR BYTE
SS VAR BYTE
DD VAR BYTE
N VAR BYTE
D VAR BYTE
H VAR BYTE
I VAR BYTE
T VAR BYTE
Z VAR BYTE
High PORTC.4
High PORTC.5
Any help will be greatly appreciated.
Bookmarks