This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hmc 5883 interface with AT89S52

hi,
I'm working on the compass sensor hmc5883l with at89s52 controller. In the process of reading the data from the compass sensor, i am supposed to collect data from 2 registers and join these 2 datas to make a single data (in short concatenation 8 bit +8 bit =16 bit). the data present in the registers is in the form of 2's complement hexadecimal number.
can any1 suggest me how to convert this 2's complement data to a decimal number.
also i need to display this number onto the 16*2 char lcd. for this i again need to convert the decimal data to character data.

thanks in advance.

0