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

Can I configure GPIOTE to debug my signals?

Hello,

I am using nrf52832 DK and I would like to use the GPIOs port to debug a couple of signals that I genereate within the MCU.

So far I have configured my GPIOTE module like this (I am using the LEDs for now as example to see that they change), but I am not sure how if I have to configure the GPIOTE more in order to make my signal available on that pin.

My definition

#define GPIO_OUTPUT_A  BSP_LED_0 //25  /**< Pin number for A signal debug. */

My GPIOTE config

static void gpiote_init(void){

    uint32_t            err_code;
    nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_SIMPLE(NRF_GPIOTE_INITIAL_VALUE_LOW);
    
    //Configuring A debug pin
    err_code = nrf_drv_gpiote_out_init(GPIO_OUTPUT_A, &config);
    APP_ERROR_CHECK(err_code);

    if (!nrf_drv_gpiote_is_init())
    {
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    }
}

So if I would like to have the value of A,define as float for instance, how can I write it to the GPIO_OUTPUT_A ? Something like this

nrf_gpio_pin_write(GPIO_OUTPUT_A,(uint32_t)A);

Thanks in advance

Parents
  • Are you sure you are using right module? GPIOTE (as shortcut suggests) means General Purpose IO Tasks and Events, how you would like to utilize it for debug? You can either signal something with GPIO pulses (simple setting digital LOW/HIGH values on PINs you like), that has nothing to do with Task and Event functionality (that's useful if you want to detect some GPIO input change (= that's Event part) and do some action upon this trigger (= that's the Task part)).

    But simple GPIO low/high won't output any "value" (not speaking about "float" type;))) unless you design some protocol on top of simple digital GPIO (low/high values). Serial data output over UART is typical example but you can use other things like SEGGER RTT... then again question is why you don't use these logging/debugging modules built into Nordic SDK examples and bother with GPIO(TE)???

Reply
  • Are you sure you are using right module? GPIOTE (as shortcut suggests) means General Purpose IO Tasks and Events, how you would like to utilize it for debug? You can either signal something with GPIO pulses (simple setting digital LOW/HIGH values on PINs you like), that has nothing to do with Task and Event functionality (that's useful if you want to detect some GPIO input change (= that's Event part) and do some action upon this trigger (= that's the Task part)).

    But simple GPIO low/high won't output any "value" (not speaking about "float" type;))) unless you design some protocol on top of simple digital GPIO (low/high values). Serial data output over UART is typical example but you can use other things like SEGGER RTT... then again question is why you don't use these logging/debugging modules built into Nordic SDK examples and bother with GPIO(TE)???

Children
No Data
Related