USART used as GPIO to send break signal for DMX-512
Hello!
I am just getting started with STM32 universe. I've already finished my first project using the IDE SW4STM32 and I board I've designed using the STM32F070CBT. I've also used STM32CubeMX to generate the basic code.
I wanted to keep using this board, as it's fully tested and all the hardware seems to work fine. But I just found a problem trying to implement a way to send a break signal before sending the DMX frame.
I'm using __HAL_UART_DISABLE(&huart1) and __HAL_UART_ENABLE(&huart1) to try to manage the TX1 (PA9) pin, but even though I've tried to just do a simple blink, I can't get any control. It's not doing the break signal at all.
__HAL_UART_DISABLE(&huart1);
HAL_GPIO_WritePin(TX1_Port, TX1_Pin, 0);
delay_us(150);
HAL_GPIO_WritePin(TX1_Port, TX1_Pin, 1);
delay_us(12);
__HAL_UART_ENABLE(&huart1);
HAL_UART_Transmit(&huart1,(uint8_t *)DMX_test,3,0xFFFF);I am a bit desperate as it's the only detail I'm missing to finish this project. I'm sure it's because I'm not able to send the break signal. Any comments about how can I be able to use the PA9 pin as a normal GPIO to manage the break signal and then configure it again to send the DMX frame? Maybe I am missing something, it should be very simple but it isn't. I would like to avoid to make any change at the hardware if it's possible...
Thank you very much!
A
