CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

can P18F452 do voice sampling?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hhyong99



Joined: 05 Sep 2005
Posts: 8

View user's profile Send private message

can P18F452 do voice sampling?
PostPosted: Mon Sep 05, 2005 7:19 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 9:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 10:14 am     Reply with quote

i'm running my PIC at 20Mhz, is this mean that i can't do the sampling??
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 10:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 11:06 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 05, 2005 3:00 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group