At 07:05 AM 8/21/2007, you wrote: > > The difference between levels is (ideally) Vref/1024 (not > > 1023), which is the important thing > >(trying hard not to labour the issue but just one last thing) > >Taking the 4-20mA example, with a 250R resistor and 5V Vref > >4mA will develop 1V across the resistor (V=3DIR). 20mA will develop >5V across it. Now, you can measure up to a result of 0x3ff. But >although 0x3ff is the 1024th level, it isn't FSD. It's up to 0.5 bit short, >if I understood what was posted previously. So I think you would be >able to measure only very close to the full 20mA. Well, if the output of the 10-bit PIC ADC is 0x3FF you know that the current is (ideally) greater than 19.980mA. To put this in terms of engineering units, let's suppose that your 4-20mA represents 0-1200=B0C from a T/C transmitter, and everything is idea= l. A reading of 204 would represent an input current of 3.984~4.004mA a temperature between -1.17 and +0.3=B0C (best guess -0.4C). A reading of 1023 would represent an input current of greater than 19.98mA or a temperature of greater than 1198.5=B0C. Your "best guess' would be 119= 9.2=B0C. In practice, you're not going to be using it up at the extreme high end and you'd make it read overrange for an ADC input of = more than 0x3FE or 0x3FD even. So the display (if present) will never show 1200=B0C. If it's a requirement= to actually be useful up to the limit, you have to have a bit more range on the ADC, either by using a slightly higher reference or lowering the input voltage a bit, but it's more of a 'cosmetic' thing. Given the way the numbers work out you could also calibrate it 0.5C high so it reads exactly 0 and 1200 at the end points, but then it would high at the best code for midscale (614). If you're that finicky, it's best to get more resolution one way or another. > I accept the specs >and limitations for a PIC ADC in that regard > >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist Spehro Pefhany --"it's the network..." "The Journey is the rewar= d" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist