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

Need help for interfacing 5V analog input with 3.3V system

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







Need help for interfacing 5V analog input with 3.3V system
PostPosted: Wed Apr 05, 2006 9:22 pm     Reply with quote

Dear all,
I need some help on the interfacing issue. Currently I have my working 3.3V PIC18F458 microcontroller system. Now I need to take input signal into ADC channel. However, I need to attach multiple sensors in which the input signal range could be 0-3.3V or 0-5V. For example, I have gyro sensor that output 0-5V and accerelometer that output 0-3.3V only. I knew that I could actually scale the input down to 0-3.3V range using some op-amp but I 'm looking for alternative way for that. I appreciate any design hints sir.

Thank you for any comment

Andy
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

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

PostPosted: Wed Apr 05, 2006 9:36 pm     Reply with quote

You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.

As an alternative, you can look at your analog signals and see if you actually need the whole 0-5V swing. For example, basing on the physics of your platform you can make an estimation for the absolute maximum possible angular rate. If it will produce the analog signal less then 3.3V, you can wire your gyro directly to the ADC. To protect the ADC from accidental voltages above 3.3V, add a clamping diode to +3.3V rail.
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Wed Apr 05, 2006 9:53 pm     Reply with quote

Or, if you want to get fancy, you could use something like a MAX1202, which is an 8-channel 12-bit serial ADC with a built-in level shifter.

You could hook your 5V sensors into it, have it do the conversion rather than the PIC, and the PIC can read each channel using the SPI interface, with the level shifter in the 1202 making sure the SPI signals are 3.3V.

Something to think about.

r.b.
Dave Mac
Guest







PostPosted: Fri Apr 07, 2006 10:22 am     Reply with quote

kender wrote:
You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.


Just curious - why should the resistor not exceed 2.5k?
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

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

output impedance
PostPosted: Fri Apr 07, 2006 11:16 am     Reply with quote

Dave Mac wrote:
kender wrote:
You could use a resistive divider to scale down your analog voltages from 5V to 3.3V. But keep in mind that the lower resistor of the divider shouldn't exceed 2.5k.

Just curious - why should the resistor not exceed 2.5k?


Because this resistor is in parallel with the ADC's input impedance. A large resistor will cause a distortion of the ADC reading. The max value of 2.5k is mentioned in the datasheet.
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