How to enable freemaster via half duplex RS485 in MKV30F128VLF10 ??

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

How to enable freemaster via half duplex RS485 in MKV30F128VLF10 ??

1,159 Views
rkavinash03
Contributor I
 
0 Kudos
2 Replies

1,150 Views
MichalH
NXP Apps Support
NXP Apps Support

Dear user,

do you use any of KV30 evaluation boards or your custom board? I'm sorry I'm not aware about any NXP evaluation board which uses RS485 bus driver connected on UART module. 

Also, we have made no FreeMASTER tests with RS485 yet, so all my comments are just theoretical. I assume you have a RS485 two-wire communication. You can describe your hardware in more details in your reply.

  • Each node on RS485 needs to stay in the receive mode most of the time.
  • When it needs to transmit, an external GPIO signal should be driven to switch the transceiver to transmit mode.
  • The signal should be de-asserted as soon as the transmission is physically finished. You need to handle the Transmission Complete (TC) event in this case, not the Transmit Register Empty event.

Theoretically, the FreeMASTER driver which is available in MCUXpresso SDK is ready to support such direction switching. You only need to modify the EnableTransmit and EnableReceive methods of the low-level driver and make sure the low-level driver supports the EnableTransmitCompleteInterrupt properly.

For KV30, the low-level UART driver is (I think) the freemaster_serial_uart.c in drivers/mcuxsdk/serial directory. You will need to modify the _FMSTR_SerialUartEnableTransmit and _FMSTR_SerialUartEnableReceive methods. 

You may notice there already is some "direction switching" code which is conditionally compiled when FMSTR_SERIAL_SINGLEWIRE is set. But note that this mode is NOT good in the RS485 case. This mode is used for internal single-wire operation as it is directly supported by the UART module.

Regards,
Michal

0 Kudos

1,117 Views
rkavinash03
Contributor I

Thank you, sir

          I enabled RXRTS, and used automatic RTS control referred from below link.

https://community.nxp.com/t5/Kinetis-Microcontrollers/Can-i-communicate-rs485-via-UART-with-FRDM-k64...

It works.

0 Kudos