2
\$\begingroup\$

I need to find data register address for GPIO pin 21 Cortex ARM M0?

I feel this question can need some background. I am learning embedded MCU programming and most sources mention that I need to find the address for the particular port / pin. It seems like a basic thing to do (so basic, that it is not really covered how to do it)

I studied manuals / architecture reference for Cortex ARM M0 closely, but could not find anything that can point me to the address. All I see is range (in my case, I know the peripheral range is 0x40000000-0x5FFFFFFF).

Here is the link to technical reference manual: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0432c/DDI0432C_cortex_m0_r0p0_trm.pdf

Architecture reference: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0419b/index.html

\$\endgroup\$
  • \$\begingroup\$ Which MCU Cortex ARM M0? \$\endgroup\$ – Iancovici Jul 16 '13 at 18:24
  • \$\begingroup\$ The one used in Nordic nrf51822 \$\endgroup\$ – Stpn Jul 16 '13 at 19:21
  • \$\begingroup\$ If I understood "port/pin" correctly, you need information on GPIO registers. That kind of information is in vendor's reference manuals. ARM manuals are for the ARM core. Besides, vendors provide header files with symbolic names for peripheral registers so you rarely need to actually know the address. \$\endgroup\$ – Thorn Jul 16 '13 at 19:38
  • \$\begingroup\$ I see, yes, the vendor does provide headers, I am inquiring for more.. educational purposes. I checked vendors reference and will update the question.. \$\endgroup\$ – Stpn Jul 16 '13 at 19:49
2
\$\begingroup\$

You should probably just use the function provided in the header files.

#include <nrf_gpio.h>
nrf_gpio_cfg_output()
nrf_gpio_pin_set()
nrf_gpio_pin_clear()

If you want to see how the registers are defined, read the definitions of these functions in the header files.

There are some examples in the SDK, which I've ranted about before: http://markrages.tumblr.com/post/48981903493 Maybe the examples are better now.

\$\endgroup\$
0
\$\begingroup\$

That information is (presumably) in the "nRF51 Series Reference Manual", for which you will have to subscribe to a Nordic account. See the product page, rightmost tab, bottom document.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.