Hi,
I want to use timer1 or 2 interrupt ISR to generate complicated PWM signal. but the timer->intenset setting cause ble connection drop problem.
Please refer to my code below.
NRF_TIMER2->MODE = TIMER_MODE_MODE_Timer;
NRF_TIMER2->BITMODE = TIMER_BITMODE_BITMODE_16Bit << TIMER_BITMODE_BITMODE_Pos;
NRF_TIMER2->PRESCALER = 9;
// Clears the timer, sets it to 0.
NRF_TIMER2->TASKS_CLEAR = 1;
// Load the initial values to TIMER2 CC registers.
NRF_TIMER2->CC[0] = 10000;
// Interrupt setup.
*NRF_TIMER2->INTENSET = (TIMER_INTENSET_COMPARE0_Enabled << TIMER_INTENSET_COMPARE0_Pos);*
// Enable interrupt on Timer 2.
//NVIC_EnableIRQ(NRF_TIMER2);
// Start the timer.
NRF_TIMER2->TASKS_START = 1;
if I comment out the TIMER2->INTENSET, then no problem.
Please let me know why...
Best regards, Joy Kang.