CyUSBSerial GPIO problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeCh_4514661
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

Hi

I want to use your CyUSBSerial SDK to send commands to TI DLP4710EVM-LC. The Cy7c65215 dual channels chip is configured as below by TI

---------------------------------------------------------------------------------

Device Number | VID | PID | INTERFACE NUMBER | FUNCTIONALITY

---------------------------------------------------------------------------------

0             |4b4  |a    | 0     | VENDOR_I2C

0             |4b4  |a    | 1     | VENDOR_SPI

0             |4b4  |a    | 2     | NA

---------------------------------------------------------------------------------

I add a few lines to set GPIO as below

         int deviceNum=0;

         int interfaceNum=0;

   

         CY_HANDLE s_Handle;

   

        rStatus = CyOpen (deviceNumber, interfaceNum, &s_Handle);

         if (rStatus != CY_SUCCESS){

               printf ("CY_I2C: Open failed \n");

         }

 

         uint8_t Value = 0;

         uint8_t gpioNumber =5;

         

         rStatus = CySetGpioValue(s_Handle, gpioNumber, 1);

         if (rStatus != CY_SUCCESS) {

                   printf ("CY:Error in setting GPIO 5 to 1 : Error NO:<%d> \n", rStatus);

         }else{

                   printf("Succeed in setting GPIO 5 to 1 \n");

         }

         

          

         rStatus = CyGetGpioValue(s_Handle, gpioNumber, Value);

         if (rStatus != CY_SUCCESS) {

                   printf ("CY:Error in getting GPIO 5 : Error NO:<%d> \n", rStatus);

          }else{

                   printf ("GPIO value?:<%d> \n", Value); 

          }

       

        CyLibraryExit ();

        free (glDevice);

        CyClose (&s_Handle);

I got result as below

CY:Error in setting GPIO 5 to 1 : Error NO:<6>

CY:Error in getting GPIO 5 : Error NO:<6>

Can any one give a help? Thanks!

Derlin

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi Derlin,

Can you run USBSerialConfigurationUtility.exe which is in the below path of USB Serial SDK and check if GPIO5 is listed in unused GPIOs section.

C:\Program Files (x86)\Cypress\USB-Serial SDK\bin

You can refer to C:\Program Files (x86)\Cypress\USB-Serial SDK\documentation\Cypress USB-Serial Configuration Utility User Guide.pdf to know where to find the unused GPIO section.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
3 Replies
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi Derlin,

Can you run USBSerialConfigurationUtility.exe which is in the below path of USB Serial SDK and check if GPIO5 is listed in unused GPIOs section.

C:\Program Files (x86)\Cypress\USB-Serial SDK\bin

You can refer to C:\Program Files (x86)\Cypress\USB-Serial SDK\documentation\Cypress USB-Serial Configuration Utility User Guide.pdf to know where to find the unused GPIO section.

Regards,

Hemanth

Hemanth
0 Likes

Hello Hemanth,

I bought a Cypress DVK board, configured it to I2C and SPI, set GPIO 5 to active 0 and tested it with code above. It did not succeed at the beginning, but then suddenly it works. Don't know why.

Thanks!

Derlin  

0 Likes

Hello,

The GPIOs should be left unused (by the other SCBs) and should be configured as outputs using the USB-Serial configuration utility for the pins to work (drive high or low).

Best Regards,

Yatheesh

0 Likes