Build an Arduino EEPROM programmer

preview_player
Показать описание


Parts list for the programmer:
- 1x Arduino Nano (or most any other kind)
- 2x 74HC595
- 1x 28C16 EEPROM (should also work for 28C64 or 28C256)
Рекомендации по теме
Комментарии
Автор

Excellent video but one minor comment on the code. Currently in the write eeprom routine you set all the arduino pins to outputs and then set the address and turn the output enable off. If you had previously read the eeprom then the output enable would be active and for a very short time the eeprom's data lines would be driving the bus and the arduino pins would be as well causing contention on the bus and possible damage. It would be better to turn off the output enable before switching the arduino pins to be outputs to avoid this.

grhmsmth
Автор

Im a house builder and for years I have been trying to get my head around basic programing and electronics. I have collecting machine parts and pieces. I have many little projects that require electronic control. Every machine I have built required manual control. I really get it now and all my learning has suddenly come togeather. Thanks so much for putting such a good learning video togeather. Dale

clearpath
Автор

I love it! I imagine that programming EEPROM can get pretty complex with larger storage spaces, but this implementation really beats dropping 50 + dollars on a read / writer. AND you learn a lot. So thank you, from a beginner,

Tannerlegasse
Автор

Honestly speaking, I have never yet seen anyone else to explain these concepts in such minutely detailed way. Thanks a lot for all your hard work and time.

puspamadak
Автор

Funny how computing has changed so much, yet this takes me back to my old C=128 days when I used to subscribe to COMMODORE and RUN magazines, each came with programs in machine code that you had to type in using a machine code monitor program (which you had to type in the first time you used it as well). I never really understood how that worked until now, but I spent many a day typing these codes in as my good wife set dutifully beside me reading the code as I poked them into the old machine, then saved them to a 5 1/4 inch floppy. I am loving this whole series, you make a wonderful teacher, I always thrived in college when the instructor showed, hands on how things worked, even studying the law, it was the hands on paperwork that drilled down into my brain to leave the data permanently written to my memory core.

JerryEricsson
Автор

I'm currently watching through your playlist on building the breadboard computer and I have to say I really (!) like the style with the continuous commentary over the speed up parts. There are videos of people speeding up parts but they'll first finish the comment and then speed it up without any commentary then. Your style is more compact and fluent!

If I had the endurance I would probably try to recreate your breadboard computer, because it actually has taught me a lot on how CPUs internally work. Sure modern CPUs are way more complicated but in their essence they work like yours, but in yours you can see how everything is ticking along!

xZise
Автор

If Ben is improvising during the video, then he is a super star indeed and if he really plans each step on the way then he is a super super star ....really unbelievable great tutorial ....well done young man.

ahmedgaafar
Автор

Hi Ben. Good educational stuff. But just thought I’d point out that the issue you saw with your incorrect read following write, is because you didn’t implement the (not)DATA POLLING, outlined in the 28C16 data sheet. 
ie. "The AT28C16 provides DATA POLLING to signal the completion of a write cycle.”  
DATA POLLING uses the inversion of the most significant bit (when a post write read is performed) to indicate the write busy state. Please also note that the other read bits (other than MSB), are indeterminate during the data polling busy state.
So when you saw two subsequent reads of 0x81 after writing 0x2A, you’ll note the byte you wrote (0x2A) has a 0 MSB, and the read value (0x81) has a 1 MSB (ie. inverted 0 indicating busy state). The remaining bits of the 0x81 byte being indeterminate.
By the third byte read, the busy state was complete, and the 3rd address data byte, and onwards, were then correctly retrieved. 
Likewise, the same can be seen with your second attempt to write 0x00, where you then read 0xAA bytes.  Again, note the MSB is inverted from 0 to 1, to indicate data polling busy state.
In summary: Although the Write Cycle Time is spec’d as max 1ms, you really shouldn’t just assume a 1ms delay will do the trick. The correct implementation would be to perform a read loop after a write, to poll for a non inverted MSB of the byte just written, to await busy state completion.

gregclare
Автор

Dear Ben,

What type of CPU did you use in your brain?

userad
Автор

I have never seen anybody putting dry Theorie better to life than you in ur Videos. It Shows me that the Things I get thaught in uni are actually relevant and thats the best Motivation there is. Cant wait for ur next Video! Greetz from Germany

cheesecake
Автор

Pro tip: You can use the analog pins of the Arduino as Digital GPIO pins :)

narayanbandodker
Автор

Before I found your channel the best thing I could do is program a tiny 45 with my arduinos. Thank you so much for making me understand that I can program so much more!

wnnlbph
Автор

If you read the datasheet carefully, it says if you read from the chip, and the write cycle is not yet finished, the MSB of the data will be the INVERSE value of the data you are writing. The other data outputs are undefined at this time.

After pulsing the /WR line, you should enable the chip output and monitor the value of IO7, waiting until it matches the MSB of the byte you wrote. That way you're not stuck inserting arbitrary delays in your code, and you can never enter in to a race condition with the write cycle, like you are here.

This is the reason you get funky data when reading the chip, directly after writing to it.

MadManMarkAu
Автор

What? A 57min video?.... my lucky day. So much to learn today.

garydunken
Автор

You could have used the analogue pins as outputs also. Pns A0 - A5 are on PORT C which can be used as normal IOs 😁 A6-A7 are only connected to the ADC MUX though.

Stabby
Автор

This is extremely calming, and not only is fascinating in its own right, but also makes lovely background noise. I actually listened to this while putting together a website of mine

commanderlabs
Автор

To get rid of the delay(10) in the writeEEPROM function, you could take advantage of the inverted data polling feature of those EEPROMs that lets you directly determine when the write cycle has completed. After clocking the write enable pin, switch back to reading that address and wait until the data you wrote appears on the output pins.

A few other possible enhancements I thought of while watching that I might try
- Speeding it up by cycling the addresses in a De Brujin sequence rather than incrementing the address. That way only a single bit has to be shifted in for each write.
- Using the SPI perhiperhal to write to the shift registers much faster than doing it in software. The 74HC595 is rated for up to 25 MHz, significantly faster than even the CPU clock speed for the arduino. Hook the shift register data pin to MOSI, the shift clock to SCK, and then you only need to use a single digital pin for the latch.
- Re-wire the data pins to be in the correct order in the GPIO pin registers, so that the byte can be reassembled more quickly: read the two pin registers, mask off the relevant bits, and just or them together.

AJMansfield
Автор

Hallelujah !!! That was a tough one for me. I had my ups and downs with this one, but never gave up.

After finishing the project, I looked though your updated code and added the Erasing EEPROM, which helped,
as the first time I ran it, it did not appear to be doing anything, but I guess that is because it takes a little while to fully erase.

Anyway, thank you for the video, it was FUN !!! Even though I do have a simple($40) programmer, that I could use. It is always fun learning new ways of doing things.

Thank you

jeffnay
Автор

The main problem is that he is using the wrong datasheet. The -25 after the device name is the speed grade and this is very slow. I didn't find the good datasheet too be I saw some -20 that had a 10ms write cycle...
The cleanest solution would be to implement the data polling test that checks if the write cycle is finished. This way you can adapt the write speed to the actual performance of the eeprom whatever grade or brand you use.

cmuller
Автор

Ben - THANK YOU for this video! Thanks to your tutelage, I was able to easily create a modified design of your circuit for a 16KB D27128A EPROM. That EPROM is used for the OS ROM in my old Atari computer. I was able to pull the data off my custom OS EPROM and dump it into a binary file to load into my old system (which now has a way to load ROM files for the OS). Mine doesn't look as nice as yours does though - I don't have customized lengths of wire that fit in nice and neat. You saved me a good bit of money too, since the programmers you can buy on Amazon/eBay are upwards of $100.

brianwilmoth