electroman2000
Member level 2
- Joined
- Feb 3, 2015
- Messages
- 44
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 496
Hi everyone, I'm new on this forum. For first, I'm sorry for my poor english; second, I signed here because I was redirect in this forum many time in my search and every time I have read useful answer.
Well, my problem is simple. I have to implement a 3 channel Audio recorder with a PIC18F4525, and I have only a (limited) experience with a PIC18 (8 bit). I would store the record in a MMC, in WAV format. I use mikroC and proteus for simulation.
My strategy for now is to use 3 external 8-bit ADC, due to slow internal ADC of PIC. Also I use a swap file to save faster the sample, and then, at the end of record, move to FAT16, in WAV file format.
For doing this I implement an interrupt (TMR0) every 22us (44.1 khz sample rate), and two 512 bytes array; when the first is full, it is written into MMC and the sample is stored in the second one, and vice versa. Due to a poor RAM, I'm not able to implement this for every 3 channel, with 6 array of 512 bytes. So I used to store in only two array every sample of 3 channel, so every 512 bytes of a sector have a 171 sample from 1° channel, 171 sample from 2° channel and 170 sample from 3° channel.
This system works well but increment the speed of record. Also every record is too much noisy, no matter the number of channel, also 1 channel have this problem. For simulation I linked an Audio file (WAV) in Proteus directly to analog input of a LTC1099 ADC, and the parralel 8-bit output to a PORTB of microcontroller.
Now my question is: is possibile that the problem is simulation in Proteus, or PIC18F is really too poor for this type of application?
Is the noise caused b PIC18, 8-bit instead of 16, simulation in proteus or what?
In this case I have to move to dsPIC, and so I have a question: is my C-code portable? Can I use my code , with few modification on the registry, or the logic is completely different?
Thank you!
Well, my problem is simple. I have to implement a 3 channel Audio recorder with a PIC18F4525, and I have only a (limited) experience with a PIC18 (8 bit). I would store the record in a MMC, in WAV format. I use mikroC and proteus for simulation.
My strategy for now is to use 3 external 8-bit ADC, due to slow internal ADC of PIC. Also I use a swap file to save faster the sample, and then, at the end of record, move to FAT16, in WAV file format.
For doing this I implement an interrupt (TMR0) every 22us (44.1 khz sample rate), and two 512 bytes array; when the first is full, it is written into MMC and the sample is stored in the second one, and vice versa. Due to a poor RAM, I'm not able to implement this for every 3 channel, with 6 array of 512 bytes. So I used to store in only two array every sample of 3 channel, so every 512 bytes of a sector have a 171 sample from 1° channel, 171 sample from 2° channel and 170 sample from 3° channel.
This system works well but increment the speed of record. Also every record is too much noisy, no matter the number of channel, also 1 channel have this problem. For simulation I linked an Audio file (WAV) in Proteus directly to analog input of a LTC1099 ADC, and the parralel 8-bit output to a PORTB of microcontroller.
Now my question is: is possibile that the problem is simulation in Proteus, or PIC18F is really too poor for this type of application?
Is the noise caused b PIC18, 8-bit instead of 16, simulation in proteus or what?
In this case I have to move to dsPIC, and so I have a question: is my C-code portable? Can I use my code , with few modification on the registry, or the logic is completely different?
Thank you!