Shop OBEX P1 Docs P2 Docs Learn Events
is there an easy way to move eeprom data? — Parallax Forums

is there an easy way to move eeprom data?

Dr HondaDr Honda Posts: 2
edited 2006-12-21 05:57 in BASIC Stamp
Hi All,

I’ve worked with stamps in the past, and I know they can interface with an I2C device. So, my question is… is there an easy way to copy data from one I2C device to an other?

The project I’ve been asked to do is the build a stand alone programmer.· I figure I can put the original chip in “The Box” on a set of pins from on a BS2… and set the chip to be programmed on a second set.

Can I stream data from one chip to the other… or do I have to read a bit from the original, and then writ it to the slave?

I know the BS2p has I2C commands… but I have a couple BS2 OEM’s in front of me.

Just as an FYI… I’m an R&D Chemist, but I have a physics background… so the people I work with figure I can do what they need with electronics. ·To be honest…I know just enough to be dangerous.· [noparse]:o[/noparse])

Thanks in advance for the help.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-20 22:05
    I'm pretty sure you have to 'read'..'write' -- I'd be AMAZED if there's an "I2C Streaming Copy" mode.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-20 22:20
    There are some articles in Nuts and Volts on using I2C devices with a BS2 complete with sample programs. There's no streaming mode, but you can easily enough copy the data a few bytes at a time. Most EEPROMs allow you to specify a starting address, then transfer some number of bytes without readdressing. For writing, this provides a "page mode" where you can write some number of bytes (usually 32), then the EEPROM does the write when you end the transfer. You have to wait for the EEPROM to finish (usually about 5ms), then you can transfer the next group of bytes.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-12-20 23:05
    Dr. Honda -

    Exactly what kind of chip (a chip number would be great) are you trying to "program" and where are the instruction for performing such a function? It's a little difficult to answer a rather open ended question such as yours without more or better information.

    Just to explain what I mean a bit further, perhaps the word "program" is what's at issue here. There are really two forms of programming (that we need to deal with here) and one represents the written efforts of an applications or software·programmer. He/she composes the (usually) human readable instructions and directives to have the platform do what is neseccary or desired.

    The other form of programming is hardware of firmware programming which is much closer to the hardware itself. One generally hardware "programs" (in the most common sense of the verb) a micro-controller, a micro-computer, a mini-computer, a PC,a Mac,·and a mainframe (et al). Most usually, hardware of firmware programming places an intelligent, operational set of instructions (as supplied by the human programmer) inside one of the platforms above.·in order that it may operate in some logical and productive manner. Such a software program may have inputs, outputs and do both calculations and logical operations. At the hardware programming level, one only looks at (genrally) binary codes.

    Generally speaking, one writes to or loads a memory chip, EEPROM, flash memory, etc. Admittedly, the "PROM" part of EPROM, EEPROM and just plain PROM represents "programmable read-only memory" but that's really more of an adjectival or adverbial reference than a verb reference per se, as there is non-programmable read only memory which can not be altered.

    Just by way of example. the PBASIC Stamp Interpreter chip·represents such a non-programmable read only memory (on a micro-controller), once the operational program is loaded on and written to·(or programmed into)·the PIC chip. There is indeed a proper and important set of rules for doing that hardware "programming", which must be followed to the letter, for the hardware programming, in order that it may work properly.

    I hope I didn't bring confusion to this issue.

    Regards,

    Bruce Bates
  • Dr HondaDr Honda Posts: 2
    edited 2006-12-21 02:03
    Hi Guys,
    ·
    Thanks for the input.· I figured I would have to read\write to the target device.
    ·
    Bruce…
    ·
    No… I don’t think you added confusion to the subject.· I’m close to the project, and in my mind… I know what I mean.· And sometimes, I assume others understand me. (normally that’s my bossturn.gif ) I was vague on my original post.· But… since you dove deep into the semantics of the chip/computer world… it will help others understand what I’m doing.
    ·
    To be specific… I need to load code into a 24c02 I2C serial EEPROM at production levels. ·Well, at least a few hundred at a time. ·Right now, I’m writing them with a PC and a basic serial interface.· The problem is… Since I was the one who built the interface, and designed the code to be put on the chip… and because my loading software isn’t very user friendly… I’m the one who gets stuck writing the chips for my packaging department.· So, now it’s my responsibility to make an “Idiot proof” hand held chip programmer. ·One where the user can not accidentally change something in the original code.
    ·
    The programmer I’m thinking of building will have an LCD with very simple instructions, and menus.· After it is powered up, the end user will select a machine model, then select the “Color” chip they want to program. (the chips are used on color toner cartridges)· The nice thing about the I2C bus is, the chips I’m using are mounted to a small board, and they are hardware addressed on the buss.· So if the end user tries to program a “Cyan” chip with “Black” code… it won’t respond.
    ·
    I know how to build the hardware, and I know how to write the code for the BS2 to operate the LCD, drive the menus, and read the button inputs.· I’m just not sure how to go about writing the code to read a few bits from a master 24c02, and then deliver that package to the slave 24c02.
    ·
    So, any links to some sample code would be great.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-21 03:14
    Read this Nuts and Volts article about using I2C: www.parallax.com/dl/docs/cols/nv/vol5/col/nv115.pdf
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2006-12-21 05:57
    The speed of the final product will be much faster and the pBasic will be much simpler if you spring for a BS2p, compared with the OEM BS2s you have in hand. Sorry. The native I2C compresses into one command what woulld otherwise takes many, furthermore, the I2C can read/write a whole string of bytes in one swoop using the same modifiers as the SERIN/SEROUT commmands. That combined with the page mode that Mike mentioned would make it very nearly seem like streaming from one to the other. During the 5 or so milliseconds that one eeprom is programming one page, the BS2p could make its way around to other eeproms in round robin fashion.

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