Using UART

Post here first, or if you can't find a relevant section!
Post Reply
speecu
Posts: 5
Joined: Sat Jan 04, 2020 3:51 pm

Using UART

Post 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.

Andy2No
Posts: 15
Joined: Mon Dec 30, 2019 8:34 pm

Re: Using UART

Post 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.

User avatar
fpiSTM
Posts: 742
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: Using UART

Post by fpiSTM »

The config for the Serial speed is made automatically using the

Code: Select all

Begin(speed)
method.

Post Reply

Return to “General discussion”