This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Hello world simple program to drive DC Motor

Hi

I'm working on a project to drive a DC motor, I really didn't find any example. I would like to know how can I program a pin in Keil, and I would be happy to have a simple example about it.

By the way Im using NRF51 DK.

Bests,

Parents
  • Hey Guys Thank you for your helps but one remaining issue about blinky example is that, it use a pre-defined functions to configure leds pin.

    I really need a simple example which goes directly to gpio.h and shows how to work with this library

  • nrf_gpio.h defines functions like nrf_gpio_pin_set() so you don't have to write directly to the registers. The blinky example shows how to use this library. Isn't that what you wanted?

    You write: "I really need a simple example which goes directly to gpio.h and shows how to work with this library". That is exactly what the blinky example does.

    If you want to go lower than that, you can have a look into nrf_gpio.h and see how the functions write to the registers on the chip. For example NRF_GPIO->OUT = 0xFF writes 1 to all pins. To see which registers you can write to and what they do, go to the nRF51 Reference Manual section 13.2

Reply
  • nrf_gpio.h defines functions like nrf_gpio_pin_set() so you don't have to write directly to the registers. The blinky example shows how to use this library. Isn't that what you wanted?

    You write: "I really need a simple example which goes directly to gpio.h and shows how to work with this library". That is exactly what the blinky example does.

    If you want to go lower than that, you can have a look into nrf_gpio.h and see how the functions write to the registers on the chip. For example NRF_GPIO->OUT = 0xFF writes 1 to all pins. To see which registers you can write to and what they do, go to the nRF51 Reference Manual section 13.2

Children
No Data
Related