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
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.