I got it figured out. I needed to get my port bits and ANDING to coorelate correctly. I did have the CMCON and ANSEL set correctly. I am using a rotary binary switch with the common pulled to 5V and the port inputs pulled low w/ 1K resistors. OK, here is the code if anyone wants to peek. I am sure there are better ways, I just needed to know how to read the port. Thanks and take it easy, Scott
Code:
CMCON = %00000111
ANSEL = %00000000
TRISA = %00111110
TRISC = %00000000
temp var byte
digit var byte
A var byte
C var byte
PORTA = %00000000
PORTC = %00000000
pause 1000
start: temp = PORTA & %00110110
if temp = 34 then digit = 9
if temp = 32 then digit = 8
if temp = 22 then digit = 7
if temp = 20 then digit = 6
if temp = 18 then digit = 5
if temp = 16 then digit = 4
if temp = 6 then digit = 3
if temp = 4 then digit = 2
if temp = 2 then digit = 1
if temp = 0 then digit = 0
lookup digit,[0,0,1,1,1,1,1,0,1,1],a
lookup digit,[63,6,27,15,38,45,61,7,63,39],c
PORTA = a
PORTC = C
PAUSE 50
goto start
End
Bookmarks