Hi all,
Just after some help with the ARM LPC2378. Any help would be great. What i'm trying to do is take a .wav file, strip the data out of it then feed it in the DAC.
I've succeeded in stripping the .wav file into hexadecimal format. Each sample is 8 hex values. For example one construct might look like this.
const int soundStream[] = { 0xffffffcb,0xfffffffd,0x4c,0xffffffc4};
There is a lot more samples than above, that's just an example of what i'm trying to feed into the DAC.
Then I take these values to an interrupt handler set to 8khz. (8000 ticks per second I believe that equates too). Each value in the array is feed into the DAC one at a time after a bit of bit-shifting is used.
//i is incremented every time the ISR is fired DA_val = ((soundStream[i] >> 15) + 0x8000) & 0xFFFF;
Then I feed this value into the dac register.
I was hoping this would mean it would work. However all i get are a series of clicks. I'm wondering why this is. I've taken a look at the ARM voiceplayer example provided by Keil and they seem to feed the values all at once, which doesn't make sense when recreating a PCM(pulse code modulation) sine wave?...
Perhaps i'm getting confused and need to be pointed in the right direction. Maybe the DAC reads the values all at once? I've tried this and I get that my constant which holds the raw values is too large! I'm not sure what I'm doing wrong and could really do with a helping hand.
The fact that I'm getting clicks seems to be mean that I'm on the right track. (The DAC is understanding the values i'm putting into it). It seems to be my "feeding" mechanism which is wrong.
I can't use the ARM itself for ripping the files data as my overall system will not permit this. (The stripping of the .wav file cannot be done on the ARM).
Cheers for any help,
Slev