Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how can i convert 10-bit ADC to 8-bit with high accuracy

Status
Not open for further replies.

arbabar

Member level 2
Joined
Aug 11, 2011
Messages
46
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Location
Islamabad
Activity points
1,640
hi , i want to convert output of 10-bit adc to speciaifc 8-bit adc with highly accuracy....

actually my sensor output is varing from 0-24v so i used potenteometer to limit it from 0-5v now i gave it as input of adc and now i want its result into 8bit adc?


how can i do it?

if i further more decrease my sensor input from 0-2.5v or similar so can my output is 8-bit?
 

What is the reference voltage to your ADC? If it is 5V, then, with a signal level of between 0V to 5V, you'll get a 10-bit result. With signal level between 0V to 2.5V, you'll get 9-bit result. And, with signal level between 0V to 1.25V, you'll get 8-bit result. Actually, in each case the result is 10-bit, but the signal level is such that the peak value for the corresponding lower resolution is not crossed and can be assumed to be of that resolution.

If your reference voltage is 5V, then you can carry out the reading and discard the lower 2 bits in software to obtain 8-bit result. You can also set justification to left justification and read the "high" result register to obtain 8-bit result.

Code:
ADC_Init(); //Initialize ADC
ADVar = ADC_Get_Sample(0); //Get ADC reading from channel 0
ADVar = ADVar >> 2; //Turn into 8-bit result

Hope this helps.
Tahmid.
 

All you need to do is to select a 5v reference voltage for the ADC. Also configure it for left adjusted. After the conversion is complete, the 8 bit result can be directly read from the ADC High byte register.

To make it more accurate, you can try rounding this 8-bit value. Just add bit-1 of the 10 bit result to the 8 bit value.

Decreasing your input will not make any difference to the number of bits. You will in fact lose some resolution.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top