I’m trying to use UART to Tx/Rx a legacy sensor on 5V. I’m using a DEBO LEV SHIFTER in order to convert the 3,3V Tx/Rx from/to the STM32L475 to 5V. The code is as follows:
MX_USART1_UART_Init();
HAL_UART_Transmit(&huart1, msg, sizeof(msg), 1000);
the payload is a byte array with the commands which the sensor expects. The UART comms worked using an Arduino and Serial1, and I checked them with the notes, so I think they are not the problem.
When I connect a Oscilloscope to Tx/GND just in front of the Lev shifter, nothing happens. The voltage is constant at 3,3V. Surely it should be jumping every time a message is sent?
What’s wrong with the code?