Hi everyone I am working on this project that involves programming the EEPROM chip using assembly language but I do not know how to go about doing this. I am suppose to be able to read from, write to, edit, and erase the eeprom. What can I do? Where do I begin? thanks!

Dani AI

Generated

A few practical next steps and gotchas to make the project work reliably.

First, identify the exact EEPROM part number and read its datasheet. The datasheet defines the bus protocol (I2C, SPI, parallel), supply voltage, page size, required erase behavior, write-cycle time, status/ACK mechanisms, and the erased byte value. Those details drive every design choice, from wiring to the write/verify algorithm. General background: EEPROM, I2C, SPI.

Hardware checklist: wire Vcc/GND and proper decoupling, observe any write-protect or HOLD pins, and use pull-ups for I2C (typical 4.7k) or proper chip-select/level-shifting for SPI if voltages differ. Add series resistors when in doubt and make sure the MCU GPIOs can tristate the lines during host-controlled operations. A cheap logic analyzer or scope is invaluable to confirm bus activity and ACKs.

Suggested programmer flow (high level): host-side tool transfers an application image to MCU RAM using a framed protocol with length + CRC to detect transfer errors. MCU then programs the EEPROM in blocks that respect the device page size: issue a page write, then wait for the device to finish (either poll an RDSR/status bit for SPI parts or use the ACK/polling method for I2C parts). After programming, read back each block and compare CRCs (or full compare) to verify. Handle partial last pages, avoid crossing page boundaries in a single write, and throttle writes to keep within the device write-cycle limits.

Debugging tips and safety: start with single-byte write/read tests before full-image programming. Check expected erased value (usually 0xFF). If writes fail, inspect timing vs. datasheet, check pull-ups/levels, watch for accidentally enabled write-protect, and try small delays between operations. Tie these checks back into the state machine so failures are reported and retriable. Building on suggestions from and , keep host transfer reliability (framing/CRC) and device-aware page handling central to the design.

Recommended Answers

All 5 Replies

What would be more interesting would be what else is attached to the board which holds the EEPROM, and what kind of tools you've got to hand (for programming in assembler for example).

EEPROM is just another kind of memory, like RAM, except it doesn't forget. So programming it is just a matter of using the right tool, which will become (hopefully) much more apparent when you supply some more details.

I have to use HCS12 to design my own programmer that allows me to load, edit and view the data that you want to program into the EEPROM. Once I have programmed the EPROM, my programmer should allow me to verify that the correct data was actually programmed to the chip. We are using the MCU project board and Freescale CodeWarrior for the code. Is that what you meant.

It appears there are two ways you can do this. (1) I assume CodeWarrior is on a different computer, so after compiling/assembling your code create a flat binary file and this can be read through the serial port using TwinPeeks or (2) Emit machine language listing and enter it directly using TwinPeeks again.

TwinPeeks appears to be somewhat similar to debug in DOS.

So your EEPROM is not part of the MCU project board, but is a separate component you plug into it just for the purposes of programming it?

So basically, on the MCU, you need functions to
- detect the type of EEPROM plugged in
- download an image (from where?) to local memory
- erase an EEPROM sector (or whole device?)
- program it
- verify it

hai
thinks i know about is that I have to use hcs12 to design my own programmer that allows me to load, edit and view the data that you want to program into the EEPROM. Once I have programmed the EPROM, my programmer should allow me to verify that the correct data was actually programmed to the chip.
there are two ways you can do this. (1) I assume CodeWarrior is on a different computer, so after compiling/assembling your code create a flat binary file and this can be read through the serial port using TwinPeeks or (2) Emit machine language listing and enter it directly using TwinPeeks again. if u got much more useful sujessions pls send to me also
tanku

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.