Shop OBEX P1 Docs P2 Docs Learn Events
Use external eeprom to hold info for serial LCD — Parallax Forums

Use external eeprom to hold info for serial LCD

V8TR4V8TR4 Posts: 3
edited 2008-09-28 14:51 in BASIC Stamp
Hi Everyone,

I would like to combine a BS2 and a serial LCD along with external eeprom and store all the text for the LCD on the eeprom. Is this possible to achieve?

Thanks,
Mark

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-09-26 17:52
    Yes.
  • $WMc%$WMc% Posts: 1,884
    edited 2008-09-27 21:30
    V8TR4
    I'm working on a the same project w/ the BS2P40
    I just started. I have a 24LC25b, 24LC256, and a 24LC32a. If you beat me to punch please POST IT!!!
    Once I get it to work,I'l post what I came up w/ and a "Test Code" to go w/ It.

    Sorry I'm not much help,But if We put are heads together;Take the Best of both of are Codes,It should be something Good

    I'm gonna try to use a 1 wire serial protocal to free up an I/O pin.I'll put the EPROM loader up @ the begaining of the code,Load it before the "Main:' program starts, and use a sub routin to get DATA from the EPROM

    I'll Post My findings later this week,And I'll look for your Post!!!

    $WMc%____out
  • SolarBlitzSolarBlitz Posts: 2
    edited 2008-09-28 14:51
    I've also been trying to maximize memory on my BS2pe. The extra 8 banks of EEPROM are nice... I also have external I2C EEPROM. (My next trick will be 'bank switching' - using one slot to copy code from EEPROM to a 3rd slot).

    This is code I've used successfully to pull text strings (which take a huge amount of memory) from otherwise unusable EEPROM.


    var1 = 8 'slot for text data
    eeprom_add = $01D0 ' this is a pointer to the first character in the string you want to print
    var2 = 25 ' length 'number of characters to retrieve
    GOSUB EEPROM_PRINT



    EEPROM_PRINT:

    STORE VAR1 ' this is passed from the calling argument (if you're using multiple 'onboard' slots)
    FOR memory1 = 0 TO var2
    READ eeprom_add+memory1, value
    PAUSE 5
    SEROUT txpin, baudrate, [noparse][[/noparse]value] ' I use this to print to a serial LCD screen
    PAUSE 5 ' these are here just for the serial LCD.. can be removed if only using 'DEBUG' -
    DEBUG value ' output to debug

    NEXT

    RETURN


    The 'Store' command is useful is swapping between 'onboard' memory slots.


    if you're using an I2C eeprom... you should consult the chip documentation...
    the I2C snippets are below...
    '
    ' EEPROM Snippet
    '

    EEPROM_READ_WRITE:
    I2COUT SDA, $A0,eeprom_add.HIGHBYTE\eeprom_add.LOWBYTE, [noparse][[/noparse]value]

    PAUSE 20

    ' Reading Section
    I2CIN SDA, $A1,eeprom_add.HIGHBYTE\eeprom_add.LOWBYTE, [noparse][[/noparse]value]
    RETURN

    This works well. I've found that setting these variables and calling the function saves TONS of programming space.
    calling it is almost equivalent to: DEBUG "SPOT", CR (5 chars output)... and you can use it for up to 255 chars... over and over.

    Good Luck !!


    SolarBlitz
Sign In or Register to comment.