EEVblog Electronics Community Forum
Electronics => Microcontrollers => Topic started by: Simon on October 13, 2011, 11:55:59 am
-
So I have a project where I will need to sense the current in a high side line. Naturally I want the voltage drop to be quite low so I'll be sensing in the low mV range, I could of course set my +Vreff and -Vreff to suitable values so as to avoid other circuitry. but will that work ? how small a range can I give to a pic's ADC ?say i wanted it to be 10 mV, can I ?
As always there is no information at all readily available from micro chip, their datasheet only talks registers and the so called separate pic manual is just the datasheet stripped of the part numbers it is seriously worrying that they even bothered as it takes the piss
-
i think you will run into noise issues with a difference that low, but just how bad i'm not sure.
Only way to find out is to try it first.
I know some avrs have a programmable differential adc gain of up to 200x so it probably is possible with an equivlent pic.
If you cant get it to work there are some quite nice current sense chips designed for monitoring the voltage across a low R resistor and generating an amplified analog output
-
Yes so far my design has incorporated a current sensing chip, I thought that if I can make the pic do what i what i may be able to do away with it, I mean if you specify the two limits surely the chip know no better. Or does it reference to another voltage as well ?
-
i think you will run into noise issues with a difference that low, but just how bad i'm not sure.
Only way to find out is to try it first.
I know some avrs have a programmable differential adc gain of up to 200x so it probably is possible with an equivlent pic.
Some of the PIC's do allow that, some also allow you to apply a DC offset to the differential amp as well. I have a feeling they might be 16 bit parts but I can't remember any part numbers of the top of my head, sorry. I have gone down to 512mV but not 10mV (on 18F13K50). I would have thought a differential amp with some gain would have been the best bet (apart form a dedicated IC)
-
yes looks like I'd best use a dedicated chip
-
For Pic's they usually have the ADC reference requirements in the back under A/D converter specs but most that I've used 16F need at least 2.2V difference between
+ REF and -REF for 10b specification guarantee.
Yep -- to pick an example part (the 16F88, since Simon has been looking at it recently in another thread!), the relevant ADC specs under Electrical Characteristics are:
Param Sym Characteristic Min Typ Max Units
A20 VREF Reference Voltage 2.0 — VDD + 0.3 V
(VREF+ – VREF-)
A21 VREF+ Reference Voltage High AVdd – 2.5 — AVdd + 0.3 V
A22 VREF- Reference Voltage Low AVss – 0.3 — VREF+ – 2.0 V
A25 VAIN Analog Input Voltage Vss – 0.3 — VREF + 0.3 V
... so a VREF of 10mV is going to be a fair way out of spec.
-
yes I was actually lookig into the 16F88 for this too. so yes it is impossible to do what i planned. you say these specs were under the electrical specs ? I think i looked there but maybe not hard enough ;)
-
you say these specs were under the electrical specs ? I think i looked there but maybe not hard enough ;)
Yep, table 18-13 on page 190 of the datasheet (which is 192 in PDF page numbers) -- there's a whole lot of stuff in those tables at the back, so it can take some careful reading to spot what you're after! :)