Hi I have some question about timer.If i recive one signal squarewave and i want to detect it only 1 period and i want to know the time of it .How i can do it . i haved tried to use capcom but i don't know how it work !!!! i have another question how i can change number in base 16 to base 10 and how i can change number in base 10 to base 16 thank you i use c167cr
There are a number of threads on timing the interval between two pulses, as well as app notes. So I'll leave that question up to the search function, and just skim the easy one... Base 10 and base 16 are just human-readable output conventions. Internally, of course, the values are all in base two. So, the question is really which I/O routines you use. For printf and scanf, the %u and %d specifiers print in base 10. %x (or %X) prints in base 16 (hexadecimal). The strtol / strtoul functions take a parameter for the base to use, or you can pass in 0 to have the routine follow the usual C conventions (leading 0 octal, leading 0x hex). See the C51 Library Functions manual for more details.
"the %u and %d specifiers print in base 10. %x (or %X) prints in base 16 (hexadecimal)." To be precise, they print an int in base 10 or 16; see the Manual for printing char and other types...
A very good point when using the Keil tools! The byte specifiers (%bu, etc) are vital, as printf() has a variable argument list and the Keil tools optimize char parameter passing.