Hi,
Yes I was using EEPROM for array storage but the 16f877 has only 256 bytes available. I will need about 4k just for pattern storage. That is why I'm looking at using the code program space. The problem seems to be my use of binary data input. Here's the code i'm using for testing.
' PCode.bas
' Quick Demo Program
' showing how you can play with
' Program Code Space
Define debug_pacing 1000 'serial setup
Define debug_reg porta
Define debug_bit 0
Define debug_baud 2400
Define debug_mode 1
TRISB= %00000000
TRISa= %00000 '
'
' RAM Assignments & Variables
' ---------------------------
PCAddress var WORD ' Used to determine ADDRESS of Data
' within Program Code space
PCData var BYTE ' Data Variable - in this example a BYTE
' but could be a WORD as each memory
' address is capable of storing 14-bits
PCWord var WORD
'
' Start Program
' =============
Pause 2000
DoitAgain:
PCAddress=7190 ' Pointer to start of Data area
'
' Read & Display till we get a stop character
' -------------------------------------------
ReadCodeLoop:
READCODE PCAddress,PCData ' Sequentially read bytes
If PCData>0 then ' Until a Stop character is found
debug "ADD=", dec pcaddress 'lcd display
debug 254,192
debug "DAT=", dec pcdata
PCAddress=PCAddress+1 ' Remembering to increment our address
portB=pcdata 'output data to portB LEDs
Pause 300
Goto ReadCodeLoop
endif
Pause 50
Goto DoitAgain
End
Asm
CODE 7190
DB 00000001
DB 00000010
DB 00000100
DB 00001000
DB 00010000
DB 00100000
DB 01000000
DB 10000000
DB 0
Endasm
........................
RESULTS
debug LCD readout values
00000001 = 1 OK
00000010 = 10 NG
00000100 = 100 NG
00001000 = 232 NG
00010000 = 16 OK
00100000 = 160 NG
01000000 = 64 OK
10000000 = 128 OK
Bookmarks