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.

10 bit ADC conversion to 16 bit

Status
Not open for further replies.

Ashni85

Newbie level 5
Joined
Jan 18, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
I have a quick question regarding the conversion of an ADC result on an AVR chip (mega644) to 16 bit. Since the result is 10 bits from an ADC conversion, how would I convert to 16 bits?

I have my result, say stored in h as

h = (ADCH<<6)|(ADCL<<2)

and h is defined as:

uint_16t h;

and i want to display my h through a uart in hex as:

printf("03X", h);

Would this conversion to 16bit work?
 

How would I create a 16bit number then? And where would the zero's be padded?
 

if you would waste just a little of your time you would figure that the padding 0s have to be appended at the end... xxxxxxxxxx000000

0x41 0x56 0x45!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top