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 to convert hex bytes from ADS 7825 to decimal and print them on seven segment?

Status
Not open for further replies.

Nikunj Tanna

Advanced Member level 4
Joined
Dec 8, 2009
Messages
115
Helped
23
Reputation
46
Reaction score
15
Trophy points
1,298
Location
Ahmedabad, Gujarat, India
Activity points
1,985
Hi,

I've got a 16 bit output from ADS 7825, which is 16 bit adc. I've 6-seven segment displays. Now I want this 2 byte adc output on 7-segment.

So can anyone tell me how do i conversion of this hex bytes to decimal and then print them on seven segment??? The output is signed int. I am using ATMEGA 128 and codevision avr compiler..

NIKS
 

Re: ADS 7825 help

you have 16 bit ADC so your range is 0-FFFF (0-65535) so you need only 5 digit 7-segment display

to display it
1> convert the hex code to decimal
2> break this in to individual fig (e.g. 12345 to 1,2,3,4,5) and save it in different reg.
3> write code to interface 5 digit 7-seg. display in MUX fashion
4> convert the decimal code to 7-segment code (also depends on Commom cathod or common anode)
5> display it


EnJoy
:D
 

Re: ADS 7825 help

Actually, I've to display the voltage value on 7-segment. So the decimal value, I am getting from hex will be multiplied by the unit voltage.

I mean it will be multiplied by 5V/32768 and resulting in voltage which will be float value.

So I am asking how to display that.
I hope you got my question..

NIKS
 

Re: ADS 7825 help

Hello,

I still didn't get any idea on how to get decimal value. ADS 7825 gives a 2's complement output in 16 bit. I get that hex integer byte. Now I need to display the voltage value that is applied at analog input to 7 segment. So for that i need the value of that hex integer in decimal and then i'll multiply it with 5v/2^16 to get voltage value. I've tried a lot example and previous posts of this forum but I didn't get what i want. Please help me if anyone knows.

One question apart from this, Does ADS7825 gives signed output? I am getting negative values when i display it using printf in decimal. Nothing written about this in datasheet..

NIKS
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top