Hi Rob,
I studied Roman's idea about a year or so ago. I was planning on using it, but never did get around to it.
But what I remember is that the "bit-stream" has to be put out at a continuous frequency that is dependant on the encoding of the audio signal.
If you are trying to send the "Stream" using SHIFTOUT, then it's going to send out 8-bits at an unknown bit-rate, and then there's going to be a big pause while you get the next byte from the EEPROM. I would imagine that your description of "garbled" is probably an understatement.
From what I see, you're going to have 2 problems to deal with. The first one is fairly easy, the bit-stream needs to be sent out using an ASM interrupt driven by a timer at a fixed frequency. This will give a continuous stream at a fixed bit-rate. It also frees up some time for the rest of the program to fetch data from the EEPROM.
The second problem may be getting the data from the external EEPROM fast enough to supply to interrupt routine with enough data so it doesn't miss a bit. With a 44khz audio stream, you'll need a new data byte every 181uS. Getting one byte at a time may not be fast enough, but if you created a buffer, and read from the EEPROM in blocks it might just work. If not, you may need to use the Hardware I2C (if your PIC has it).
Slower Audio encoding will also help if getting the data takes too long. If all you are playing back is speach, you can probably go much lower. But then that means recalculating the "Binary Time constant".
HTH,
Darrel
Bookmarks