Use PE, how to set the MUX of uart port to 3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Use PE, how to set the MUX of uart port to 3

跳至解决方案
1,486 次查看
ouguoqing
Contributor II

We use

      1. MKL02Z32;

      2. Kinetis Design Studio V: 3.2.0;

      3. PE

In PE, We use the component AsynchroSerial for UART0.

In Component Inspector.

      1. set "ADC0_SE4/PTB2/IRQ_7/UART0_RX/UART0_TX" for RX of the UART0.

      2. Set "ADC0_SE5/CMP0_IN3/PTB1/IRQ_6/UART0_TX/UART0_RX" for the TX of the UART0.

After Click "Generate Processor Expert Code", the tool will generate code auto.

But the uart can no work .

In function ASerialLdd1_Init(),

  PORTB_PCR2 = (uint32_t)((PORTB_PCR2 & (uint32_t)~(uint32_t)(
                PORT_PCR_ISF_MASK |
                PORT_PCR_MUX(0x05)
               )) | (uint32_t)(
                PORT_PCR_MUX(0x02)
               ));
  /* PORTB_PCR1: ISF=0,MUX=2 */
  PORTB_PCR1 = (uint32_t)((PORTB_PCR1 & (uint32_t)~(uint32_t)(
                PORT_PCR_ISF_MASK |
                PORT_PCR_MUX(0x05)
               )) | (uint32_t)(
                PORT_PCR_MUX(0x02)
               ));

When i change the PORT_PCR_MUX(0x02) to PORT_PCR_MUX(0x03), then the UART can work fine.

Use PE, how to set the MUX of uart port to 3???

Thanks.

0 项奖励
回复
1 解答
1,318 次查看
ouguoqing
Contributor II
3 回复数
1,318 次查看
marek_neuzil
NXP Employee
NXP Employee

Hello,

according to the KL02 sub-family reference manual the routing is correct. For selection of the Alt3 functionality of these pins you must select PTB2 pin as the TX and PTB1 as the RX, see the following table from the reference manual:

pastedImage_1.png

Best Regards,

Marek Neuzil

0 项奖励
回复
1,318 次查看
ouguoqing
Contributor II

还在审批?

0 项奖励
回复
1,319 次查看
ouguoqing
Contributor II

没人看到吗