2 Replies Latest reply on Nov 25, 2016 5:16 PM by jf6405_1607811

    GPIF-II Counter Setting

    jf6405_1607811

      Hi, my problem is how to let "LOADB->SCTRL_1->M_1->...->SCTRL_4->COUNT " display 10 cycle? Now I use logic one to keep transfering from one state to another state. I try some method like "!DATA_CNT_HIT" to let the transition stop when the COUNT_DATA hit the limit, but it failed. Could someone show me the correct method to only run the period for 10 times ? Thank a lot.
       

        • 1. Re: GPIF-II Counter Setting
          kelvin.xu_1593951

          Add a "IDLE" state, DATA_CNT_HIT moves from COUNT to IDLE. 

             

          !DATA_CNT_HIT moves from COUNT to LOADB. 

             

          IDLE state as a trap state. 

          • 2. Re: GPIF-II Counter Setting
            jf6405_1607811

            Dear Lis, thank you. It really went to the trap state.

               

            I still wonder whether is the solution in Eclipse that I can use the "while( )" function to run in code. And Eclipse's method also need to fit the clock. All I do recently was building state machine in GPIF-2. Then included "cyfxgpif2config.h" in Eclipse. In code I found below describe:
            /* Start the state machine. */
                apiRetStatus = CyU3PGpifSMStart (START, ALPHA_START);
                if (apiRetStatus != CY_U3P_SUCCESS)
                {
                    CyU3PDebugPrint (4, "CyU3PGpifSMStart failed, Error Code = %d\n",apiRetStatus);
                    CyFxAppErrorHandler(apiRetStatus);
                }  

               

            Where can find the next step after"CyU3PGpifSMStart( START, ALPHA_START )" ? Like how the "COUNT --> DATA_COUNT_HIT---> IDLE"  in code ?  If I want to use Eclipse's method,  I  can go to the state machine built by GPIF-2 and use  "while( ) " make it work?

            Please tell me can this work or not, I am a newbie in these software. Thanks!!!