View previous topic :: View next topic |
Author |
Message |
jfk1965
Joined: 21 Oct 2003 Posts: 58
|
What do you think is the best approach for this? |
Posted: Mon Sep 11, 2006 9:52 am |
|
|
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
|
|
Posted: Mon Sep 11, 2006 9:58 am |
|
|
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
|
|
Posted: Mon Sep 11, 2006 10:23 am |
|
|
Thanks for that Ttelmah that looks like the ideal solution.
JFK |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Mon Sep 11, 2006 7:08 pm |
|
|
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!! |
|
|
|