Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Question on GPIF2, states, DR-GPIO, state machine not reacting / working

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



Question on GPIF2, states, DR-GPIO, state machine not reacting / working
Moderator:
RSKV

Post Reply
Follow this topic



Question on GPIF2, states, DR-GPIO, state machine not reacting / working

capiman posted on 07 May 2012 7:06 AM PST
Senior Member
18 Forum Posts

Hello,

i am trying to learn to setup GPIF2. I have created a GPIF2 design with the following properties:

- Master / Synchronous / Internal / 8 Bit Bus / no multiplexing / 1 input / 1 output / 2 DMA flag lines

- I have a state machine with 3 states:

-- Start state

-- STATE0: Which should set OUTPUT0 to e.g. 0

-- STATE1: Which should set OUTPUT0 to e.g. 1

Then i have 2 transitions: from STATE0 to STATE1 when INPUT0 is set and back when INPUT0 is reset (polarity does not matter at the moment).

I have attached screen shots of my design and state machine to this posting.

A) I expect that when i toggle INPUT0, then i see some reaction on OUTPUT0, but OUTPUT0 always remains 0.

B) I also expect that GPIO16 (CLK) is an output, but value is Z.

C) GPIO[0...7] is also Z, but perhaps this is correct?

D) GPIO[8...15] is 0, perhaps correct, because no used (more assumed it is Z)?

E) I also tried first without a state machine at all, changing "initial value" between high and low (of course re-compling and re-flashing), but no reaction. Therefore i am not sure, if i control the state machine at all?

 

This i my code to load and start GPIF (i get no error output, especially from these function, but of course other debug output):

    CyU3PPibClock_t pibClock;

    /* Initialize the p-port block. */
    pibClock.clkDiv = 2;
    pibClock.clkSrc = CY_U3P_SYS_CLK;
    pibClock.isHalfDiv = CyFalse;
    /* Disable DLL for sync GPIF */
    pibClock.isDllEnable = CyFalse;
    apiRetStatus = CyU3PPibInit(CyTrue, &pibClock);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "P-port Initialization failed, Error Code = %d\n",apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }

    /* Load the GPIF configuration for Slave FIFO sync mode. */
    apiRetStatus = CyU3PGpifLoad (&CyFxGpifConfig);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "CyU3PGpifLoad failed, Error Code = %d\n",apiRetStatus);
        CyFxAppErrorHandler(apiRetStatus);
    }

    /* Start the state machine. */
    apiRetStatus = CyU3PGpifSMStart (START, ALPHA_START);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "CyU3PGpifSMStart failed, Error Code = %d\n",apiRetStatus);
        if(apiRetStatus == CY_U3P_ERROR_NOT_CONFIGURED) CyU3PDebugPrint (4, "-> CY_U3P_ERROR_NOT_CONFIGURED)\n");
        if(apiRetStatus == CY_U3P_ERROR_ALREADY_STARTED) CyU3PDebugPrint (4, "-> CY_U3P_ERROR_ALREADY_STARTED)\n");
        CyFxAppErrorHandler(apiRetStatus);
    }

Have i missed something to enable GPIF? There is "isDQ32Bit", what value must it get when using 8 bit?

I have it on CyFalse, because i have not 32 bit interface.


 

 

 

 




Re: Question on GPIF2, states, DR-GPIO, state machine not reacting / working

capiman posted on 07 May 2012 07:07 AM PST
Senior Member
18 Forum Posts

Here now the state machine diagram:



Re: Question on GPIF2, states, DR-GPIO, state machine not reacting / working

capiman posted on 07 May 2012 07:12 AM PST
Senior Member
18 Forum Posts

Another question regarding DR_GPIO: How i can set OUTPUT to a certain value?

Toggle just switches the value?

Assert, ok, but how to set to 0, how to set to 1. The initial state has only one value, how to reach the other.

Or does it mean: initial state x -> assert gives initial state (x) / toggle gives inverted initial state (!x) ?

 






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.