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

sd_ppi_channel_xxx funtions

Hello,

I made a PWM with the TIMER2 of my nRF51822 (with the SoftDevice) and was working fine, till I read that I should not use the "NRF_PPI"	functions and use the "sd_ppi_XXX". I change them in my code and the PWM doesn´t work. If I use my old configuration it still work.

So my question is if I´m making something wrong, or I should continue using my old configuration?


// Configure PPI channel 0 to toggle PWM_OUTPUT_PIN on every TIMER2 COMPARE[0] match err_code = sd_ppi_channel_assign( 0 , &NRF_TIMER2->EVENTS_COMPARE[1], &NRF_GPIOTE->TASKS_OUT[0]);

// old // NRF_PPI->CH[0].EEP = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[1]; // old // NRF_PPI->CH[0].TEP = (uint32_t)&NRF_GPIOTE->TASKS_OUT[0];

// Configure PPI channel 1 to toggle PWM_OUTPUT_PIN on every TIMER2 COMPARE[1] match err_code = sd_ppi_channel_assign( 1 , &NRF_TIMER2->EVENTS_COMPARE[2], &NRF_GPIOTE->TASKS_OUT[0]);

// old // NRF_PPI->CH[1].EEP = (uint32_t)&NRF_TIMER2->EVENTS_COMPARE[2]; // old // NRF_PPI->CH[1].TEP = (uint32_t)&NRF_GPIOTE->TASKS_OUT[0];

// Enable PPI channels 0-2 err_code = sd_ppi_channel_enable_set((PPI_CHEN_CH0_Enabled << PPI_CHEN_CH0_Pos) | (PPI_CHEN_CH1_Enabled << PPI_CHEN_CH1_Pos));

// old // NRF_PPI->CHEN = (PPI_CHEN_CH0_Enabled << PPI_CHEN_CH0_Pos) // old // | (PPI_CHEN_CH1_Enabled << PPI_CHEN_CH1_Pos);


Thanks.

Related