+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 25

Thread: Vref on 3.3V PIC18LF

  1. #1
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default Vref on 3.3V PIC18LF

    Hi all

    I want to use a PIC18LF4620 at 3.3V, but one of my sensors output an analog signal 0V-5V. Can I use a +5V Vref for the ADC on the PIC when the PIC is running at 3.3V?

    Thanks,


  2. #2
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,784

    Default

    The maximum voltage on any pin is Vdd. Why can't you use a voltage divider?

    Mike.

  3. #3
    bananasiong Excellent bananasiong Excellent bananasiong Excellent bananasiong Excellent bananasiong Excellent
    Join Date
    Mar 2006
    Location
    Malaysia
    Posts
    1,881

    Default

    Or, why can't you use the PIC at 5 V?
    bananasiong

  4. #4
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Quote Originally Posted by Pommie View Post
    The maximum voltage on any pin is Vdd. Why can't you use a voltage divider?

    Mike.
    Does that mean that I can't use 5V as a ref V? I was thinking of using a simple resistor V divider, will I loose any accuracy/linearity (according to the maths it should be linear)? I suppose I would have to use 1% or better resistors to limit errors if the temperature change.

  5. #5
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Quote Originally Posted by bananasiong View Post
    Or, why can't you use the PIC at 5 V?
    I need to read/write 4 other sensors as well, and some of them only work with 3.3V max. It's only the one sensor that can only work with 5V, and I don't have to wtrite to that sensor.

    IE: If I run the PIC at 5V, but the GPS can only work to 3.3V I will have to drop the V on the serial output to the GPS.

  6. #6
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    No, you can't use a Vref higher than Vdd (or at least not more than 0.7V higher, the datasheet gives the exact details).

    But why would you want to anyway?, either use the 3.3V (which I presume is accurate enough?), or a 2.5V precision reference IC. Assuming you want to read 0-5V, a simple resistive attenuator on the input is all you require - but bear in mind the minimum source impedance requirements.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  7. #7
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Thanks for the replies.

    On the sensor datasheet it says: Output resistive load, minimum 200K, and max is infinity. Sensor output is between 0.5V and 4.5V.

    So with a 5V input to a devider with a 1K and a 2K resistors the output will be 3.33V, but how do I work out the impedance, and the sensor output says 200K minimum?

    Please see the attached screenshot of the datasheet.

    Thanks,
    Attached Images

  8. #8
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    You need a buffer opamp between them, check my tutorials for how I solved a similar problem.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  9. #9
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Hi Nigel, thanks for the help. I searched you site, but can't find reference to the buffer op-amp.

  10. #10
    bananasiong Excellent bananasiong Excellent bananasiong Excellent bananasiong Excellent bananasiong Excellent
    Join Date
    Mar 2006
    Location
    Malaysia
    Posts
    1,881

    Default

    Quote Originally Posted by Boomslang View Post
    Hi Nigel, thanks for the help. I searched you site, but can't find reference to the buffer op-amp.
    Just a non-inverting configuration with unity gain.
    bananasiong

  11. #11
    OY2L Newbie
    Join Date
    Jan 2007
    Location
    Faroe Islands
    Posts
    147

    Default

    I think this must be the tutorial Nigel mean.
    Nigel's PIC Tutorial Analogue Board

  12. #12
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Quote Originally Posted by OY2L View Post
    I think this must be the tutorial Nigel mean.
    Nigel's PIC Tutorial Analogue Board
    That would be the one!
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  13. #13
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Quote Originally Posted by Nigel Goodwin View Post
    No, you can't use a Vref higher than Vdd (or at least not more than 0.7V higher, the datasheet gives the exact details).

    But why would you want to anyway?, either use the 3.3V (which I presume is accurate enough?), or a 2.5V precision reference IC. Assuming you want to read 0-5V, a simple resistive attenuator on the input is all you require - but bear in mind the minimum source impedance requirements.
    The sensor has a 2.5V Vref output that I can connect to the ADC Vref, but how would I use that? The sensor output is 0-5V, with 2.5V at zero state. Do you mean I should drop the output from the sensor to give 0-2.5V and the use the 2.5V Vref?

    Instead of having an op-amp buffer, can I put a small cap just before the AN input pin? To keep weight down I would prefer 2x resistors + 1x small cap rather than an op-amp circuit).

    Edit to add: Just using a 3.3V swing on a 5V referenced ADC is not goin to be accurate enough.

    Thanks,
    Last edited by Boomslang; 21st June 2008 at 07:39 AM.

  14. #14
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    You can simply use an attenuator to drop 0-5V to 0-2.5V, with no loss of accuracy - but it's all dependent on impedances - which is why my tutorial uses opamps as buffers.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  15. #15
    Boomslang Good Boomslang Good
    Join Date
    Mar 2007
    Location
    South Africa
    Posts
    253

    Default

    Quote Originally Posted by Nigel Goodwin View Post
    You can simply use an attenuator to drop 0-5V to 0-2.5V, with no loss of accuracy - but it's all dependent on impedances - which is why my tutorial uses opamps as buffers.
    Thanks Nigel!
    I attached the datasheet for the device I am going to use, do you think I will be able to get away without using the op-amps to buffer the analog signal? (the important electrical specs are on page 5). Another spec: the max capacitive load is 100pf... the PIC ADC loads a 25pf cap, so I should be in spec on that one.
    Attached Files

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Using Vddcore as Vref
    By Diver300 in forum Micro Controllers
    Replies: 3
    Latest: 23rd January 2008, 09:24 PM
  2. Using VRef as a D/A output
    By Azaruk in forum Micro Controllers
    Replies: 2
    Latest: 23rd September 2007, 08:31 AM
  3. can Vref- as +1V?
    By meera83 in forum Micro Controllers
    Replies: 4
    Latest: 10th August 2007, 01:39 AM
  4. A/D, value for Vref on PICs for best accuracy.
    By Odin in forum Micro Controllers
    Replies: 12
    Latest: 19th June 2007, 03:04 AM
  5. ADC0804 vref/2
    By electroicarus in forum Electronic Projects Design/Ideas/Reviews
    Replies: 3
    Latest: 18th May 2006, 12:34 AM

Tags for this Thread