Page 1 of 1

Greetings from Seattle

Posted: Wed Oct 11, 2017 5:28 pm
by xC0000005
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).

Re: Greetings from Seattle

Posted: Wed Oct 11, 2017 7:21 pm
by zmemw16
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

Re: Greetings from Seattle

Posted: Wed Oct 11, 2017 8:52 pm
by ahull
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

Re: Greetings from Seattle

Posted: Thu Oct 12, 2017 8:26 am
by stevestrong
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.