- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to configure a complex GPIO as a timer. I want it to go at 200 or 100 MHz (the GPIO can either be a static timer or -even better- toggle the pin at the chosen frequency).
However, when i try to set these high frequencies,my device stops enumerating. Is there a limit to the GPIO frequency i can set?
My code for gpio configuration:
gpioComplexConfig.outValue = 0;
gpioComplexConfig.inputEn = 0;
gpioComplexConfig.driveLowEn = 0;
gpioComplexConfig.driveHighEn = 0;
gpioComplexConfig.pinMode = CY_U3P_GPIO_MODE_STATIC;
gpioComplexConfig.intrMode = CY_U3P_GPIO_INTR_TIMER_ZERO;
gpioComplexConfig.timerMode = CY_U3P_GPIO_TIMER_HIGH_FREQ; //
gpioComplexConfig.timer = 0;
gpioComplexConfig.period = 1; // period after which time resets
gpioComplexConfig.threshold = 0; // value after which interrupt generates
gpio clock:
CyU3PGpioClock_t gpioClock;
gpioClock.fastClkDiv = 2;
gpioClock.slowClkDiv = 64;
gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;
gpioClock.clksrc=CY_U3P_SYS_CLK;
gpioClock.halfDiv = 0;
Any ideas ?
Thanks,
Linda
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Linda,
Due to some hardware limitations on the FX3, the PWM frequency from a complex GPIO cannot go beyond 50MHz.
Best Regards,
AliAsgar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Linda,
Please make the below changes to your configuration and let us know if the issue is solved.
gpioConfig.pinMode = CY_U3P_GPIO_MODE_PWM;
gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;
It shall produce a toggling output on the pin.
Best Regards,
AliAsgar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear AliAsgar,
Now the device enumerates! However, the signal period is uncorrect to me.
Having:
gpioClock.fastClkDiv = 2;
gpioClock.clksrc=CY_U3P_SYS_CLK;
choosing:
gpioComplexConfig.timerMode = CY_U3P_GPIO_TIMER_HIGH_FREQ;
gpioComplexConfig.period = 1;
I should have a frequency around 200Mhz (403.3MHz/2), while I have around 50Mhz since the signal period is 20 ns ( while, with 200Mhz, it should be 5 ns)
Why is that?
Thanks,
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Linda,
Due to some hardware limitations on the FX3, the PWM frequency from a complex GPIO cannot go beyond 50MHz.
Best Regards,
AliAsgar