This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIO wrong?

Hi there!

I have nRF51 DK (PCA10028).

I config GIPO as below:

nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);

err_code = nrf_drv_gpiote_out_init(LED_1, &out_config);

APP_ERROR_CHECK(err_code);

Why do LED_1 turn on?

I think this config is made LED_1 turn off.

Thanks.

Parents
  • Hi,

    GPIOTE_CONFIG_OUT_SIMPLE(false); will configure the pin with initial logic level low (or at 0 V if you want). The LEDs on the PCA10028 are connected like this:

    image description

    so you can see that if the pin is low the LED will light up. If you want to initialize the LED to be off then simply write GPIOTE_CONFIG_OUT_SIMPLE(true);. It might seem a little backwards, but the true and false in the macro is with respect to high or low logic level, not whether or not the LEDs are on or off.

Reply
  • Hi,

    GPIOTE_CONFIG_OUT_SIMPLE(false); will configure the pin with initial logic level low (or at 0 V if you want). The LEDs on the PCA10028 are connected like this:

    image description

    so you can see that if the pin is low the LED will light up. If you want to initialize the LED to be off then simply write GPIOTE_CONFIG_OUT_SIMPLE(true);. It might seem a little backwards, but the true and false in the macro is with respect to high or low logic level, not whether or not the LEDs are on or off.

Children
Related