Hi everybody,
I'm trying to setup IrDA communication on UART0 (K60N) but having some difficulties.
Maybe someone can help me out?
1.) I'm wiring UART0_TX to the internal photodiode by setting PTD7 to ALT3 which sets PTD7 = UART0_TX.
2.) Now I want to UART0 to input from the internal photoresistor PTC6. Therefore, I guess, I somehow need to set PTC6 = UART0_RX.
But how do I accomplish that?
Since PTC6 is hard-wired with the comparator CMP0_IN0, I rather have to wire CMP0_OUT = UART_RX, is that right?
So, what are the correct Pins to be wired together?
By now, I found out the following:
There are two pins, PTC5 and PTB20 which I can set to ALT6 to get = CMP0_OUT.
Does that help anyhow?
And there are 4 Pins, which can be set to UART0_RX:
=> PTA1 ALT2
=> PTA15 ALT3
=> PTB16 ALT3
=> PTD6 ALT3
But I still have no idea how to wire UART0's input with the photoresistor's output, i.e. how to set CMP0_OUT = UART_RX.
Any help would be much appreciated!
Thank you!
Regards,
Hans
解決済! 解決策の投稿を見る。
Hi,
The PTC6 function is by default CMP0_IN0 and this is the configuration you need to set for the pin, this is because the signal for the RX must come from the Comparator and when you set CMP0_IN0 as the function you are selecting the source of this comparator.
Then you need to configure the register SIM_SOPT5 in the field UART0RXSRC this allows to select the data source for UART0. You can write the next values:
00 UART0_RX pin
01 CMP0
10 CMP1
If you select 01 you are setting the CMP0 out as the data source for the UART0.
I hope this information can help you.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. It would be nice!
-----------------------------------------------------------------------------------------------------------------------
Hi,
The PTC6 function is by default CMP0_IN0 and this is the configuration you need to set for the pin, this is because the signal for the RX must come from the Comparator and when you set CMP0_IN0 as the function you are selecting the source of this comparator.
Then you need to configure the register SIM_SOPT5 in the field UART0RXSRC this allows to select the data source for UART0. You can write the next values:
00 UART0_RX pin
01 CMP0
10 CMP1
If you select 01 you are setting the CMP0 out as the data source for the UART0.
I hope this information can help you.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. It would be nice!
-----------------------------------------------------------------------------------------------------------------------