USART Code-snippets

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
tfAteba
Posts: 547
Joined: Fri Oct 16, 2015 11:03 pm
Location: Strasbourg, France
Has thanked: 91 times
Been thanked: 48 times

Re: USART Code-snippets

Postby tfAteba » Tue Oct 04, 2016 6:50 am

Hi Chudik,

The default baud rate is effectively 38400 bps, it is define in the halconf.h file locate in your project directory. You can change it threre.
regards,

Theo.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: USART Code-snippets

Postby Giovanni » Tue Oct 04, 2016 8:54 am

Hi,

If you want to set more parameters for each serial port then you need to use a SerialConfig, in that structure you can set baud rate and the content for CR1, CR2 and CR3 registers. The structure is passed as pointer to sdStart().

See serial_lld.h for the structure definition.

Giovanni

User avatar
Chudik
Posts: 152
Joined: Fri Jan 16, 2015 7:51 am
Location: California
Has thanked: 7 times
Been thanked: 1 time

Re: USART Code-snippets

Postby Chudik » Tue Oct 04, 2016 9:50 pm

Giovanni wrote:Hi,

need to use a SerialConfig, in that structure you can set baud rate and the content for CR1, CR2 and CR3 registers. The structure is passed as pointer to sdStart().

See serial_lld.h for the structure definition.

Thanks. This posting reminded me to add headers files to my project :)

Looked at serial_lld.h.
Seems like need to use CubeMX to fill out those structure. Or read full datasheet. Using CubeMX is definitely easy ;)
How good would be to combine these two great products... :roll:


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 7 guests