Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM Storage — Parallax Forums

EEPROM Storage

ArchiverArchiver Posts: 46,084
edited 2001-04-06 02:10 in General Discussion
Hi,

How can I store data to the EEPROM in a looping routine? I am using
the ADC0838 routine. It goes through each channel. I want it to go
through each channel on the ADC0838, store the data all in different
places in the EEPROM. Is this possible? How?

Thanks,
Corey

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-04-05 22:48
    >Hi,
    >
    >How can I store data to the EEPROM in a looping routine? I am using
    >the ADC0838 routine. It goes through each channel. I want it to go
    >through each channel on the ADC0838, store the data all in different
    >places in the EEPROM. Is this possible? How?
    >
    >Thanks,
    >Corey
    >
    >
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    result var byte ' from ADC0838
    channel var nib ' 0 to 7
    address var word ' points to eeprom location

    loop:
    sleep 3600 ' sleep for one hour
    for channel=0 to 7 ' get data from 8 channels
    gosub adc0838 ' not shown, returns byte result
    write address+i,result
    next
    address=address+8
    if address<1024 then loop ' back for more data
    memoryfull:
    end


    The above assumes you are using 1/2 of the BS2 memory to store your data.

    -- best regards
    Thomas Tracy Allen PhD
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-06 00:36
    Tracy,

    What is the sleep command for?

    TIA,
    Ray McArthur

    > loop:
    > sleep 3600 ' sleep for one hour
    > for channel=0 to 7 ' get data from 8 channels
    > gosub adc0838 ' not shown, returns byte result
    > write address+i,result
    > next
    > address=address+8
    > if address<1024 then loop ' back for more data
    > memoryfull:
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-06 02:10
    >Tracy,
    >
    >What is the sleep command for?
    >
    >TIA,
    >Ray McArthur
    >
    >> loop:
    >> sleep 3600 ' sleep for one hour
    >> for channel=0 to 7 ' get data from 8 channels
    >> gosub adc0838 ' not shown, returns byte result
    >> write address+i,result
    >> next
    >> address=address+8
    >> if address<1024 then loop ' back for more data
    > > memoryfull:


    Just a "typical" or example data logger. Take a reading once an
    hour, sleep in between. Without the SLEEP or some other delay or
    timing mechanism, the memory would fill up in no time! The SLEEP has
    nothing to do with the original question.

    -- Tracy
Sign In or Register to comment.