I want to convert an analog audio signal to digital signal and send it to serial input in my computer. How can I do this?
Microcontroller used: PIC18f452
|
|
That PIC can do 50 ksps, which is good for a 20 kHz bandwidth, though the 10 bit limitation won't give you HiFi quality, of course. 50 ksps \$\times\$ 10 bit is an output of 500 kbps, or 800 kbps if you send each sample in 2 bytes. You don't want to go via EIA-232 to your PC. Many PCs don't even have EIA-232 anymore. The standard nowadays is USB. The PIC18F452 doesn't have USB on board, but luckily there's FTDI :-). FTDI's ICs have become the de facto standard for easily connecting microcontrollers to USB. All you need is this (or something similar):
At the left you can see RxD, TxD and GND connections which go to the PIC's UART, the connector goes to the PC. The IC is an FT232R, which supports data rates up to 3 Mbps, so that's enough for your application. If you tell us what the audio signal looks like (particularly level) we can tell you how to hook that up to the PIC. And then it's just sampling, and upon each EOC (End of Conversion) send two bytes to the UART. |
|||||||||||
|
|
Your question is not specific enough to give details, but to answer simply:
|
|||||||||||
|