cancel
Showing results for 
Search instead for 
Did you mean: 

What's difference between these several register?

rozehtiyan
Associate II
Posted on September 15, 2013 at 14:25

Hi everybody

i have three primary questions.

1- What's difference between GPIOx_CRL rigester and GPIOx_CRH rigester?

B.T.W: yeah, i know these both configure the GPIO to input or output modes and speed of output mode but i can't to know another Differences!

2- What's difference between those two above rigester and GPIOx_BSRR or GPIOx_BRR?

3- What's difference between GPIOx_BSRR and GPIOx_BRR?

Yes, i know these questions is very primary but i can find any info about these cases.

#gpio
3 REPLIES 3
Posted on September 15, 2013 at 14:43

The

http://www.st.com/web/en/resource/technical/document/reference_manual/CD00171190.pdf

should describe bit level functionality of the registers in question

CRL handles pins 0-7, while CRH handles pins 8-15

Each pin uses 4-bits for configuration, 8 pins taking 32-bit and thus the need for TWO registers.

BSRR allows you to set and reset specific bits in the ODR in an atomic (indivisible) fashion.

BRR is very similar, but just supports resetting bits in the ODR

BSRR/BRR both act on ODR using combinatorial logic, and are technically not registers latching values in the convention (memory) sense.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rozehtiyan
Associate II
Posted on September 28, 2013 at 13:12

Thanks Clive,

Several time i saw ''atomic'' word in user manual but, i couldn't to know that what's the mean this word! what's the mean  ''atomic''?

and i couldn't know what's the means ''Set'' and ''Reset''? are the means these both register:

1- ''Set'' put the 1 on the GPIO pins? and

2- ''Reset'' put the 0(zero) on the GPIO pins?

Posted on September 28, 2013 at 13:41

Yes,

Set = High = 1

Reset = Low = 0

Atomic means indivisible, at once, can not be broken into smaller pieces/steps. Occurring together at a synchronous clock edge.

If you set one pin high in one operation, and another low in another operation, the pin transitions would occur at different times, if an interrupt occurs between the two operations the time between the changes will push out further. In many cases this is undesirable, and you want both transitions to occur together, atomically.

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