Code:
EEPROM 0, [0,0,0,0,0,0,0,0,1,2,4,8,16,32,64,128]
EEPROM 17,[1,2,4,8,16,32,64,128,0,0,0,0,0,0,0,0]
EEPROM 40,[$00,$00,$00,$00,$00,$7C,$40,$40,$78,$40,$40,$7C,$00,$00,$00,$00]
EEPROM 57,[$00,$00,$00,$00,$00,$7C,$10,$10,$10,$10,$10,$10,$00,$00,$00,$00]
EEPROM 74,[$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00]
DEFINE LOADER_USED 1
@ Device pic16F877, XT_OSC, BOD_OFF, PWRT_ON, WDT_OFF, PROTECT_OFF,WRT_ON
INCLUDE "modedefs.bas"
TRISA = %00000000
TRISB = %11111111
ADCON1 = 7
OPTION_REG = $55 ' Set TMR0 configuration and enable PORTB pullups
INTCON = $A0 ' Enable TMR0 interrupts
T0IF VAR INTCON.2
on interrupt goto int1
Strobe Var Porta.0
Latch var Porta.1
Clock Var Porta.2
Sin3 var Porta.3
Sin2 var Porta.4
Sin1 var Porta.5
Datasin3 var word
Datasin2 var word
Datasin1 var word
Scanrow1 con 0
Scanrow0 con 17
font0 CON 40
font1 CON 57
font2 CON 74
font3 CON 91
COLUM3 VAR BYTE
COLUM2 VAR BYTE
COLUM1 VAR BYTE
COLUM0 VAR BYTE
ROW1 VAR BYTE
ROW0 VAR BYTE
font0X VAR BYTE
font1X VAR BYTE
font2X VAR BYTE
font3X VAR BYTE
S1 var bit
S2 var Bit
S3 Var bit
I var byte
K VAR BYTE
X var byte
Z var Byte
Main:
TMR0 = 0
Strobe = 1'strobe off
latch = 1'lactch off
clock = 1'CLOCK OFF ACTIVE HIGH
Sin3 = 0
Sin2 = 0
SIN1 = 0
' WHILE 1
' WEND
'What will happen here? What is it you wanted to do? And where is the loop?
DISABLE
int1:
T0IF = 0 'clear the interrupt flag
' TMR0 = 223
' ????
STROBE = 1
FOR K = 0 TO 8
READ (FONT1+K),COLUM2
READ (FONT2+K),COLUM0
READ (SCANROW0+K),ROW0
GOSUB SCANDATASIN8BITLOWBYTE
READ (FONT0+K),COLUM3
READ (FONT1+K),COLUM1
READ (SCANROW1+K),ROW1
GOSUB SCANDATASIN8BITHIGHBYTE
LATCH = 0
PAUSEUS 50
LATCH = 1
STROBE = 0
PAUSEUS 150
STROBE = 1
next k
FOR K = 8 TO 16
READ (FONT1+K),COLUM2
READ (FONT2+K),COLUM0
READ (SCANROW0+K),ROW0
GOSUB SCANDATASIN8BITLOWBYTE
READ (FONT0+K),COLUM3
READ (FONT1+K),COLUM1
READ (SCANROW1+K),ROW1
GOSUB SCANDATASIN8BITHIGHBYTE
LATCH = 0
PAUSEUS 50
LATCH = 1
STROBE = 0
PAUSEUS 150
STROBE = 1
NEXT K
resume
enable
SCANDATASIN8BITLOWBYTE:
FOR I = 0 TO 8
S3 = colum0.0[i]
S2 = colum2.0[i]
S1 = row0.0[i]
Sin3 = S3
Sin2 = S2
SIN1 = S1
clock = 1
PAUSEUS 50
clock = 0
NEXT I
RETURN
SCANDATASIN8BITHIGHBYTE:
FOR I = 0 TO 8
S3 = colum1.0[i]
S2 = colum3.0[i]
S1 = row1.0[i]
Sin3 = S3
Sin2 = S2
SIN1 = S1
clock = 1
PAUSEUS 50
clock = 0
NEXT I
RETURN
Bookmarks