- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to generate clock with frequency changing between 2MHz and 2.2MHz in every 10 periods. I could generate the clean PWM with
gpioComplexConfig.outValue = CyFalse;
gpioComplexConfig.inputEn = CyFalse;
gpioComplexConfig.driveLowEn = CyTrue;
gpioComplexConfig.driveHighEn = CyTrue;
gpioComplexConfig.pinMode = CY_U3P_GPIO_MODE_PWM;
gpioComplexConfig.intrMode = CY_U3P_GPIO_NO_INTR;
gpioComplexConfig.timerMode = CY_U3P_GPIO_TIMER_HIGH_FREQ;
gpioComplexConfig.timer = 0;
gpioComplexConfig.period = (93-1);
gpioComplexConfig.threshold = (47-1);status = CyU3PGpioSetComplexConfig(GPIO_42, &gpioComplexConfig);
But when I use the interrupt as:
gpioComplexConfig.intrMode = CY_U3P_GPIO_INTR_TIMER_ZERO;
I start to get jitters in the clock:
even when the callback function is empty.
I tried to use CyU3PGpioComplexUpdate() in the callback to change the period,
void onCallback(uint8_t gpio_id) {
g_timerIntrCount++;
if (g_timerIntrCount == 20){
CyU3PGpioComplexUpdate(gpio_id, 46, 92);
g_timerIntrCount = 0;
}
else if (g_timerIntrCount == 10){
CyU3PGpioComplexUpdate(gpio_id, 46, 93);
}
}
but the jitters still occur. How can I solve this issue?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer to this thread: FX3: Fast interrupt timer implementation
The clock skew cannot be avoided when the interrupts are registered.
Thanks,
Yatheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please refer to this thread: FX3: Fast interrupt timer implementation
The clock skew cannot be avoided when the interrupts are registered.
Thanks,
Yatheesh