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

What do you think is the best approach for this?

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



Joined: 21 Oct 2003
Posts: 58

View user's profile Send private message

What do you think is the best approach for this?
PostPosted: Mon Sep 11, 2006 9:52 am     Reply with quote

I have 30 voltages to read, timing not really an issue but need to do a minimum of 2 reads of each voltage a minute. I then need to find highest and lowest reading and set an output pin high or low depending if the difference between the highest and lowest exceeds a threshold. Once I have all the voltages the rest is easy but what is the best way to read all these voltages?

A single A/D channel and 30 analogue switches? (trying to find a PIC that has 31 I/O channels and a A/D channel)

Can't find a single PIC with 30 A/D channels so thats out.

3 PICS with 10 A/D channels each and somehow communicate the results from Pic's 2 & 3 into Pic 1(I have no experience with any comms & Pics so don't know how plausable an idea this is).

Single PIC and Eeprom to store data but again not sure on how to communicate between Pic and Eeprom.

Any other suggestions?

JFK
Ttelmah
Guest







PostPosted: Mon Sep 11, 2006 9:58 am     Reply with quote

PIC's only really have one analog channel. The rest is just down to an internal multiplexer, and I think the largest is something like 14 way. Hence the easiest solution, will just be to use an external multiplexer. Look at the ADG732. Five address bits from the PIC, and one analog input, is all that is needed.
Sequence will be just like using the internal multiplexer. Slect the channel. Wait for a few uSec for the internal capacitor to charge. Then take the reading.

Best Wishes
jfk1965



Joined: 21 Oct 2003
Posts: 58

View user's profile Send private message

PostPosted: Mon Sep 11, 2006 10:23 am     Reply with quote

Thanks for that Ttelmah that looks like the ideal solution.

JFK
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Sep 11, 2006 7:08 pm     Reply with quote

Once you get the multiplexing sorted out you also have to consider the aspect of filtering and/or signal conditioning. You don't really want to add 30 filters. You could use a single filter at the output of the mux but this will add significanlty to the amount of time you will need to wait before sampling a channel.

Alternatively, instead of a performing you comarisons after a single scan of 30 channels, you could perform a running average for each channel (30 running averages, one per channel) and then perform the comparisons on the running average values for highest and lowest. This will lessen the impact of a single noise spike from unduly influencing the result. The larger the sample size in the running average, the smaller the impact of transient noise but the longer the overall response time will be.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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