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
What about timer2? What chip are you using?
I think you can configure your UART to MODE0 or MODE2 in which the UART needn't a timer but use the system clock to generate baudrate.