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

UseTimer0 for Pulse sampling in RTX51 tiny OS

Hi all,
I am planning to use RTX51 tiny for multi-tasks. One of task reads Pulse Position Modulation(PPM)transmission codes from P3.4 and other task is for UART IO. The output code carrier to P3.4 is 38kHz. Assume that I only have two timers - 0 for RTX, and 1 for UART from my hardware. In order to sampling PPM pulse, I need to one more timer to keep tracking the interval between pulses. My question is that
Can I use timer 0(used by RTX) or timer 1 (used by UART) for sampling?

TH0 = 0;
TL0 = 0;

while (INT0); // wait for falling edge
TR0 = 1; // Start Timer
while (!INT0); // wait for rising edge
while (INT0); // wait for falling edge
TR0 = 0; // Stop Timer