L433 UART Tx Output is Not What is Being Sent
- March 26, 2019
- 3 replies
- 1213 views
Hello:
I am trying to determine why the LPUART is transmitting out the values I am seeing. They make little sense. Here is the UART setup:
void MX_LPUART1_UART_Init(void)
{
hlpuart1.Instance = LPUART1;
hlpuart1.Init.BaudRate = 9600;
hlpuart1.Init.WordLength = UART_WORDLENGTH_8B;
hlpuart1.Init.StopBits = UART_STOPBITS_1;
hlpuart1.Init.Parity = UART_PARITY_NONE;
hlpuart1.Init.Mode = UART_MODE_TX_RX;
hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&hlpuart1) != HAL_OK)
{
Error_Handler();
}
}
MX_LPUART1_UART_Init();
For the purposes of testing, I want to transmit an 'A':
//assert the direction line on the transceiver high for transmit
HAL_GPIO_WritePin(COM_DIR_GPIO_Port, COM_DIR_Pin, GPIO_PIN_SET);
vTaskDelay(1); //small amount of delay
//transmit the letter A
HAL_UART_Transmit(&hlpuart1, (uint8_t*)'A',1,0xFFFF);
At the output of the L433, this is not at all what I am seeing. I have attached a scope capture.
If the first bit out is 0, then: 11001110, then bit high.
It does this consistently. The Tx, Rx are connected to a RS-485 transceiver, connected to an adapter to my PC, and using Teraterm set up same as the L4, it displays an 'F', which makes less sense. The second capture is the scope showng the RS485 tx. When zoomed in on the transitions, the bit transitions are the same as the tx line into the transceiver, other than the transmit control assert line transition.
I would appreciate any help or suggestions as to what might be going on, thank you.
FYI - it is being operated in RUN mode, not stop.
