cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USART clock

Dim N
Associate II
Posted on November 29, 2017 at 10:16

Hello,

I am interested in the the STM32L063C8. In my application I will be using an USART in synchronous mode and there are some things about the clock signal that I do not understand. In the reference manual RM0367 the note on page 774 says:

'The CK pin works in conjunction with the TX pin. Thus, the clock is provided only if the transmitter is enabled (TE=1) and data is being transmitted (the data register USART_TDR written). This means that it is not possible to receive synchronous data without transmitting data.'

Does this mean, that there are no clock pulses on the CK pin, when there is no outgoing data transmission? How does the receiver send data, when the clock is out after the master has finished transmitting? According to this manual, during the Idle state, preamble and send break, the external CK clock is not activated (page 773). My application requires a constant clock, even when no data is being sent to the receiver. Is this possible with this controller? In my previous experience with USART there was always a clock signal on the line after the transmitter has been enabled. Could someone explain the behaviour of the clock during a simple transaction, e.g. master sends some bytes, receiver responds, then a short pause and another data transmission?

Thanks!

3 REPLIES 3
Posted on November 29, 2017 at 17:27

It probably has the least useful implementation possible...

Perhaps the SPI peripheral can be used in a more continuous and synchronous fashion.

Are you using some existing chips/protocols currently?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 30, 2017 at 09:45

From your reply I assume that there is no clock on the line when the master is not transmitting. How does the recieving end respond, when the clock is not always present? I am planning on using the peripheral in single-wire half-duplex mode. Currently I use an AVR chip (which does not have half-duplex) with TX and RX connected to each other. Is it possible to use the SPI in a similar manner?

sunphoenixt
Associate II
Posted on July 13, 2018 at 16:26

Just send a dummy byte(such as 0x00/0xff) to the slave.