play wav from eeprom
stilgar
Posts: 47
Hello,
I need to play a wav file that resides in the eeprom. its small (36K), and 1 sec long. Do to budget, and size constants, a SD card won't work. The wav would run simultaneously with a light controller.
Has anyone used a (64K) AT24C512B-PU EEPROM from ATMEL SEMICONDUCTOR?
Data sheet " https://www.jameco.com/Jameco/Products/ProdDS/276832.pdf "
stilgar
I need to play a wav file that resides in the eeprom. its small (36K), and 1 sec long. Do to budget, and size constants, a SD card won't work. The wav would run simultaneously with a light controller.
Has anyone used a (64K) AT24C512B-PU EEPROM from ATMEL SEMICONDUCTOR?
Data sheet " https://www.jameco.com/Jameco/Products/ProdDS/276832.pdf "
stilgar
Comments
I think the only .wav players are designed to work with an SD card. You could easily substitute an EEPROM read routine for the SD card I/O, but I don't think there's any ready-made. I could be wrong though.
http://obex.parallax.com/objects/324/
Of course, it does eat up a lot of eeprom that you might need for the light contol program, and the file you mentioned is as it stands too large to fit. Could you sample it down to 8 bit at 8 kHz or 16 kHz? If not, Ray's demo is still a good template to start from. The line of code that reads a byte from program memory has to be split to read a byte from the external eeprom. With 16 kHz sampling, it has 62.5 microseconds from byte to byte.
I have the wav player and circuit. Now the question is how do I download the wav file to EEPROM. does it just need to sit in the same directory as the .spin code, and automaticly downloads it to EEPROM?
Also do I need to start the player as a newcog? If I understand it so far the light control program is in cog 0.
thanks
You can just replace that filename with the name of your file...
new questions,
I need to start the player in a new cog, (cog 0 is running a light controller). In the Ray Allen's demo, playWav_8bit.spin, which one of the PUB blocks do I put the cognew command?
The wav file is 8 bit, 16Hz, Mono, what pin does the player use for mono? (P10 or P11)
thanks everyone for the help
Jim
The Basic_I2C_Driver object is compatible with the Atmel AT24C1024. Different masnufacturers use different addressing schemes for this size part, but the Atmel will work with the stock I2C object without any modification. I use the 1Mb chips in every prop project. For an extra $1 or so it's nice to have that extra 128K of eeprom to play with.
I found Audacity 1.3 to be very helpful in changing audio formats and compression.
My Ships Bells wav file went from 88k down to 14k minimum size (with several stops in between).
The 28k 8 bit version still sounds great and fits, with code, in a single cog.
The windows sign-on song came in at 29k. It takes about 3 seconds to complete.
single cog.
Jim