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 support@ccsinfo.com

Setting up adc channel

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Nico van Luijk
Guest







Setting up adc channel
PostPosted: Wed Jan 29, 2003 7:56 am     Reply with quote

Setting up the adc channel (set_adc_channel(n))seems to take quite a bit of processing time. I am trying to use 6 onboard A/D converters on the 18F452 while running at a clock speed of 40MHz. The sample frequency of each channel is around 20kHz. Is there a way of improving performance for the internal a/d converters or is this only possible by getting an external a/d converter?

Thanks.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11089
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Setting up adc channel
PostPosted: Wed Jan 29, 2003 9:54 am     Reply with quote

:=Setting up the adc channel (set_adc_channel(n))seems to take quite a bit of processing time. I am trying to use 6 onboard A/D converters on the 18F452 while running at a clock speed of 40MHz. The sample frequency of each channel is around 20kHz. Is there a way of improving performance for the internal a/d converters or is this only possible by getting an external a/d converter?
:=
:=Thanks.

Have a look at this thread I had to work with a simlar problem.
<a href="http://www.pic-c.com/forum/general/posts/9174.html" TARGET="_blank">http://www.pic-c.com/forum/general/posts/9174.html</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 11094
Hans Wedemeyer
Guest







Re: Setting up adc channel
PostPosted: Thu Jan 30, 2003 7:17 am     Reply with quote

6 channels each sampled at 20kHz means a conversion every
1/120000 = 8.3uS

Reading the data sheet(DS39564A-page 183), and using the example shown "THE MINIMUM REQUIRED ACQUISITION TIME"
The example values are reasonable for real life situations, and as you can read the ACQUISITION TIME is about 12uS

In other words 6 channels at 20kHz per channel can't be done using the internal ADC. The best you could do is about 13kHz per channel and that is assuming you have zero overhead in code after the conversion. Of course you need to do something with the data, so zero is not practical !:-)

Best look at external ADC, Linear and MAXIM have several that could do the job.

I'm just in the middle of a design for 4 channels each channel to convert 12 bit at 100kHz per channel. The design connects to a PC via USB1.1 and total bit rate is about 6.4 megabits.
The PIC18F452 is so busy it's not possible to do much other than conversions and ship data.

I considered using a Scenix, and may still have to go that way if the client requests any more "extra features", as it is PIC18F452 is very busy...... !
___________________________
This message was ported from CCS's old forum
Original Post ID: 11134
Nico van Luijk
Guest







Re: Setting up adc channel
PostPosted: Mon Feb 03, 2003 3:40 am     Reply with quote

:=6 channels each sampled at 20kHz means a conversion every
:=1/120000 = 8.3uS
:=
:=Reading the data sheet(DS39564A-page 183), and using the example shown "THE MINIMUM REQUIRED ACQUISITION TIME"
:=The example values are reasonable for real life situations, and as you can read the ACQUISITION TIME is about 12uS
:=
:=In other words 6 channels at 20kHz per channel can't be done using the internal ADC. The best you could do is about 13kHz per channel and that is assuming you have zero overhead in code after the conversion. Of course you need to do something with the data, so zero is not practical !:-)
:=
:=Best look at external ADC, Linear and MAXIM have several that could do the job.
:=
:=I'm just in the middle of a design for 4 channels each channel to convert 12 bit at 100kHz per channel. The design connects to a PC via USB1.1 and total bit rate is about 6.4 megabits.
:=The PIC18F452 is so busy it's not possible to do much other than conversions and ship data.
:=
:=I considered using a Scenix, and may still have to go that way if the client requests any more "extra features", as it is PIC18F452 is very busy...... !

Thanks for your help. I assumed the A/D was a sample and hold and therefore that the conversion time (12xTosc) would be a one off each cycle for all channels. As you said external A/D converter is probably the best option.

I am not to sure if the 18f452 will be quick enough to do the job, I am probably going to use the 18f452 together with a Analog Devices DSP
___________________________
This message was ported from CCS's old forum
Original Post ID: 11224
Nico van Luijk
Guest







Re: Setting up adc channel
PostPosted: Mon Feb 03, 2003 7:15 am     Reply with quote

:=6 channels each sampled at 20kHz means a conversion every
:=1/120000 = 8.3uS
:=
:=Reading the data sheet(DS39564A-page 183), and using the example shown "THE MINIMUM REQUIRED ACQUISITION TIME"
:=The example values are reasonable for real life situations, and as you can read the ACQUISITION TIME is about 12uS
:=
:=In other words 6 channels at 20kHz per channel can't be done using the internal ADC. The best you could do is about 13kHz per channel and that is assuming you have zero overhead in code after the conversion. Of course you need to do something with the data, so zero is not practical !:-)
:=
:=Best look at external ADC, Linear and MAXIM have several that could do the job.
:=
:=I'm just in the middle of a design for 4 channels each channel to convert 12 bit at 100kHz per channel. The design connects to a PC via USB1.1 and total bit rate is about 6.4 megabits.
:=The PIC18F452 is so busy it's not possible to do much other than conversions and ship data.
:=
:=I considered using a Scenix, and may still have to go that way if the client requests any more "extra features", as it is PIC18F452 is very busy...... !

By the way the example you are using sampling 4 channels at 100kHz, what kind of protocol do you use, spi/i2c? Because the driver that CCS supplies for the MCP3208 is not particulary fast. Do you maybe have an example driver? thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 11228
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