5 Replies Latest reply on Sep 29, 2013 1:32 PM by ken.schutz

    Problems with driving PCLK as GPIF Master

    ken.schutz
        • 1. Re: Problems with driving PCLK as GPIF Master
          ken.schutz

          I am using this project http://www.cypress.com/?rID=84236 on GPIF Master and I would like to be clock master. I have the attached GPIF Prject configured that I am clock master and I am sending PCLK out and the GPIF project just sends the data out the port with no handshaking required. This is just very simple project to send the data out to help learn the GPIF libraries. I dont see any code on the C files that "Enable PCLK" so I think this is done in the GPIF configuration.

             

           

             

          However, when I use the created GPIF files with this project, I dont see any clocks on the mictors on the board. I am looking at all of the mictor signals on both mictors. The only thing I see are the UART messages. I was thinking that since I am Clock master I would be getting a continuous GPIF clock out GPIO16 or PCLK. What am i doing wrong?

             

          There are some posts that say PCLK can only be an input(http://www.cypress.com/?app=forum&id=167&rID=60505, .  But in the application note for the above project, it says the below that says it can drive clock.

             

           

             

           

             

          Per note:  Do you want FX3 GPIF II to drive the interface clock? If yes, then internal; otherwise, it’s external. This section is dimmed out if "Synchronous" is not selected in question 3.

             

          Other Forum posts imply that you can be a clock master and generate PCLK.

             

           

             

           

             

          Ken
           

          • 2. Re: Problems with driving PCLK as GPIF Master
            nikhil.naik
                    Are you using FX3 DVK?   
            • 3. Re: Problems with driving PCLK as GPIF Master
              ken.schutz

              Yes.  And I am also just the SWAGGER Jtag probe and logging out the UART.

                 

               

                 

              Ken

              • 4. Re: Problems with driving PCLK as GPIF Master
                shashank.rebbapragada

                 Hi Ken,

                   

                 

                   

                Just check your firmware C code and make sure that you are calling the CyU3PPibInit() API.

                   

                The second argument of this API holds the PIB clock config.

                   

                Also check the return status of this API and print the error message on UART to see if something might be going wrong there.

                   

                The example code in AN87216 does this correctly, so you can refer to that.

                   

                 

                   

                Regards

                   

                Shashank

                • 5. Re: Problems with driving PCLK as GPIF Master
                  ken.schutz

                   

                     
                           
                       

                  I figured out my problem and it was just a stupid user issue.  I have th PCLK coming and that working great(see attached waveform).  I also added the following call to pull data from the Control transaction and send it to the GPIF bus, and this is working as well. My HW designer and myself are looking at the waveform (Attached) of the data coming out on this call and noticed that it take almost  18 us to send the 3 words because of the large gaps between the 3 transactions.  We think this is caused by SW call,CyU3PGpifWriteDataWords parsing the call and doing the writes.  Is this correct?

                   

                   

                  CyU3PUsbGetEP0Data (wLength, glEp0Buffer, 0);        
                           
                            

                   

                           
                          
                           
                            
                                        
                           

                   

                      
                     
                     
                      
                       

                   awGpibBuffer[0] = glEp0Buffer[3];

                       
                        awGpibBuffer[0] = (awGpibBuffer[0]<<8) |glEp0Buffer[2];     
                       
                        awGpibBuffer[0] = (awGpibBuffer[0]<<8) |glEp0Buffer[1];     
                       
                        awGpibBuffer[0] = (awGpibBuffer[0]<<8) |glEp0Buffer[0];     
                       
                        awGpibBuffer[1] = glEp0Buffer[7];     
                       
                        awGpibBuffer[1] = (awGpibBuffer[1]<<8) |glEp0Buffer[6];     
                       
                        awGpibBuffer[1] = (awGpibBuffer[1]<<8) |glEp0Buffer[5];     
                       
                        awGpibBuffer[1] = (awGpibBuffer[1]<<8) |glEp0Buffer[4];     
                       
                        awGpibBuffer[2] = glEp0Buffer[11];     
                       
                        awGpibBuffer[2] = (awGpibBuffer[2]<<8) |glEp0Buffer[10];     
                       
                        awGpibBuffer[2] = (awGpibBuffer[2]<<8) |glEp0Buffer[9];     
                       
                        awGpibBuffer[2] = (awGpibBuffer[2]<<8) |glEp0Buffer[8];     
                       
                        apiRetStatus =            
                      
                     
                     

                   

                     
                      
                       
                              
                      
                      
                            
                     
                     
                       CyU3PGpifGetSMState(&current_state);CyU3PDebugPrint (4, "Current state before write is %d \n\r", current_state, apiRetStatus );CyU3PGpifWriteDataWords (0, CyFalse, 3, &(awGpibBuffer[0]), 0xFF);if (apiRetStatus == CY_U3P_SUCCESS)CyU3PDebugPrint (4, "Write Data = 0x%x\n\r", awGpibBuffer[0]);else{CyU3PDebugPrint (4, "Write failed with error code %d\n\r", apiRetStatus );CyU3PGpifGetSMState(&current_state);CyU3PDebugPrint (4, "Current state %d and err = %d\n\r", current_state, apiRetStatus );

                   

                      
                     
                          
                     
                      apiRetStatus =   
                     
                          
                     
                      {   
                     
                          
                     
                      }   
                     
                          
                     
                          
                     
                      apiRetStatus =   
                     
                          
                     
                          
                     
                      }