Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: galannthegreat on April 23, 2009, 09:10:10 PM

Title: PIC Vref
Post by: galannthegreat on April 23, 2009, 09:10:10 PM
I need a little help with setting up a voltage reference for my PIC 18F4520, it is marked Vref+ and Vref-, how do wire this to get a general baseline voltage reference?
Title: Re: PIC Vref
Post by: paulstreats on April 24, 2009, 05:27:30 PM
If youre just using 5v sensors and running the pic at 5v then just leave them unconnected and use the internal reference (you can also use them as standalone inputs like this).

If you are running the pic at 5v but want to sample 3.3v device then attach a 3.3v source to the vref+ and GND to vref- (if you are wanting to sample a 5v device AND a 3.3v device then you will just have to sample the 3.3v at 5v and accept the loss of precision unless you electronically amplify the 3.3v readings to 5v readings)

and so on.. ( but you must set in programming how the ports are to be used)
Title: Re: PIC Vref
Post by: galannthegreat on April 24, 2009, 07:43:01 PM
Thanks, this helps me a lot.