Page 1 of 1

Using UART

Posted: Tue Jan 07, 2020 6:54 pm
by speecu
Hello, i've got a question: where can i set the clock configuration on 115200 or its automatically set? Cause i want to use UART for communication with tfmini plus sensor.

Re: Using UART

Posted: Tue Jan 07, 2020 8:14 pm
by Andy2No
It's usual to have something like this, in setup() :

Serial.begin(115200);

- but there's an optional second parameter, called config, which has more options, so you can set things like parity, number of stop bits, and so on, by choosing a configuration off a list of alternatives.

Here's the official arduino reference page, which hopefully also corresponds to how it's done in STM32 arduino:

https://www.arduino.cc/en/Serial.Begin

You can do the same with other serial ports (Serial1, Serial2...), but you may need to declare them first, specifying the pins they use.

If you meant setting which hardware clock or timer is used... I have no idea :) I suspect it's automatic, and fixed.

Re: Using UART

Posted: Wed Jan 08, 2020 8:13 am
by fpiSTM
The config for the Serial speed is made automatically using the

Code: Select all

Begin(speed)
method.