I have been working with Arduino for some time and I have decided to make the leap to ARM MCU so I started recently and I have some doubts
I have an Olimex STM32E407 with STM32F407ZGT6
What I intend is to communicate this board with a machine through a serial port, in the same way that I do with the arduino mega 2560.
The peculiarity of this communication is that it uses a 9-bit UART configuration, but not constantly, it only uses 9 bits to send the first byte, the rest of the bytes are sent with the ninth bit deactivated.
I need to do the same with one of the UARTS of the STM32E407 so I appreciate in advance any help or advice to carry out this communication
Regards
This is the code that I use in the arduino mega:
Code: Select all
void sendCommand (byte temp [], int len) // Send frame to EGM
{
UCSR1B = 0b10011101; // 9 bits on
serEgm.write (temp [0]); // send first byte (machine address)
delay (5);
UCSR1B = 0b10011100; // 9 bits off
for (int i = 1; i <len; i ++)
{
serEgm.write (temp [i]); // send the rest of the bytes of the frame
delay (5);
}
}