Shop OBEX P1 Docs P2 Docs Learn Events
Newbie drools over big EEPROM — Parallax Forums

Newbie drools over big EEPROM

UghaUgha Posts: 543
edited 2008-03-01 18:57 in BASIC Stamp
I just saw a 64kx8·EEPROM for sell fairly cheap and I'm doing some
serious drooling.

The problem is I don't know jack about them... I know the information
is available but before I spend the next week reading up on them, I
want to check and see if my ideas are even possible.

I understand I can't just pop out a BS2's EEPROM and replace it... but
can I create my own command set for the BS2 then have it read instructions
using that command set from the EEPROM fairly easily?

For example:
I write a BS2 program that writes to a section of the large EEPROM my
command code (For example, R550&L750&PCHK would translate into
Right servo 550, Left servo 750, Ping check).
Then I program the BS2 with the interpreting program that can read
from the large EEPROM and execute whatever I want it to do.

My concept is to include things in my command set something like if-checks
and simple loops that the BS2 can then execute based on its internal
programming.

Using a system like this, I could store multiple "programs" on the large
EEPROM and load them in as needed for the situation.

Actually, now that I think about it, this is a heck of a lot like what Parallax
did when programming the PIC in the first place [noparse]:)[/noparse]

Related·questions:
I know writing to EEPROM is slow, but what about reading from it? Would
there be a lag for each read?

How hard would it be to use the EEPROM in this manner (Excluding writing
the interpreter for the BS2... which I know will be extremely hard).

Would I require any additional components to use the EEPROM? (I will
study the info in the Stampworks document, I believe it talks about EEPROM.
I'm mainly asking for any info beyond whats in there).

Are there drawbacks to using large memory like this?

I eventually want to network two BS2s for parallel processing. Would I need
some kind of Mutex (C programming term for locking access to only one thread
or process at a time) or can an EEPROM chip handle writing/reading at the
same time? Or at least multiple reads at the same time?

Any other info that you guys think might aid me is greatly appreciated.
Including telling me my idea is stupid and will never work [noparse]:)[/noparse]

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-03-01 17:34
    Ugha -

    At your present level of understanding, I would have to opt for the following:

    "Including telling me my idea is stupid and will never work".

    However, 10 years hence, you might own the next company like Parallax - who knows!

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Genius is one percent inspiration and ninety-nine percent perspiration."

    Thomas Alva Edison
  • UghaUgha Posts: 543
    edited 2008-03-01 17:35
    Thanks for the honesty [noparse]:)[/noparse]

    Do you think my basic concept is flawed or just the fact I don't know enough?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-01 17:50
    You have a lot of questions. Your general idea isn't stupid, but it may or may not work well enough to do what you want.

    1) There are some good articles in the Nuts and Volts series that go into detail about hooking up I2C EEPROMs and other I2C devices to a Stamp. As usual, they have schematics and sample programs for the BS2 and BS2p modules. Between the StampWorks manual and the Nuts and Volts articles, you'll have pretty much all the information you'll need other than maybe the specific datasheets on the parts you have.

    2) Yes, writing to an EEPROM is slow. It takes about 5ms to do a write cycle. Read cycles are faster ... as fast as you can do the I2C protocol. On the Stamps, it's maybe 50 to 100 KBaud with quite a lot of overhead information. You can get maybe 2-3K bytes per second on random reads.

    3) Doing an interpreter for high level robotics functions is actually a good idea in that the time to actually do an operation is much longer than the time to fetch and interpret the operation.

    4) It's possible to attach one EEPROM or several to an I2C bus with more than one master (BS2). You'll have to find some application notes on the NXP website. None of the examples and none of the built-in statements (I2CIN / I2COUT) in the BS2p models have provisions for more than one bus master. The EEPROMs themselves can't do it. They get a valid command to read or write and do it, then wait for another command. Probably the best way to do this would be to have the BS2s negotiate for control of the I2C bus completely independently from the EEPROMs so that there's only one bus master at a time. The others will just leave their I2C pins in input mode so they don't affect the I2C bus.

    Post Edited (Mike Green) : 3/1/2008 5:57:29 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-03-01 17:50
    Ugha -

    Simply put, in one word: both. Sorry for the rank honesty, but one needs to expect that before they can move forward in a positive direction.

    Keep thinking! That's what it's all about. Thinking OUTSIDE the BOX is even better. That is a developed talent in my estimation, and one that can't be taught or learned. It comes from dedicated experimentation, a lot of hard work, lots of failures, and a yearning for learning!

    Never fear becoming great!

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Genius is one percent inspiration and ninety-nine percent perspiration."

    Thomas Alva Edison
  • UghaUgha Posts: 543
    edited 2008-03-01 18:01
    Mike: Once again your a treasure trove of info, thanks [noparse]:)[/noparse] If I ever try this project, I'll most likely follow your advice and have
    the BS2s use some kind of protocol (basicly a mutex) between them.

    I'll start my quest of discovery now using your recommendations.

    Bruce: I understand what your saying, but can you give me a little more detail about why my concept is flawed? If I understand
    whats wrong with it, maybe I can come up with a better one. It'll help me learn knowing I'm going in the right direction.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-03-01 18:37
    Ugha -

    I have no qualms about giving you your lead. Here is an integral part of the shared-processor system you were describing.

    Just to start you on your way, let's look at dual-port, serial EEPROM memory, and see how you get along with that as an experiment. This permits shared access of a common memory with minimal waiting, between two Stamps (or other) processors. It uses standard or fast I2C for communications. Here is the link:
    http://www.catsemi.com/products/CAT24C208.asp

    There are much better ways of sharing memory, such as using parallel access, but that gets a good deal more complicated. Let's "keep it simple".

    You will need to use at least a BS-2p since it uses I2C, unless you want to learn how to bit-bang I2C on one of the smaller Stamp processors.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Genius is one percent inspiration and ninety-nine percent perspiration."

    Thomas Alva Edison
  • terry_bearterry_bear Posts: 84
    edited 2008-03-01 18:57
    Ugha,

    I would hesitate to say that it can't be done; It's more likely a case of how much time, effort, etc. do you want to invest in the idea?

    A good place to start might be Nuts and Volts column 72. It covers multiple programs in one Stamp (not large ones, nor needing a larger eeprom), and passing data from one program to another. It also gives you a great tool for identifying one-wire devices on a one-wire buss, something that you will run into sooner or later, I would imagine...

    EME Systems has a good article that you will prabably find useful at a later date. It doesn't apply directly either, but may fit in, in the future...
    http://www.emesystems.com/BS2clone.htm

    Regards,

    Terry
Sign In or Register to comment.