Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/11/09 10:05
Read: times


 
#167063 - Wrong approach?
Responding to: ???'s previous message
Giang Ho said:
I have just been able to convert any decimal from 0 - 99 to hex value

You don't need to convert "decimal" to "hex" - you need to convert to BCD.

"decimal" and "hex" are just different ways to display the same numeric value;
What you actually need to do is to convert the storage format to BCD.

make up 11 to 0x11 or 21 to 0x21.

That sounds like a rather bizarre approach!

Do you actually understand how BCD works?

See: http://www.8052.com/forum/read/166907
And: http://www.8052.com/forum/read/166902


List of 14 messages in thread
TopicAuthorDate
Convert BCD, hex and decimal in C (DS1307 related)            01/01/70 00:00      
   Keyboard?            01/01/70 00:00      
   Another thought about that keyboard...            01/01/70 00:00      
      Re:Another thought about that keyboard...            01/01/70 00:00      
         Wrong approach?            01/01/70 00:00      
            Re: Wrong approach?            01/01/70 00:00      
               Division            01/01/70 00:00      
               Not a shortcut?            01/01/70 00:00      
                  Re: Not a shortcut?            01/01/70 00:00      
                     Basics (edited)            01/01/70 00:00      
                        addition to the above            01/01/70 00:00      
                           Look at the DS1307 datasheet            01/01/70 00:00      
   Check this            01/01/70 00:00      
      Incorrect            01/01/70 00:00      

Back to Subject List