cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, ı would like to know what is the difference between clear and reset in STM32 Microcontrollers.Also,in datasheet some bits are on quote "set by hardware" and some bits are "set by software" while coding,does this make any difference?

GOztu.1
Associate

Difference between clear and reset

3 REPLIES 3

#1 Register in Peripherals are NOT memory, they should not be assumed to behave like memory, and should be assumed as volatile from the compilers perspective. READ and WRITING may involve entirely different registers and logic, and might alter states in other registers.

>>does this make any difference?

Yes

For example the TIM->SR you don't RMW this register you just write a mask that clears the bits of interest without clearing things in a way that you'll miss them.

Clear/reset are both reaching the low state for a bit, the method/mechanics may be different. You should perhaps review some ARM TRM, and the ST RM taking mental note of subtle indications of behaviour and expectations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

> what is the difference between clear and reset in STM32 Microcontrollers

ST is a French/Italian company, so its employees probably don't quite understand that "reset" is a bad word for "set to 0"... but they use it historically for quite a long time and it's unlikely this could be eradicated.

> some bits are on quote "set by hardware" and some bits are "set by software" while coding,does this make any difference?

Maybe end of this text ("three groups of registers") could help.

JW

S.Ma
Principal

Same as JW, SetHigh/SetLow would be better than Reset which has multiple meanings. Set by hw, clear by sw are hw flipflops for asynchroneous handshakes. Say EXTI PR bit will be set high by HW when falling edge detected by hw on a pin, and set low by writing one by sw on the PR bit. This type of handshake sometime is done with ram bit between interrupt routine and main loop.