Shop OBEX P1 Docs P2 Docs Learn Events
Increasing sample rate/capacity — Parallax Forums

Increasing sample rate/capacity

achilles03achilles03 Posts: 247
edited 2004-11-23 19:44 in BASIC Stamp
I've run into a small problem with a project.· I have an 8bit ADC sampling an IR sensor, and I'd like to have 30 seconds of data with 150 samples/sec minimum.· Unfortunately, that's more than twice the eeprom size, and I can't go to other program slots because I'm currently limited to the BS2 industrial version.· Writing each sample to an external eeprom takes time, and I·can't make the 150 samples/sec with that.

One thing I was considering was to connect the ADC dataout pin directly to the eeprom DI pin.· Then "shiftout" the eeprom with a write enable command, followed by the write address, and then bringing the chipset low on the ADC and "shiftout" the ADC reading on a null BS2 pin (and the data would go to the eeprom, which is waiting for the data).· The clockpin on the eeprom and ADC would be the same BS2 pin.· Would this work?

Are there any other ways to speed up writing to an eeprom without recording it on the BS2?

Thanks in advace!
Dave

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-23 19:22
    There are a couple of problems with that scheme. First, most eeproms have a small page size for writing data, 16 or 32 bytes, and the pointer wraps around to the beginning of the page. So you can't stream data into the whole memory. You have to send a new address to begin each page. Second, once the eeprom gets the command to write a page, it takes it 3 or 4 milliseconds of busy time before it is able to accept another command or data. By the way, when you write to the BS2 eeprom, it is slow because it needs the busy time for each individual byte, not just for each page.

    Flash memory like the AT45DBxx series from Atmel is meant for data streaming as you might have in a voice recorder. It has a couple of RAM buffers that mirror the data pages, so while the chip is busy writing data into one flash page, you can be streaming data into the other RAM buffer. To acheive the high speed continuous writes, you ping-pong between the two RAM buffers.

    I don't think you could do the clever direct streaming from the ADC into memory though, as the data would still have to go through the Stamp and the Stamp would have to manage the paging. But at least you wouldn't have to wait for the write to individual eeprom bytes. It might be possible to acheive your 150 bytes per second goal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • achilles03achilles03 Posts: 247
    edited 2004-11-23 19:33
    Wow, thanks for the response. I'm definately intrigued by a flash memory solution. I'd guess that writing to a flash mem chip would be about as fast as writing to the BS2's own memory (and I can get 150 samples/sec with that, but run out of space). Is there any documentation on interfacing the BS2 to a flash chip?

    Thanks for the help!
    Dave
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2004-11-23 19:44
    This URL has some starter information:
    www.emesystems.com/BS2flash.htm
    and here is an Atmel app note to dig into:
    www.emesystems.com/pdfs/parts/AT45DB041_apps.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.