Define CONF_WORD = 0x23c4
Define CONF_WORD_2 = 0x3eff
EEPROM 0x00, 0x3f, 0x44, 0x44, 0x44, 0x3f, 0x7f, 0x49, 0x49, 0x49, 0x36, 0x3e, 0x41, 0x41, 0x41, 0x12, 0x7f, 0x41, 0x41, 0x41, 0x3e 'ABCD
EEPROM 0x14, 0x7f, 0x49, 0x49, 0x49, 0x41, 0x7f, 0x48, 0x48, 0x48, 0x40, 0x3e, 0x41, 0x41, 0x45, 0x16, 0x7f, 0x08, 0x08, 0x08, 0x7f 'EFGH
EEPROM 0x28, 0x00, 0x41, 0x7f, 0x41, 0x00, 0x02, 0x41, 0x7e, 0x40, 0x00, 0x7f, 0x08, 0x14, 0x22, 0x41, 0x7f, 0x01, 0x01, 0x01, 0x01 'IJKL
EEPROM 0x3c, 0x7f, 0x40, 0x20, 0x40, 0x7f, 0x7f, 0x30, 0x08, 0x06, 0x7f, 0x3e, 0x41, 0x41, 0x41, 0x3e, 0x7f, 0x48, 0x48, 0x48, 0x30 'MNOP
EEPROM 0x50, 0x3e, 0x41, 0x45, 0x43, 0x3f, 0x7f, 0x48, 0x44, 0x42, 0x31, 0x32, 0x49, 0x49, 0x49, 0x26, 0x40, 0x40, 0x7f, 0x40, 0x40 'QRST
EEPROM 0x64, 0x7c, 0x02, 0x01, 0x02, 0x7c, 0x60, 0x1e, 0x01, 0x1e, 0x60, 0x7f, 0x02, 0x04, 0x02, 0x7f, 0x63, 0x1c, 0x08, 0x1c, 0x63 'UVWX
EEPROM 0x78, 0x60, 0x18, 0x07, 0x18, 0x60, 0x43, 0x45, 0x08, 0x51, 0x61 'YZ
Dim x As Byte
Dim y As Byte
Dim offset As Byte
Dim message(72) As Byte
AllDigital 'set all pins to digital
TRISA = 0
TRISB = 0 'Portb all outputs
TRISC = 0 'Portb all outputs
ADCON1 = 0
WaitMs 120
Call loadarray()
x = 0
loop: 'main loop 5 x 4ms = 20ms = 50hz
For y = 0 To 10 'Works out 3 shifts a second
PORTA = 0x1
PORTB = message(x) 'First line
WaitMs 4
offset = x + 1
PORTA = 0x2
PORTB = message(offset) 'Second line
WaitMs 4
offset = x + 2
PORTA = 0x4
PORTB = message(offset) 'Third line
WaitMs 4
offset = x + 3
PORTA = 0x8
PORTB = message(offset) 'Forth line
WaitMs 4
offset = x + 4
PORTA = 0x10
PORTB = message(offset) 'last line
WaitMs 4
Next y
x = x + 1 'shift one pixel
If x > 66 Then x = 0 'If we get to 67 then we have done all lines
Goto loop 'loop forever
End
'Message area
Proc loadarray()
Dim y As Byte
Dim x As Byte
Dim fetch As Byte
Dim char As Byte
Dim col As Byte
Dim row As Byte
char = 0
For x = 0 To 66 Step 6 'Each character is 5 bytes
fetch = LookUp("HELLO WORLD "), char
char = char + 1
If fetch = 32 Then 'Ive made spaces into 4 blank lines
For y = 0 To 4
row = x + y
message(row) = 255
Next y
Else
fetch = (fetch - 65) * 5 'this is to find the offset in memory of each character
For y = 0 To 4
row = x + y
Read fetch, col
message(row) = 255 - col 'Invert the bits (You may not need to do this)
fetch = fetch + 1
Next y
row = x + y
message(row) = 255
Endif
Next x
End proc