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,485件の閲覧回数
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,317件の閲覧回数
ouguoqing
Contributor II
3 返答(返信)
1,317件の閲覧回数
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,317件の閲覧回数
ouguoqing
Contributor II

还在审批?

0 件の賞賛
返信
1,318件の閲覧回数
ouguoqing
Contributor II

没人看到吗