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

GPIOTE task on PPI TEP and FORK not working

I'm using a timer to trigger pins via PPI & GPIOTE. Setting the PPI TEP to the GPIOTE task works as expected. However, when I try to set a second pin via GPIOTE task via PPI FORK, the second pin isn't being set.

Here's an image of the register values in question that aren't working:

GPIOTE, GPIO, PPI register values

PPI Channel 0 correctly toggles pin 0,14, but doesn't enable pin 0,8.

Parents Reply Children
  • Could you please provide a sample showing the issue?

     

    Kind regards,

    Håkon

  • This will flash LEDs on the nRF52840-DK. It *should* flash all 4, but in my testing it only flashes 1 (which is 1 fewer than I expected).

    https://github.com/EntropicEngineering/GPIOTE_test

    Built against the NRF Connect SDK.

  • Hi,

     

    Could you test this proposed fix?

    diff --git a/src/main.c b/src/main.c
    index 46802e0..f04f053 100644
    --- a/src/main.c
    +++ b/src/main.c
    @@ -81,6 +81,10 @@ APP_ERROR_CHECK(nrfx_ppi_channel_enable(ppi_channel))
         task_addr = nrfx_gpiote_out_task_addr_get(LED3_PIN);
         APP_ERROR_CHECK(nrfx_ppi_channel_fork_assign(ppi_channel, task_addr));
     
    +    nrfx_gpiote_out_task_enable(LED2_PIN);
    +    nrfx_gpiote_out_task_enable(LED3_PIN);
    +    nrfx_gpiote_out_task_enable(LED4_PIN);
    +
         return 0;
     }
     
    @@ -94,11 +98,11 @@ void main(void) {
     
         nrfx_timer_extended_compare(&m_timer0, 0, 1000000, 0, false);
         nrfx_timer_extended_compare(&m_timer0, 1, 2000000, 0, false);
    -    nrfx_timer_extended_compare(&m_timer0, 2, 3000000, TIMER_SHORTS_COMPARE1_CLEAR_Enabled, false);
    +    nrfx_timer_extended_compare(&m_timer0, 2, 3000000, NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, false);
     
         nrfx_timer_extended_compare(&m_timer1, 0, 1000000, 0, false);
         nrfx_timer_extended_compare(&m_timer1, 1, 2000000, 0, false);
    -    nrfx_timer_extended_compare(&m_timer1, 2, 3000000, TIMER_SHORTS_COMPARE1_CLEAR_Enabled, false);
    +    nrfx_timer_extended_compare(&m_timer1, 2, 3000000, NRF_TIMER_SHORT_COMPARE1_CLEAR_MASK, false);
     
         nrfx_timer_enable(&m_timer0);
         nrfx_timer_enable(&m_timer1);
    

     

    Kind regards,

    Håkon

Related