13 Replies Latest reply on Dec 9, 2018 8:26 PM by aani

    Fx3 pulse generation shaking

    HarshitJain

      I am generating a pulse on same previous condition but the pulse generated is shaking continuously. Its levels are not clearly defined. I am using CyU3PGpioSetValue for pulse generation.

        • 1. Re: Fx3 pulse generation shaking
          aani

          Hello Harshit Jain,

           

          -You can use complex GPIO for pulse generation.

          -Please go through the below link which speaks about time period and duty cycle of PWM.

          "Install Path\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxgpiocomplexapp".

           

          Regards,

          Anil Srinivas.

          • 2. Re: Fx3 pulse generation shaking
            HarshitJain

            Sir I have already used pwm to generate clock on one pin and I want pulse i.e trigger signal to generate on another pin. When I am generating trigger its edges are shaking continuously.

            • 3. Re: Fx3 pulse generation shaking
              aani

              Hello Harshit Jain,

               

              Please go through KBA90267, which speaks about a method is given to toggle to GPIO through register. Modify the codes as this KBA suggests.

               

              Regards,

              Anil Srinivas.

              • 4. Re: Fx3 pulse generation shaking
                HarshitJain

                Sir I have gone through KBA90267. As per the document I have changed CyU3PGpioGetValue to CyU3PGpioSimpleGetValue but still now my scan is shaking. My scan starts with my trigger signal only. It starts at t = 0 but due to shaking of trigger signal it starts before. It can also be the possibility that my signal is not shaking, some other spurious signal is coming on that pin. Do you have any idea how to remove that. I have interfaced ADC with FX3 for digitization.

                • 5. Re: Fx3 pulse generation shaking
                  HarshitJain

                  bscan31.jpg

                   

                  sir, this is the ultrasonic A-scan and B-scan generated using fx3. you can see 6 horizontal lines in b-scan. That signifies that event got triggered before and the scan has moved to right only for that instant. So my both the scans are shaking. It should be rock steady. This is happening only because my trigger signal is shaking. I have done everything possible but no improvement is there.aani

                  • 6. Re: Fx3 pulse generation shaking
                    aani

                    Hello Harshit Jain,

                     

                    -- Please share the firmware file and circuit details.

                     

                    Regards,

                    Anil Srinivas.

                    • 7. Re: Fx3 pulse generation shaking
                      HarshitJain

                      Sir I have used fx3 followed by unipolar pulser. This pulser is triggered by fx3 only. Pulser output is given to ADC which is further given to PC through fx3.

                      • 8. Re: Fx3 pulse generation shaking
                        aani

                        Hello Harshit Jain,

                         

                        Please share the snippet of GPIO configuration and IO Matrix configuration.

                        Let us know which GPIO# you have used as TRIGGER.

                         

                        Regards,

                        Anil Srinivas.

                        • 9. Re: Fx3 pulse generation shaking
                          HarshitJain

                          Yes sir below is the snippet of gpio configuration

                           

                           

                          /*

                          ## Cypress USB 3.0 Platform header file (cyfxbulksrcsink.h)

                          ## ===========================

                          ##

                          ##  Copyright Cypress Semiconductor Corporation, 2010-2011,

                          ##  All Rights Reserved

                          ##  UNPUBLISHED, LICENSED SOFTWARE.

                          ##

                          ##  CONFIDENTIAL AND PROPRIETARY INFORMATION

                          ##  WHICH IS THE PROPERTY OF CYPRESS.

                          ##

                          ##  Use of this file is governed

                          ##  by the license agreement included in the file

                          ##

                          ##     <install>/license/license.txt

                          ##

                          ##  where <install> is the Cypress software

                          ##  installation root directory path.

                          ##

                          ## ===========================

                          */

                           

                          /* This file contains the constants used by the bulk source sink application example */

                           

                          #ifndef _INCLUDED_CYFXBULKSRCSINK_H_

                          #define _INCLUDED_CYFXBULKSRCSINK_H_

                           

                          #include "cyu3types.h"

                          #include "cyu3usbconst.h"

                          #include "cyu3externcstart.h"

                          #include <cyu3system.h>

                           

                          #define CY_FX_BULKSRCSINK_DMA_TX_SIZE        (0)                       /* DMA transfer size is set to infinite */

                          #define CY_FX_BULKSRCSINK_THREAD_STACK       (0x1000)                  /* Bulk loop application thread stack size */

                          #define CY_FX_BULKSRCSINK_THREAD_PRIORITY    (8)                       /* Bulk loop application thread priority */

                           

                          /* TODO: User can change the data pattern bleow that is sent by FX3 to the host */

                          #define CY_FX_BULKSRCSINK_PATTERN            (0xAA)                    /* 8-bit pattern to be loaded to the source buffers. */

                           

                          /* Endpoint and socket definitions for the bulk source sink application */

                           

                          /* To change the producer and consumer EP enter the appropriate EP numbers for the #defines.

                          * In the case of IN endpoints enter EP number along with the direction bit.

                          * For eg. EP 6 IN endpoint is 0x86

                          *     and EP 6 OUT endpoint is 0x06.

                          * To change sockets mention the appropriate socket number in the #defines. */

                           

                          /* Note: For USB 2.0 the endpoints and corresponding sockets are one-to-one mapped

                                   i.e. EP 1 is mapped to UIB socket 1 and EP 2 to socket 2 so on */

                           

                          #define CY_FX_EP_PRODUCER               0x02    /* EP 1 OUT */

                          #define CY_FX_EP_CONSUMER               0x86    /* EP 1 IN */

                           

                          #define CY_FX_EP_PRODUCER_SOCKET        CY_U3P_UIB_SOCKET_PROD_1    /* Socket 1 is producer */

                          #define CY_FX_EP_CONSUMER_SOCKET        CY_U3P_UIB_SOCKET_CONS_1    /* Socket 1 is consumer */

                           

                          /* Burst mode definitions: Only for super speed operation. The maximum burst mode

                          * supported is limited by the USB hosts available. The maximum value for this is 16

                          * and the minimum (no-burst) is 1. */

                           

                           

                          /* Burst length in 1 KB packets. Only applicable to USB 3.0. */

                          #ifndef CY_FX_EP_BURST_LENGTH

                           

                          /* TODO: Modify the burst length from 1 to 16. Setting less bandwidth will give less

                            USB throughput. Changing the burst length will also change the buffer size */

                          #define CY_FX_EP_BURST_LENGTH           (16)

                          #endif

                           

                          /*TODO: Modify the DMA multiplier to change the buffer size: Set the value from 1 to 3 */

                          #define CY_FX_DMA_MULTIPLIER            (2)

                           

                          /* Size of each DMA buffer. This should ideally be set to 2X the EP burst size. */

                          #ifndef CY_FX_BULKSRCSINK_DMA_BUF_SIZE

                          #define CY_FX_BULKSRCSINK_DMA_BUF_SIZE  (CY_FX_DMA_MULTIPLIER * CY_FX_EP_BURST_LENGTH * 1024)

                          #endif

                           

                          /* Number of DMA buffers used for the DMA channel. */

                          #ifndef CY_FX_BULKSRCSINK_DMA_BUF_COUNT

                          #define CY_FX_BULKSRCSINK_DMA_BUF_COUNT (2)

                          #endif

                           

                          #define LED_GPIO                        (54)                /* Configure GPIO54 for LED blinking */

                          #define MTR_CTRL                        (50)

                          #define LED_GPIO0                        (44)             /* DQ16-DQ23 LEDs*/

                          #define PWRDWN                             (9)

                          #define TRIGGER                            (3)

                          #define LED_GPIO3                        (18)

                          #define LED_GPIO4                        (19)

                          #define LED_GPIO5                        (0)

                          #define LED_GPIO8                        (33)

                          #define EF_BAR                            (1)

                           

                          #define FD0                                (15)             /* DQ16-DQ23 LEDs*/

                          #define FD1                                (29)

                          #define FD2                                (11)

                          #define FD3                                (25)

                          #define FD4                                (12)

                          #define FD5                                (26)

                          #define FD6                                (13)

                          #define FD7                                (27)

                           

                           

                           

                           

                           

                          #define APP_SWITCH_GPIO                 (45)

                           

                          #define APP_SWITCH_GPIO0                (57)         /* DQ0-DQ7 Switch*/

                          #define OE_BAR                          (24)

                          #define REN_BAR2                        (2)

                          #define RCLK                            (16)

                          #define REN_BAR1                        (4)

                          #define CLK                             (23)

                          #define APP_SWITCH_GPIO6                (6)

                          #define FF_BAR                          (7)

                           

                          //#define APP_SWITCH_GPIO8                (41)         /* DQ0-DQ7 Switch*/

                          #define APP_SWITCH_GPIO9                (42)

                          #define RES_BAR                         (10)

                          #define WEN_BAR1                         (22)

                          #define WEN_2                            (8)

                          #define APP_SWITCH_GPIO13                (47)

                          #define APP_SWITCH_GPIO14                (48)

                          //#define APP_SWITCH_GPIO15               (49)

                           

                           

                          #define LED_BLINK_RATE_CHANGE            (0xAA)                /* Vendor command for changing the ON-time and OFF-time

                                                                                       *of LED in terms of 100ms */

                           

                          #define SUPERSPEED_BLINK_RATE            (50)                /*Sets the blink rate of LED in terms of milliseconds

                                                                                       *when connected to 3.0 port*/

                           

                          #define CY_FX_FULL_SPEED_EP_SIZE        (64)                /* Sets the end-point size to 64 bytes for full speed */

                          #define CY_FX_HIGH_SPEED_EP_SIZE        (512)                /* Sets the end-point size to 512 bytes for high speed */

                          #define CY_FX_SUPER_SPEED_EP_SIZE        (1024)                /* Sets the end-point size to 512 bytes for SuperSpeed */

                          #define CY_FX_DEBUG_PRIORITY            (4)                    /* Sets the debug print priority level */

                           

                          /* Extern definitions for the USB Descriptors */

                          extern const uint8_t CyFxUSB20DeviceDscr[];

                          extern const uint8_t CyFxUSB30DeviceDscr[];

                          extern const uint8_t CyFxUSBDeviceQualDscr[];

                          extern const uint8_t CyFxUSBFSConfigDscr[];

                          extern const uint8_t CyFxUSBHSConfigDscr[];

                          extern const uint8_t CyFxUSBBOSDscr[];

                          extern const uint8_t CyFxUSBSSConfigDscr[];

                          extern const uint8_t CyFxUSBStringLangIDDscr[];

                          extern const uint8_t CyFxUSBManufactureDscr[];

                          extern const uint8_t CyFxUSBProductDscr[];

                          extern const uint8_t CyFxUsbOSDscr[];

                           

                          #include <cyu3externcend.h>

                           

                          #endif /* _INCLUDED_CYFXBULKSRCSINK_H_ */

                           

                          /*[]*/

                          • 10. Re: Fx3 pulse generation shaking
                            aani

                            Hello Harshit Jain,

                             

                            --- Please go through below attached trigger pulse generation file. which speaks about Periodic Trigger pulse  with on time 18usec and PRF 10msec output generated on GPIO-50 of FX3.

                            --- The FX3 GPIO block will be running  with a fast clock at "SYS_CLK / 2"(196 MHz). the system clock running at 382 MHz.

                            1.Trigger pulse with on time 18usec.

                            TEK00004.PNG

                            2.Trigger pulse with time period 10ms.

                            TEK00005.PNG

                             

                            Regards,

                            Anil Srinivas

                            • 11. Re: Fx3 pulse generation shaking
                              HarshitJain

                              Sir, I have followed that file. That code I am using to generate a clock of 20MHz. In additional to clock, I am generating a trigger pulse and that trigger pulse is shaking. Clock is coming very smooth.

                              • 12. Re: Fx3 pulse generation shaking
                                HarshitJain

                                The clock that I am generating is free running and the trigger signal is generated after a certain event and stopped after a certain event.

                                • 13. Re: Fx3 pulse generation shaking
                                  aani

                                  Hi Harhit Jain,

                                   

                                  The code that i have attached generate a periodic trigger pulse of 100HZ.

                                  Please let me know,how many periodic signals do need?

                                   

                                  Regards,

                                  Anil Srinivas.