I'd say that it is 2^16(65536) that is the right value to use but that's not really important since the error we're talking about is 0,0015%. Your resistors and ADreference will produce a far greater error than that.
Happy coding
/Ingvar
I'd say that it is 2^16(65536) that is the right value to use but that's not really important since the error we're talking about is 0,0015%. Your resistors and ADreference will produce a far greater error than that.
Happy coding
/Ingvar
Ingvar I did test what you suggested and it was RIGHT.
In other words it does exactly the same as FP routines do and at lesser code space cost.
Ofcourse it doesnt solve my problem but it can be used to save space effectively.
I believe that using a converter with greater than 10 bits resolution is a must and if there is a chip suggestion, to make things easy, I am waiting for it.
Thanks again
Bill
18F8723 - 12 bit A/D ???
http://www.picbasic.co.uk/forum/showthread.php?t=7330
Ohm it's not just a good idea... it's the LAW !
If you choose a Pic that has the capability to use external Vref you can get about twice the resolution(above 15V). Put a 50/50 voltagedivider(2.5V) on Vref-, feed it with Vdd. Connect Vref+ to Vdd. The AD will now give you a zero reading for everything below 15V. 30V will still produce maxreading. Your calculation would look like .......
ScaledResult = (AccumulatedADvals ** 15000) + 15000
Unfortunatley the 12F675 doesn't have this capability.
Bookmarks