Other Parts Discussed in Thread: MSP432E401Y, MSP432E411Y
I'm working on a project where I'm supposed to implement the communication with a sensor over RS-485 connected to UART using Modbus-RTU. I have implemented the part where I'm sending data to the sensor, but I have problems switching the DE/nRE, which is connected to a GPIO PH4 pin. I'm trying to use the UART_TXINT_MODE_EOT interrupt, which according to the documentation should be raised immediately after the last bit of the last byte is sent, to change the direction of communication once the data is sent and the interrupt does get raised, but it's too slow so I miss the sensor's response. I did some rough measurements using timers and it seems that the interrupt is raised around 30ms too late.
Here's the part of the code where it's supposed to happen. Can anyone help me figure out why it isn't working as I thought it would?