Part Number: CC2640R2F
Other Parts Discussed in Thread: BLE-STACK
Tool/software: TI-RTOS
Hi!
Trying to opposite-phase-synchronize two PWMs, using the PWMTimer driver in combination with the Timer from device driverlib.
I've included a scope shot of the waveform output (this is feeding a piezo, thus the capacitive coupling). This is the same regardless of whether the TimerSynchronize is there or not.
TimerWaitOnTriggerControl also doesn't seem to be working.
driverlib.lib is included in the build.
EDIT: Formatting
PWM_Params params;
PWM_Params_init(¶ms);
params.idleLevel = PWM_IDLE_LOW;
params.dutyUnits = PWM_DUTY_US;
params.dutyValue = BUZZER_PWM_DUTY_US;
params.periodUnits = PWM_PERIOD_US;
params.periodValue = BUZZER_PWM_PERIOD_US;
pwm1 = PWM_open(BUZZER_I1_PWM, ¶ms);
if (pwm1 == NULL) {
Log_debug(0, LOG_LEVEL_WARNING, "BUZZER PWM1 FAIL");
return;
}
pwm2 = PWM_open(BUZZER_I2_PWM, ¶ms);
if (pwm2 == NULL) {
Log_debug(0, LOG_LEVEL_WARNING, "BUZZER PWM2 FAIL");
return;
}
TimerLevelControl(GPT2_BASE, TIMER_A, false);
TimerLevelControl(GPT2_BASE, TIMER_B, true);
PWM_start(pwm1);
PWM_start(pwm2);
// This doesn't seem to be working.
TimerSynchronize(GPT0_BASE, TIMER_2A_SYNC || TIMER_2B_SYNC);