NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » External EEPROM with ATtiny85

May 30, 2013
by pcbolt
pcbolt's Avatar

This is an offshoot of a thread started HERE. The old thread was getting huge.

MaxWolfMarrin asked:

"I would like to make a sound effect device using an external eeprom with the ATtiny85- I saw some code for converting a wave file into 8kbps nibbles, but my question is how to get the data onto the eeprom in the first place- how do I initialize the eeprom with the sound data if it exceeds the memory of the AVR chip?"

I haven't worked with the ATtiny85 but a quick read through the datasheet and I can see the problem.

One solution would be to program the EEPROM in chunks or pages. Program the ATtiny with some of the data in RAM, then hook it up to the EEPROM chip and upload it through programing code on the SPI lines. You'd just have to keep track of the end memory address each time and include this each time you upload the next "page" of memory into RAM.

Another idea would be to program the EEPROM with a chip that has enough RAM memory to begin with.

I remember reading an article a ways back about a fellow who built a .wav file player with the ATtiny85 and an SD card. The page has some schematic and the source code is pretty interesting.

May 30, 2013
by MaxWolfMarrin
MaxWolfMarrin's Avatar

OK, thanks i will start there- i have also checked AVR freaks and I am awaiting some help from there too. I saw some recommendations to use USART to send the data to the AVR than use TWI to program the EEPROM. This is where i feel i should start. if i can get that to work reading from the EEPROM shouldn't be a problem so i feel like if i was to ask a specific question it would be how to get started using the terminal to take a script and write it to the AVR with the USART then to the TWI...I need to do some more reading but if you know of any resources - thanks!!

May 31, 2013
by pcbolt
pcbolt's Avatar

Cool.

HERE is the datasheet for the ATtiny85. I thought you might run into trouble reading from the EEPROM with the ATtiny85 using TWI but it turns out that little chip can do it. The Tiny doesn't have dedicated USART pins or functionality so unless you "roll your own" (which is possible but difficult) you'd have to consider another chip to upload the EEPROM for you (like the ATmega328 or 168). That's actually pretty easy to do.

As far as writing to the USART from your PC, you might check out a program called "RealTerm". I think it will allow you to dump a file out the COMM ports (and it's free). I'm sure Python or Perl scripts can do it as well, but it's been a while since I've played around with that.

Post a Reply

Please log in to post a reply.

Did you know that you can use printf and scanf functions to talk to your computer from your USB NerdKit? Learn more...