nathanogates:
I recently came across this project : Overview | Trinket Audio Player | Adafruit Learning System.
I am curious to find out if the same thing would be possible with a stock attiny85 and different external memory IC such as the i2c 24lc256 as I cant get hold of any of the winBond chips?
I want to playback a short audio clip with this setup and want to get an idea of the complexity involved and general feasibility?
much appreciated
An SPI or I2C EEPROM or FLASH will probably work (speed-wise).
Note that with an X256 chip, you have 32K of memory (those chips are listed in megaBITS capacity).
Doing the math tells you that an 8000 Hz. samplerate mono sound clip will play a max of 4 seconds with a 32K chip.
An X1024 (like a 24AA1025) will give you 128K of sample memory and play for about 16 seconds.
I play 8 bit mono samples directly from my MEGA2560 board (31 seconds max) using an R2R ladder and an LM-358 audio amp. The sound quality is surprisingly good. The board pictured below plugs directly into the Arduino. The 4 pins on the right deliver V+ (typically 9 to 12 volts - for the audio amp) and ground. The 8 pins on the left are the input to the R2R ladder.
I don't use PWM... I use a timer set to 8000 Hz (or whatever the sample rate is) and use "pgm_read_byte_far()" to get the samples from flash memory. Unfortunately, since the compiler only uses 16 bit pointers, an 8 bit PROGMEM sample block can't be any more than 32768 bytes long, so I have to take the raw audio, convert it to a large .HEX file and merge it into the linker when making the code. (BTW I have the "binary to hex" converter program if you want to use it to convert large sound samples - it makes things a LOT easier and you don't have the 32K size limit).
Anyway.. the upper left is a 3.5mm audio output jack (direct from the R2R ladder without the amp) and the two pins on the upper right are amplified output from the LM358 to drive a small speaker (ideal for terrorizing my cats with the sounds of other cats!).
The R2R network itself is a 10K thick film module made by Bournes (it costs all of about 30 cents!)... it's the little horizontal yellow strip right above the 8 data pins.
The LM358 is, of course, in the center. The blue pot in the upper left corner under the 3.5mm jack is to adjust the output from the amp. The 3.5mm jack gets full R2R output regardless.
Using a real thick film R2R ladder works much better than discrete resistors... the tolerances in resistors make the audio "scratchy".
Hope this helps somewhat....
(click pic for hi-res)
