How to set CAN0 RX to be High Impedance

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set CAN0 RX to be High Impedance

1,212 Views
whale
Contributor II

MCU:S32K144
SDK:Without SDK

操作:通过配置CAN0(PTB0,PTB1)实现CAN通信。
现象:CAN通信正常,但是在CAN RX(PTB0)也检测到了输出信号,因此现在想将PTB0设置为High Impedance,确保在进行CAN通信时,PTB0不输出信号,该如何操作?下列这个操作是对的吗?

    // CAN0
    CAN0_PORT->PCR[CAN0_RX_PIN] |= PORT_PCR_MUX(5); /* Port B0: MUX = ALT5, CAN0_RX */
    CAN0_PORT->PCR[CAN0_TX_PIN] |= PORT_PCR_MUX(5); /* Port B1: MUX = ALT5, CAN0_TX */
    // Set CAN0 RX High Impedance
    PTB->PDDR &= ~0x01;
0 Kudos
Reply
2 Replies

1,184 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

selecting CAN RX function in PCR register a PTB0 pin operate as input. You do not need to set direction.
Signal comes from CAN transceiver, in normal mode its RXD pin follows bus signal.
When FlexCAN is sending frame, it must see the same on its RXD line to be able to detect possible errors.

BR, Petr 

0 Kudos
Reply

1,192 Views
whale
Contributor II
CAN transceiver:TCAN1162
0 Kudos
Reply