




My overengineered EEPROM programmer (+ my perfboarding technique)
(Sorry for reposting, the images didn't show up as a carousel properly the first time and I don't know how else to fix it)
Howdy, guys. As several others seem to enjoy doing here, I've made a permanent version of my Arduino Nano EEPROM programmer module. I want to preface by saying that I didn't even watch Ben's video past where he started writing code, because I knew I could do it all on my own and then watch what he did, as that would be interesting.
Major differences:
- I didn't even know shiftOut() existed. I used SPI COPI (D11) as my serial output and SCK (D13) as my serial clock pin, and used the Arduino SPI module to shift out bytes. You simply tell SPI the LSB_FIRST or MSB_FIRST order and clock speed, and then send bytes out. It even has a "transfer16" function that takes an int and would fill both 595's.
- I made all my pins have configurable assignments, which will be significant in a second.
- I made a serial interface with both a read and write function. I did take inspiration from Ben's "read" format. My serial interface asks how many chunks you want to see and prints them out, and the write interface uses a "chunking" technique that currently reads chunks that are at most 64 bits wide, before sending an "ACK" byte for the sender to respond to and send the next 64 bytes. It then reads the ROM contents back and prints error messages if certain bytes did not write properly. The hardware serial input bus is 64 bits, so you need chunking to avoid buffer overruns from data being written faster than you can write it out when you are trying to write the whole chip's 2 kilobytes. The serial buffer ends up "catching up" and dropping bytes at any speed faster than like 1200 baud, which is absurdly slow and I was not going to stand for it.
- I actually followed the datasheet specification and made my write flashes last under 1000 nanoseconds by using register-level outputs and assembly NOP operations to make my write flashes last about 400 nanoseconds each. I didn't think I could get away with what Ben did, I kind of jumped the gun here.
- I realized I don't even need two shift registers. One is just fine including the Arduino's digital pins. It's actually really close, but it's perfect with only one 595.
A few years ago I devised a technique for perfboard planning, where I abuse KiCad, making it act like a perfboard routing simulator.
- I created the schematic and ONLY placed the connections that were absolutely set in stone (SPI pins with SPI pins, power distribution, strict "no connect" marks on unused pins etc.) and I left all usable digital pins open, to be distributed during actual routing. This is because digital pins can just be assigned to their jobs in the software, which lets the hardware be far nicer.
- I made the grid size 2.54 mm to enforce the perfboard geometry.
- I made the "traces" the same exact width as my spool wire, so I could visualize how much space they would actually take up.
- I treated the front and back of the "PCB" as the front and back of the perboard, giving me insight into where I could weave wires, though I like to avoid this.
It worked first try, which I would have hoped after all that. I hope y'all find this cool and my biggest hope is that my perfboarding technique gives others ideas. I'm sure it's been done before, but I came up with it myself and haven't seen others do something like it. I love aesthetically pleasing circuits.