Hi Freescaler,
I'm designing a board based on KL25 low power uC with some I/O and four uart RS232 ports. The first three are provided from the peripheral of the uC, the fouth is another story. My idea is to use an IRQ pin to detect falling edge on the RX line of the uart and to detect the start bit, and a generic pin controlled by a TPM module for the TX line. Another timer will scan the signal on the RX line, 16 time faster than the baudrate of the serial line. I don' t need a fast uart, 9600bps is enough for my application.
Some of you have afforted a similar task? Or have a better idea than the one describer above? I'm also evaluating to add an I2C to UART driver bridge, but this
will increment component count of my board, and would be the worst solution.
Thanks in advance.
Giulio
Solved! Go to Solution.
Hi, Giulio
Your mentioned is correct. As normal, we use timer and GPIO to simulate UART. You can also find some sample C code from internet. Here I just want to remind one issue for your reference. When you use GPIO to simulate UART, please use overflow interrupt solution not counter. This method will better when it is used in recevier part.
Hope my reply is helpful.
Best Regards
Paul
Anyone interested on this thread?
Implementing uarts ports using GPIO and TPM module could be an easy way to add uarts connectivity to low count pins Kinetis uC that have only one or two UART dedicated module!
I see many application for this, and it could be also a very good application note for the explanation of TPM and IRQ Pin capabilities.
Best Regards
Giulio
Hi, Giulio
Your mentioned is correct. As normal, we use timer and GPIO to simulate UART. You can also find some sample C code from internet. Here I just want to remind one issue for your reference. When you use GPIO to simulate UART, please use overflow interrupt solution not counter. This method will better when it is used in recevier part.
Hope my reply is helpful.
Best Regards
Paul
Thanks for your answer, Mr Zhe!
1.
Do you think the better way is to use two TPM enabled pins (like PTA0, PTA1 on KL25) both for RX and TX or to use a TPM enabled pin for TX and IRQ capable pin for RX?
2.
Do you know where I can found an example of this kind of implementation?
Best Regards