Not-an-EEPROM course: Storing and Reading EEPROM Data

Dmitriy Analyst Ontario Posted   Latest  

Right away I would like to address why I titled the post “Not-an-EEPROM course”. If I understand correctly, most EEPROM courses are focused on solving a problem for a specific vehicle or brand, and achieving a goal (such as getting keys programmed in or odometer value corrected), by using special tools. This is not exactly what you will find below.

Instead, the course discusses general principles of how data items are stored into EEPROM, and how to parse a datasheet for an EEPROM chip and then read/write EEPROM contents using readily available microcontroller boards. It is intended for people who would like to know what happens under the hood (if EEPROM chips had a hood, that is), or what to do if a special tool to read a chip is not available.

Why have I decided to put this material together? I saw this post by Paul where he was interested in how Subaru odometer values are stored, and why the method looks so strange and complicated. To explain that requires understanding limitations of EEPROM chips, and how algorithms attempt to get around them. Thus, I poured over many many Application Notes, datasheets, and hex dumps to demonstrate use of such algorithms in real-world EEPROM examples.

The next question I wanted to address was what exactly happens when EEPROM is being read or written. I took a random EEPROM chip, the famous $4 microcontroller (Pi Pico – no relation to Picoscope, by the way), and a few other components, and made them communicate with each other. To confirm data transmission, I hooked the Picoscope in between the devices and used its serial decoder.

But to program the microcontroller I used MicroPython, which is a subset of Python language adapted to run on microcontrollers and access their peripherals. Just saying “OK, just learn Python first” would be pretty unfair, so I had to create a tutorial for Python. It may not be as eloquent as other Python tutorials (which you are welcome to check out as well, of course), but it focuses on manipulating binary and hex values, rather than printing “Hello World!”

And, thus, 2.5 hours of video material got recorded. I put it on my website for 3DNTs. If you are interested, go to …​.​com/software/AWSM , sign in with Google, and scroll down to Storing Data into EEPROM tab for sign up instructions. Also, the course frequently references concepts from Binary and Hex course, which you can pick up there as well (see Binary and Hex, Module 1 tab).

Below you will find course descriptions and a few screenshots. Please let me know if you have any questions.

Storing Data into EEPROM

  1. What EEPROM is and what its limitations are;
  2. Error detection, correction, and wear-leveling;
  3. Using triple redundancy: VIN and Key data examples;
  4. Using circular buffers or rings to implement counters: Odometer values example;

Python Primer

  1. Downloading and installing Python;
  2. Using Python as a calculator: basic operators;
  3. Variables and Functions;
  4. Strings;
  5. Converting Binary and Hex to Decimals and back;
  6. Lists and Dictionaries;
  7. Branching: IF-ELSE;
  8. Loops: FOR and WHILE;
  9. Modules: installing and importing;
  10. Writing your own functions;

Program EEPROM using MicroPython

  1. Electrical interfaces to EEPROM chips;
  2. Reading EEPROM datasheets: 93C66B as an example;
  3. Selecting microcontroller: Raspberry Pi Pico;
  4. Using voltage level converter;
  5. Reading values from EEPROM using MicroPython;
  6. Confirming data transmission using Picoscope;
  7. Creating functions for EEPROM library;

diag​.​net/file/f4dsn6c79…

diag​.​net/file/f1sn1w2rd…

diag​.​net/file/f43kt4lvj…

+6
Helpful
Thanks
Interesting
Paul Owner/Technician
California
Paul
 

It looks like fun :) I've just signed up. Coding is one of the big gaps in my knowledge, so I'm looking forward to learning a little about Python.

+1
Ð Awarded
Thanks
Dmitriy Analyst
Ontario
Dmitriy
 

Thank you, Paul! You (and all others that signed up already) should have access to the videos. And if you have suggestions on how to improve presentation or research something deeper, send them my way (if desired, for private messages use the Contact link on the website).

0
Ð Awarded
Bill Owner/Technician
Michigan
Bill
 

Sounds interesting! Thanks for taking the time to put this together and share

+4
Ð Awarded
Agree
Helpful
Interesting
Thanks
Enrique Diagnostician
California
Enrique
 

great stuff Dimitry, signed up as soon as I saw it. please keep it coming!!

+1
Ð Awarded
Thanks
Adam Technician
Minnesota
Adam
 

the part about error detection, correction, wear leveling and especially the ‘twisted ring’ concepts were fascinating, thank you for this course! i am currently doing a coding bootcamp so the Python intro was very nice as well, fun to see the differences between JS and PY. looking forward to more!

+1
Ð Awarded
Thanks
Dmitriy Analyst
Ontario
Dmitriy
 

Thank you, Adam, I am glad you found it interesting!

0
Ð Awarded