GPIO clock 200MHz

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Linda
Level 3
Level 3
5 likes given 25 sign-ins 5 questions asked

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

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Linda,

Due to some hardware limitations on the FX3, the PWM frequency from a complex GPIO cannot go beyond 50MHz.

Best Regards,
AliAsgar

View solution in original post

3 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

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.

Linda
Level 3
Level 3
5 likes given 25 sign-ins 5 questions asked

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

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Linda,

Due to some hardware limitations on the FX3, the PWM frequency from a complex GPIO cannot go beyond 50MHz.

Best Regards,
AliAsgar