You are here

FX3 ticks are not 1ms | Cypress Semiconductor

FX3 ticks are not 1ms

Summary: 2 Replies, Latest post by Ian Jeffray on 20 Jun 2016 03:20 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_373397504's picture
4 posts

The FX3 SDK ticks appear to be 1.024ms, not 1ms.    For example, a test thread thus:

    int state =0;
        CyU3PGpioSimpleSetValue(GPIO_STATUS_LED, state);
        state ^=1;

This toggles the output at 512millihertz.   Changing the sleep to 1024 toggles at the expected 500millihertz.

 How can we correct the FX3 setup to tick properly at the documented 1ms?


mady's picture
Cypress Employee
955 posts


If you look into the source CyU3PGpioSimpleSetValue API, there are few statements before which the GPIO state is actually written. Those statements are causing the delay.

If you replace this API by the single statement involving the register write, you will achieve the expected frequency.

For making the register write, please refer the source code of the CyU3PGpioSimpleSetValue API. The source code is available aloing with the FX3 SDK in "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\"


- Madhu Sudhan


user_373397504's picture
4 posts

No, this response is completely incorrect.    The GPIO is not causing the delay (I would be completely horrified if your GPIO API was implemented so poorly as to cause a timeable delay this gross on such a fast CPU!).  The "few statements" you refer to will execute in mere nanoseconds which is an irrelevant amount - I'm talking about a fixed error on the documented clock rate!

If I toggle at 10Hz, I actually toggle at 10.24Hz.   If I toggle at 1Hz, I actually toggle at 1.024Hz.  The delay is constant irrespective of whether or not I use GPIO calls.  The FX3 really is 'ticking' 1024 times each second, not 1000.

It's a little disappointing to receive such a poor (wrong) answer from a Cypress employee.

Log in to post new comments.