Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You can use any four contiguous bit you like, it all depends on the resolution that you require.JimB
4321xxxx Vref=5V then you can measure 0 to 5V in 312mV steps. (over voltage = F in hex)As fourtytwo says - you would normally use the 4MSB
4321xxxx Vref=5V then you can measure 0 to 5V in 312mV steps. (over voltage = F in hex)
x4321xxx Vref=5V then you can measure 0 to 2.5V in 156mV steps. (over voltage will give strange numbers)
xx4321xx Vref=5V then you can measure 0 to 1.25V in 78mV steps. (over voltage will give strange numbers)
xxx4321x Vref=5V then you can measure 0 to 0.625V in 39mV steps. (over voltage will give strange numbers)
xxxx4319 Vref=5V then you can measure 0 to 0.312V in 19.5mV steps. (over voltage will give strange numbers)
There is my problem!As long as you know what you are doing
On reflection, that is a truly bad idea!If you want to do a be a bit more adventurous shuffling the bits around, you could do something like
4x3x2x1x
or
x4x3x2x1
Different ranges and resolutions.
If the op selects right justify then the required 4 bits are in ADRESH.It is a 10bit ADC, it is read in two registers ADRESH and ADRESL, which can be loaded left justified or right justified.
On several projects I have loaded them "left justified" so that the top 8 bits are in ADRESH and the bottom 2 bits are in ADRESL.
I then just read ADRESH and ignore ADRESL to read 0 to 5v with 8 bits resolution.
In the example I gave, if right justify is selected, only the top two MS bits will be in ADRESH.If the op selects right justify then the required 4 bits are in ADRESH.