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

One ADC, reading multiple PWM

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



Joined: 16 Jul 2008
Posts: 50

View user's profile Send private message

One ADC, reading multiple PWM
PostPosted: Wed Sep 16, 2009 9:50 pm     Reply with quote

Hello, my question is, I have one ADC (3 axis), how can I read all X Y and Z with one ADC?

I can only think on relays, but they are slow and noisy...

There must be a way probably using pins as the supplys and turning them into inputs, but I cant figure it out so I can draw a schematic :/


Thanks
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Thu Sep 17, 2009 3:57 am     Reply with quote

You could use analog multiplexer, so you could avoid relays. And they are quicker.

One of analog multiplexers is 74HCT4051 (8 way)... you can look at similar smaller one.
nuno12345



Joined: 16 Jul 2008
Posts: 50

View user's profile Send private message

PostPosted: Wed Sep 23, 2009 7:52 pm     Reply with quote

thank you ;)
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Sep 23, 2009 11:15 pm     Reply with quote

Which PIC are you using? Most PIC's have multiple input channels...

You can easily (in software) select which input you'd like to sample.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
nuno12345



Joined: 16 Jul 2008
Posts: 50

View user's profile Send private message

PostPosted: Thu Sep 24, 2009 1:37 pm     Reply with quote

ill use 16f88, just asking ;)


Is there a way to do it ourselves? I mean...without the need of an IC (hate to use IC's lol)
barryg



Joined: 04 Dec 2006
Posts: 41

View user's profile Send private message

PostPosted: Thu Sep 24, 2009 6:09 pm     Reply with quote

Well, yes, if you also willing to accept an additional question:

Is it possible to do measurements without an A/D converter?

Because if you are measuring resistance (like the potentiometers in a joystick) there are methods that involve charging and discharging a capacitor on a port pin to do the measurement. With that, you can have as many channels as you have port pins! There's an app note that explains how to do this. So if you want the cheapest possible way, there's your way Very Happy
nuno12345



Joined: 16 Jul 2008
Posts: 50

View user's profile Send private message

PostPosted: Thu Sep 24, 2009 7:55 pm     Reply with quote

Yes I know that RC circuit, but I'm saying something like, using the same ADC pin to measure multiple "entrances" you can do it with relays, and there are circuits that replace relays, I think :P
barryg



Joined: 04 Dec 2006
Posts: 41

View user's profile Send private message

PostPosted: Mon Sep 28, 2009 2:05 pm     Reply with quote

Yes, it can be done with relays, and with circuits that replace relays.

"bungee-" mentioned a 74HCT4051. That is an electronic switch, and it does just what you're asking. "nuno12345" mentioned the PIC16F88. What you may have missed, is that this PIC has an A/D plus all that switching circuitry built in! The majority of PIC's you might choose from have this as well. Which chip were you planning to use?
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