PDA

View Full Version : Best way to store array of bytes?



Deadeye
- 31st May 2005, 22:58
All,

I am using a 16F628 which AFAIK doesnt have the ability to store Data values.

So I need to store every chariotor as an array of bytes.

Im taking serial in then setting the chr and running this section.

I know this is not the best way of doing it. Please advise a better or best practice way of doing such an operation.


PrintChr:
SELECT CASE chr
CASE " "
for i2=0 to 4
LOOKUP2 i2,[$00,$00,$00,$00,$00,$00],glcd_dat
GoSub send
Next
CASE "M"
for i2=0 to 4
LOOKUP2 i2,[$7F,$02,$0C,$02,$7F,$00],glcd_dat
GoSub send
Next
CASE "e"
for i2=0 to 4
LOOKUP2 i2,[$38,$54,$54,$54,$18,$00],glcd_dat
GoSub send
Next
CASE "h"
for i2=0 to 4
LOOKUP2 i2,[$7F,$08,$04,$04,$78,$00],glcd_dat
GoSub send
Next

END SELECT

' Add space after
glcd_dat = $00
GoSub send

RETURN



Thanks

mister_e
- 1st June 2005, 06:35
Why not using the internal EEPROM OR better, an External one since you'll need, for sure, more than the actual PIC codeSpace to produce your whole set of Character.

OR a mix of two... Internal one to store external EEPROM addess for each character and an external one for all your character.

once it's done just use something like


CharString var byte[5]

READ MyCharacter,ExternalEEPROMAddress
I2CREAD sda,SCL,cont,ExternalEEPROMAddress,[str CharString\5]
gosub send


Keep your codespace for your code... not for your character font definition.