Greetings from Seattle

Post Reply
xC0000005
Posts: 1
Joined: Wed Oct 11, 2017 5:15 pm

Greetings from Seattle

Post by xC0000005 » Wed Oct 11, 2017 5:28 pm

I'm somewhat new to STM32 development, but been coding for 24 years. Right now, I'm hacking on a 3d printer that uses an STM32F103C, and is somehow producing 7N1 serial communication via USART1 at 500,000. The more I look at the control registers, the less I understand how it's doing it, since there's a bit for 8 and a bit for 9, but no bit for (nor room for it that I can tell).

zmemw16
Posts: 1484
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Greetings from Seattle

Post by zmemw16 » Wed Oct 11, 2017 7:21 pm

since there's a bit for 8 and a bit for 9, but no bit for (nor room for it that I can tell).
reading the last line, it seems there should be another bit ? it's sort of implied with the FOR :)
sorry couldn't resist.
stephen

User avatar
ahull
Posts: 1650
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Greetings from Seattle

Post by ahull » Wed Oct 11, 2017 8:52 pm

If it is using anything other than the modes provided by STM, then it is probably bit banging the serial port rather than using the defined hardware options.... at least if I were set the challenge, that would be the method I would pursue. :D

Having said that, the Arduino serial.begin() function potentially supports a whole raft of options. Some, all, (or indeed none) may be defined, depending on which Arduino core you are using.

https://www.arduino.cc/en/Serial/Begin
- Andy Hull -

stevestrong
Posts: 1813
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Greetings from Seattle

Post by stevestrong » Thu Oct 12, 2017 8:26 am

Extract from the reference manual - USART features:
• Programmable data word length (8 or 9 bits)
• Configurable stop bits - support for 1 or 2 stop bits
So no word about 7 bit length, it must be software serial, or you simply misinterpreted the signal.
Note that if you use 9 bit length, you cannot use parity.

Post Reply