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

convert decimal to hexa and stored it in TIMER

How to convert the decimal value to hexadecimal value which needed to be stored in the timer? for example: Timer Low and Timer High only need 2 values such as the 0xFB. How can we extract it if we able to get the hexa from decimal? Have any ideas abt this ? thanx

Parents
  • Take a look at the input functions in the standard C library. strtoul(), strtol(), scanf(), atoi().

    The bit pattern for -1 in a 16-bit twos-complement integer is

    1111111111111111

    The bit pattern for 0xFFFF is

    1111111111111111

    The value is a matter of interpretation by the programmer; the processor does not care. Human-readable (and -writable) format is a matter for the I/O routines.

Reply
  • Take a look at the input functions in the standard C library. strtoul(), strtol(), scanf(), atoi().

    The bit pattern for -1 in a 16-bit twos-complement integer is

    1111111111111111

    The bit pattern for 0xFFFF is

    1111111111111111

    The value is a matter of interpretation by the programmer; the processor does not care. Human-readable (and -writable) format is a matter for the I/O routines.

Children
No data