Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > ComplexGpio used as Timer some changes at the new Release version 1.0

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



ComplexGpio used as Timer some changes at the new Release version 1.0
Moderator:
RSKV

Post Reply
Follow this topic



ComplexGpio used as Timer some changes at the new Release version 1.0

Lumpi6 posted on 13 Jan 2012 3:06 AM PST
Top Contributor
183 Forum Posts

Hi,

I am using a complex gpio as a timer. Before the new release version I used CY_U3P_GPIO_INTR_TIMER_ZERO and it worked as it was supposed to be. With the new release I had to change some configuration of the complex pin. Now I am using CY_U3P_GPIO_INTR_TIMER_THRES and set the values see below.

The release notes of the 1.0 does not say anything about changes at the complex GPIO!

#if OLD_BETA_SDK_FX3
    g_GpioComplexConfig[u8GpioTimerId].intrMode    = CY_U3P_GPIO_INTR_TIMER_ZERO;
    g_GpioComplexConfig[u8GpioTimerId].timerMode   = CY_U3P_GPIO_TIMER_HIGH_FREQ;
    g_GpioComplexConfig[u8GpioTimerId].period      = u32Timer;
#else // NEW_RELEASE
    g_GpioComplexConfig[u8GpioTimerId].intrMode    = CY_U3P_GPIO_INTR_TIMER_THRES;
    g_GpioComplexConfig[u8GpioTimerId].timerMode   = CY_U3P_GPIO_TIMER_HIGH_FREQ;
    g_GpioComplexConfig[u8GpioTimerId].timer       = u32Timer;
    g_GpioComplexConfig[u8GpioTimerId].period      = u32Timer;
    g_GpioComplexConfig[u8GpioTimerId].threshold   = u32Timer;
#endif
 

Which values should be used if I like to have a function to start and stop a timer? The start occurs in application code and the stop occurs in the GPIO interrupt handler.

Thanks

lumpi




Re: ComplexGpio used as Timer some changes at the new Release version 1.0

aasi posted on 17 Jan 2012 03:40 AM PST
Cypress Employee
1073 Forum Posts

Hi,

From which version of Beta to release are you migrating?

Some changes were made from Beta-1 to Beta-2 and are documented in the release notes can you please take a look at it.

Regards,

Anand



Re: ComplexGpio used as Timer some changes at the new Release version 1.0

Lumpi6 posted on 17 Jan 2012 04:22 AM PST
Top Contributor
183 Forum Posts

Hi Anand,

thanks for your reply, I migrated from the last version BETA 4 to the new Release version.

Because of this I wonder because there were no changes described in the release notes between these versions.

Thanks

Lumpi



Re: ComplexGpio used as Timer some changes at the new Release version 1.0

aasi posted on 23 Jan 2012 11:23 PM PST
Cypress Employee
1073 Forum Posts

Hi Lumpi,

There is no change in the SetComplexConfig API since Beta 2 with this regard. But all input parameters must be initialized. Uninitialized variables can bring in undefined behaviour. Since in the given case, the interrupt generation is based on = CY_U3P_GPIO_INTR_TIMER_THRES the values to be used for initialization for a simple timer is

    g_GpioComplexConfig[u8GpioTimerId].outValue = CyFalse;

    g_GpioComplexConfig[u8GpioTimerId].driveLowEn = CyFalse;

    g_GpioComplexConfig[u8GpioTimerId].driveHighEn = CyFalse;

    g_GpioComplexConfig[u8GpioTimerId].inputEn = CyFalse;

    g_GpioComplexConfig[u8GpioTimerId]. CY_U3P_GPIO_MODE_STATIC;

    g_GpioComplexConfig[u8GpioTimerId].intrMode    = CY_U3P_GPIO_INTR_TIMER_THRES;

    g_GpioComplexConfig[u8GpioTimerId].timerMode   = CY_U3P_GPIO_TIMER_HIGH_FREQ;

    g_GpioComplexConfig[u8GpioTimerId].timer       = 0;

    g_GpioComplexConfig[u8GpioTimerId].period      = u32Timer;

    g_GpioComplexConfig[u8GpioTimerId].threshold   = u32Timer;

CY_U3P_GPIO_INTR_TIMER_THRES based interrupt happens when timer value crosses threshold value. The period value determines when the timer count will be reset to zero. The reset to zero will happen only when the timer values crosses the period value or when it increments over 0xFFFFFFFF. So interrupt will not happen if the threshold is greater than period. Please try this and let me know.

Thanks,

Anand



Re: ComplexGpio used as Timer some changes at the new Release version 1.0

Lumpi6 posted on 23 Jan 2012 05:07 AM PST
Top Contributor
183 Forum Posts

Hi Anand,

it works fine as you described in the last post.

I already had set up the complex gpio as you described there. Just one change that I had load the u32timer value also into g_GpioComplexConfig[u8GpioTimerId].timer. Now I load this value with 0 as you described and the behaviour is the same.

 

I think there is now everything fine disregarding the fact, that I really had to do changes as I changed to release version from BETA4.

Thank you very much, regards.

Lumpi






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.