Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi all,
I need the cc1352 issues an interrupt on a pwm edge, but this seems to be not functional. Here following a simple snippet of the code:
void Pulse_CallBack ( GPTimerCC26XX_Handle hTimer, int_fast16_t nStatus )
{
// toggle an indicator LED
GPIO_toggle ( CONFIG_GPIO_27_LED_2 );
} // end of "Pulse_CallBack ()"
PWM_init();
PWM_Params_init ( &pwmParams );
pwmParams.periodValue = 400;
// 50% duty cycle
pwmParams.dutyValue = ( uint32_t )((( uint64_t ) PWM_DUTY_FRACTION_MAX * 50 ) / 100 );
PWM_Handle hPwm = PWM_open ( CONFIG_EXC_CLK, &pwmParams );
if ( hPwm == NULL )
{
// PWM_open() failed, stall here
while ( true );
} // endif
PWMTimerCC26XX_Object* pObject = hPwm -> object;
GPTimerCC26XX_Handle hTimer = pObject -> hTimer;
// generate interrupt on match
GPTimerCC26XX_registerInterrupt ( hTimer, ( GPTimerCC26XX_HwiFxn ) Pulse_CallBack, GPT_INT_MATCH );
PWM_start ( hPwm );
// stall here for test only
while ( 1 );
The Pulse_CallBack is never reached while the pwm signal is correctly visible on the selected output (determined with sysconfig). This never happens independently of the the value of the GPTimerCC26XX_Interrupt mask (that is using either GPT_INT_TIMEOUT, GPT_INT_CAPTURE_MATCH, GPT_INT_CAPTURE or GPT_INT_MATCH)
Where is my error?
Thanks,
sincerely Luigi