Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
It is possible and I've done it ! But I can not give you the software for contractual reasons.
Recording steps are:
1. amplify the microphone signal to be about 80% of VCC peak to peak. Center it at half VCC. Ideally, roll of the frequency response above 4KHz.
2. connect it to the ADC input and select a sampling rate as high as possible, 4K/s will give recognizable speech but faster is better.
3. Use interrupts to signal when the ADC conversion is completed. As soon as it is, save the ADC value to a register and start the ADC running again.
4. in the time while the next conversion is taking place, save the register to RAM. External is best if you want long recordings but internal is OK if there is enough. You need as much RAM per second of recording as the sample rate.
5. go back to step 3 until the end of the recoding.
To play back:
1. use a timer to generate the same duration as your sampling rate.
2. pick up one sample per timer period from the RAM.
3. convert the sample data back to analog.
4. go back to step 2 until the end of the recording.
For the digital to analog conversion you can use an external DAC, an R-2R resistor network on one of the ports or PWM. I use PWM because it uses fewer components, Just set the PWM rate to be at least twice the sampling rate and use each sample in turn to set the m/s period.
You will need a fast PIC, I use 18F46J11 devices clocked at 18.432MHz. They have sufficient internal RAM to hold about 5 seconds of speech.
few days ago i made similar voice recorder as BETWIX described. But instead of saving the data to RAM , i send each byte to MMC (SPI). I used PIC16F877A. Then the voice quality is really superb...
I had uploaded the video of my experiment...
I do not have CCS so I can't give you guidance on the syntax but it looks like all you have to do is set the PWM rate to match the recording sample rate then use "set_pwm1_duty(xxxx);" where xxxx is the value of the sound sample you recorded.