Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Microchip

Status
Not open for further replies.

Steve NA

New Member
I am currently using the 8 bit Microchip PIC16F872. The A/D resolves to 10 bits, but how do you take advantage of the other two A/D bits
when requiring more resolution for driving a display to display a higher value.
I am inputting an Analog DC un-rippled voltage into the A/D and would like to display up to "50", in tenths of a volt.

Thanks.
 
The output of the A/D converter will be in 2 separate bytes. You will need to do much of the maths and data handling as two separate bytes.

There are lots of applications notes on the microchip website and there are code examples at piclist.com
 
Check out figure 11-4 in the datasheet:
upload_2014-10-17_17-51-46.png

The bytes are appended H and L respectively. That is very similar to how it deals with the 16-but timer.

John
 
Hi,

In a diy adc circuit with the result being displayed on a lcd you will probably find the last one or two bits will 'jitter' as successive reading of the same voltage produce very small differences.
To overcome that, the result is often averaged over 16+ readings or the low 2 bits shifted off to give a high order 8 bit value.

Also remember that 10bit adc is 1024 steps divided , when divided into 5v does not give nice exact 1/10 of a volt results, the nearest you can get is 1 step = .0048828v
 
I 'calibrate' my 5V supply to 5.120 Volts, via a 7805 vreg or the better LM317. This delivers .005Volt per bit resolution and simplifies voltage calcs & displays.
The '50' tenths the OP mentions translates to 5V max signal. A 5.12V supply as the Vref should handle that requirement quire well.
 
If the voltage you are reading is noisy, then read 64 samples and sum them. You get a 16 bit number where the upper 10 bits are the average voltage and lower 6 bits are fractions. If your signal is not noisy, then oversampling does not work.

EDIT: I don't understand what you mean by "other two A/D bits". Is this a 12-bit micro? If you want 12 bit resolution, then sample 4 times and add the results together. (But the signal needs to have little bit of noise (around 0.005 volts).. otherwise it is useless to oversample.)

EDIT2: Just program with C and ditch the sticks and stones.
 
Last edited:
I am currently using the 8 bit Microchip PIC16F872. The A/D resolves to 10 bits, but how do you take advantage of the other two A/D bits
when requiring more resolution for driving a display to display a higher value.
I am inputting an Analog DC un-rippled voltage into the A/D and would like to display up to "50", in tenths of a volt.

Check my tutorials, which do pretty well exactly what you're after.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top