Not-an-EEPROM course: Storing and Reading EEPROM Data
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
- What EEPROM is and what its limitations are;
- Error detection, correction, and wear-leveling;
- Using triple redundancy: VIN and Key data examples;
- Using circular buffers or rings to implement counters: Odometer values example;
- Downloading and installing Python;
- Using Python as a calculator: basic operators;
- Variables and Functions;
- Converting Binary and Hex to Decimals and back;
- Lists and Dictionaries;
- Branching: IF-ELSE;
- Loops: FOR and WHILE;
- Modules: installing and importing;
- Writing your own functions;
Program EEPROM using MicroPython
- Electrical interfaces to EEPROM chips;
- Reading EEPROM datasheets: 93C66B as an example;
- Selecting microcontroller: Raspberry Pi Pico;
- Using voltage level converter;
- Reading values from EEPROM using MicroPython;
- Confirming data transmission using Picoscope;
- Creating functions for EEPROM library;
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.
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).
Sounds interesting! Thanks for taking the time to put this together and share
great stuff Dimitry, signed up as soon as I saw it. please keep it coming!!
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!