View previous topic :: View next topic |
Author |
Message |
hhyong99
Joined: 05 Sep 2005 Posts: 8
|
can P18F452 do voice sampling? |
Posted: Mon Sep 05, 2005 7:19 am |
|
|
i'm doing a school project currently.. i need to use P18F452 to do voice sampling and then transfer through IR link to another PIC and decode it... is this possible to be done by ADC in the P18F452?? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Mon Sep 05, 2005 9:37 am |
|
|
It's probably *just* possible.
Voice sampling is usually at 8 kHz - is this what you plan to use? If you do, you need to sample every 125 us. The PIC's internal A/D will need about 20 us to settle/charge the internal sampling capacitor.
If you run the PIC at 40 MHz, then this is probably possible. You will have enough time left between samples to massage the data, package it, then send it serially to the other PIC you mention.
The weak link in this whole chain is the PIC's internal A/D. It really isn't meant for sampling at such a high rate. You may also run into frequency effects - the PIC may add unwanted low pass filtering to the signal chain.
It would probably be best to use a dedicated A/D converter, and just skip the first PIC altogether. |
|
|
hhyong99
Joined: 05 Sep 2005 Posts: 8
|
|
Posted: Mon Sep 05, 2005 10:14 am |
|
|
i'm running my PIC at 20Mhz, is this mean that i can't do the sampling?? |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Mon Sep 05, 2005 10:37 am |
|
|
I didn't say you can't, I only said that the PIC's A/D *may not be capable of doing it.* There's a difference.
At 20 MHz, you're going to have 625 instructions every 125 us. That will probably be enough to do the A/D conversion, package it, then hand it off to the USART. |
|
|
hhyong99
Joined: 05 Sep 2005 Posts: 8
|
|
Posted: Mon Sep 05, 2005 11:06 am |
|
|
newguy, say now, if i want to send in a 1kHz sine wave to TRISA0...
what's the maximum voltage and current could that pin accept?
i can set which output for the ADC?
do i need Vref??
what actually "Fosc / 32" mean?
i need a timer for ADC, right?
can briefly explain ADC operation to me??
thank you very much for replying... really appreciate... |
|
|
Eugeneo
Joined: 30 Aug 2005 Posts: 155 Location: Calgary, AB
|
|
Posted: Mon Sep 05, 2005 3:00 pm |
|
|
This may be a better way of doing it since it doesn't use the ADC. Sort of like a crude compression. Then use a M25P20 (2mbit only 2 bucks) chip to store the data
http://centauri.ezy.net.au/~fastvid/picsound.htm |
|
|
|