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.

hex to decimal conversion in µc

Status
Not open for further replies.

innovation1

Newbie level 6
Joined
Mar 13, 2009
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,374
convert to 26 hexadecimal

URGENT Can anybody help ???????? Please give me code for following
for temperature display on LCD or 7-segment, we always need to convert a 16 or 32 bit number for example 355 in decimal (corresponds to 163 in hex) to 355 in hex so that we can display 355 on lcd or 7-seg.
 

asm code example decimal converter

You can use the sprintf from <string.h> to convert the value into a char array.

char buffer[3];
int value = 0x163;

sprintf(buffer, "%d", value);

buffer will now contain '3', '5', '5'
 

hex to decimal convert assembler

Sorry ....i haven't given u complete information. We are using 8051 µC and we want the code in assembly language.
 

32 bit hex conversion in to decimal

Ideally this is how I would break down the problem,

First make a assembly routine that correctly displays a digit given the appropriate number - such as 5 produces a '5' on the LCD

Convert the integer number to a hexadecimal value using assembly - search the net, there are several examples.

By using integer division extract the digits in the reading on a one-by-one basis and pass this value to the display section of code.

Unfortunately my time is limited atm, and I cannot provide the actual code.

Cheers,
Slayer
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top