Yeah sorry about being so unclear. I'm using 3 sets of 2-7 segment displays. I pretty much need the first digit to count and then from there I can just up the count on the others once that digit hits 10.
Here's the code since I cannot get the attachment to ever work.
Cnt var word
Zero var Word
Digit var word
Pattern Var word
digit1 var porta.0
digit2 var porta.1
digit3 var porta.2
digit4 var porta.3
digit5 var porta.7
digit6 var porta.6
First var word
Second var word
Third var word
Fourth var word
Fifth var word
Sixth var word
i var word
ADCON1=7
TRISA=0
TRISB=0
INTCON=%00100000
OPTION_REG=%00000111
TMR0=217
ON INTERRUPT GOTO ISR
INTCON=%10100000
PHILL:
CNT=0
NXT:
zero=0
DIGIT=cnt DIG 5
GOSUB CONVERT
Fourth=~pATTERN
DIGIT=cnt DIG 4
GOSUB CONVERT
Third=~PATTERN
DIGIT=cnt DIG 3
GOSUB CONVERT
Second=~pATTERN
DIGIT=cnt DIG 2
GOSUB CONVERT
First=~PATTERN
DIGIT=cnt DIG 1
GOSUB CONVERT
Sixth=~pATTERN
DIGIT=cnt DIG 0
GOSUB CONVERT
Fifth=~PATTERN
FOR I=1 TO 10
PAUSE 1
NEXT I
cnt=cnt+1
Fifth = Fifth + 1
If Fifth = 10 THEN
Fifth = 0
sixth = sixth + 1
If sixth = 10 THEN
sixth = 0
First = First + 1
endif
endif
GOTO NXT
DISABLE
ISR:
TMR0=216
portb=First
digit5=0
digit6=0
digit4=0
digit3=0
DIGIT2=0
DIGIT1=1
PAUSE 1
DIGIT1=0
portb=Second
DIGIT2=1
PAUSE 1
digit2=0
portb=Third
digit3=1
PAUSE 1
digit3=0
portb=Fourth
digit4=1
PAUSE 1
digit4=0
portb=Fifth
digit5=1
pause 1
digit5=0
portb=Sixth
digit6=1
pause 5
digit6=0
INTCON.2=0
RESUME
ENABLE
CONVERT:
LOOKUP DIGIT,[$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$6F],PATTERN
PATTERN= PATTERN^$FF
RETURN
END
Any questions I'll try to answer. Sorry for my slow response.


						
					
				
				
				
				
			

Bookmarks