How to reset UART communication in S32DS 2018 and S32K144 MCU

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to reset UART communication in S32DS 2018 and S32K144 MCU

1,331件の閲覧回数
seungwoolee
Contributor II

Hello,

 

The LED driver IC applied in my product needs s special UART communication reset when the state machine inside that IC is desynchronized.

The datasheet of that IC recommends that the MCU can reset UART and protocol state machine at any time by holding the RX input continously low for 100us.

I don't know how to hold RX pin for a certain period of time.

Can I do this by setting RX pin low forcibly like GPIO?

Or, Is there any method to do this by using library function? (e.g. LPUART_DRV_Init, LPUART_DRV_Deinit)

By the way, I could not reset UART communication by DRV_Deinit and Init functions.

Please let me know how to solve this issue. 

0 件の賞賛
返信
6 返答(返信)

1,279件の閲覧回数
seungwoolee
Contributor II

Thank you  for your reply.

However, after I changed pin mode from UART RX to GPIO, I could not make the pin low. (pin floating around 3V, not zero)

Could you help me more to make the pin low clearly?

 

PINS_DRV_SetMuxModeSel(PORTC, 8U, PORT_MUX_AS_GPIO)

PINS_DRV_SetPinDirection(PTC,8U, 1U)

PINS_DRV_SetPullSel(PORTC, 8U, PORT_INTERNAL_PULL_DOWN_ENABLED)

PINS_DRV_ClearPins(PTC,1<<8)

0 件の賞賛
返信

1,267件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@seungwoolee

I checked your code and found nothing wrong. I guess the target device might hold the RX pin high,

One more thing, can you double check that the PTC8 is the right pin, as I've never encountered any target

device that needs to hold the TX pin and then cause a reset event.

If you think PTC8 is the correct pin, then I don't think we have a better way to do this.

0 件の賞賛
返信

1,263件の閲覧回数
seungwoolee
Contributor II

Thanks for the quick feedback.

LPUART1 port of MCU (S32K144) is connected to CAN Transceiver(UJA1161) RXD pin and it's connected to the LED matrix IC.

It's not real CAN communication, but a phyical CAN communication to reduce EMI noise and to strengthen the signals.

To reset the UART communication (re-sychronize state machine), it's needed to hold RX pin low for a certain period of time.

For my understanding, you mean UJA1161 might hold the pin not to become low and I have no choice.

When I communicate through UART, the pin can be low without any problems, but after I changed the pin mode to GPIO, I'm not able to make it low.

I don't know the reason.

0 件の賞賛
返信

1,257件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@seungwoolee

I don't mean UJA1161 only, it may be also your LED matrix IC.
You can test your code on another Lpuart instance, if it works as expected, then the problem can only be that the RX line is pulled low by UJA1161 or your LED matrix IC.

0 件の賞賛
返信

1,243件の閲覧回数
seungwoolee
Contributor II

Hi, Senlent

 

Thanks.

I solved this issue by change the TX pin to GPIO and pulling down it to low at the same time with RX pin change.

I don't know the reason, but I guess that the CAN IC might be in operation and hold RX pin

0 件の賞賛
返信

1,312件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@seungwoolee

Can I do this by setting RX pin low forcibly like GPIO?

yes,I think you don't have to re-init lpuart module, but just re-configuration RX pin to GPIO and set it to low.

->PINS_DRV_SetMuxModeSel()

0 件の賞賛
返信