How to control gpio in CYUSBS236

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

cross mob
Anli_4471876
Level 1
Level 1
First question asked First reply posted

We use CYUSBS236, both channels are configured to UART mode, CDC protocol, UART setting Type: 2 pin

J24 J25 J26 J27  pin 1 and pin 2 are connected.

The problem is: when I try to set GPIO_10-13 by CySetGpioValue(), it returns CY_ERROR_REQUEST_FAILED(0x6), while I set GPIO_1, it returns success.

The codes are sample codes in USB serial SDK.

I have the same issue when J24 J25 J26 J27  pin 4 and pin 2 are connected.

What can be done to fix the issue?

Thanks!

0 Likes
1 Solution

Hello,

Since you have configured the SCBs as UART under CDC mode they are not bound to cypress vendor driver i.e. cyusb3 driver.

I tested the application, we can access the GPIO (all unused) with any SCB number as an input. Its working fine outputting values on gpios 2,3,4,9,12,13,14,15 using the same application.

Please check on your side.

Best Regards,

Yatheesh

View solution in original post

0 Likes
7 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

Once the SCB 0 and SCB 1 are configured as UART in CDC mode. Please check the available unused GPIOs under CapSense/BCD/GPIO tab.

Please refer to the attached image which shows the unused GPIOs when SCB0 and SCB1 are configured to UART 2 pin mode.

pastedImage_0.png

Best Regards,

Yatheesh

0 Likes

Hi Yatheesh,

Thanks for your quick reply.

The unused GPIOs are 0 1 2 3 4 6 7 9 13 14 15. While only GPIO_1 13 15 could be controlled by sample code. All other GPIOs are always 0.

pastedImage_0.png

Best regards,

Andy

0 Likes

Hello Andy,

Can you please let me know which sample code you are using?

The GPIO are assigned to specific SCBs. If you are using the GPIO sample code then only the GPIOs which are assigned to SCB0 can be accessed. Please refer to CY7C65215 datasheet Table 16 and Table 17 to determine which GPIOs are assigned to SCB0 and SCB1.

Best Regards,

Yatheesh

0 Likes

Hi Yatheesh,

Thanks again for your reply.

Project: gpio under path C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialexample\

I install this code by USBSerialSDKSetup.exe (version: 6.00.2900.2180)

Regards,

Andy

0 Likes

Hello Andy,

Please check my previous response. It seems like you are accessing SCB1 while controlling the GPIOs. If you want to access the GPIOs under SCB0 please recall the functions "int deviceIndexAtSCB0 = FindDeviceAtSCB0()" and then "GPIOTasks(deviceIndexAtSCB0)"

Do let me know if you have any queries regarding this.

Best Regards,

Yatheesh

0 Likes

Hi Yatheesh,

USB Config:

pastedImage_0.png

I only get one device: MFG, neither SCB0, nor SCB1.

pastedImage_1.png

Console Output:

Number of interfaces: 1

                 Vid: 0x4B4

                Pid: 0x5

                Serial name is:

                Manufacturer name: Cypress Semiconductor

                Product Name: USB-Serial (Dual Channel)

                SCB Number: 0x2

                Device Type: 5

                Device Class: 255

Opening USB-Serial device with device number 0...

Output 0 on GPIO-14 configured as OUTPUT using Cypress USB-Serial Configuration Utility...

Read from on GPIO-14 configured as INPUT using Cypress USB-Serial Configuration Utility...

GPIO-14 Value is 0

Output 1 on GPIO-14 configured as OUTPUT using Cypress USB-Serial Configuration Utility...

Read from on GPIO-14 configured as INPUT using Cypress USB-Serial Configuration Utility...

GPIO-14 Value is 0

GPIOTasks returned success.

C:\Program Files (x86)\Cypress\USB-Serial SDK\examples\usbserialexample\Debug\gpio.exe (进程 1780)已退出,返回代码为: 0 。

若要在调试停止时自动关闭控制台,请启用“工具”->“选项”->“调试”->“调试停止时自动关闭控制台”。

按任意键关闭此窗口...

0 Likes

Hello,

Since you have configured the SCBs as UART under CDC mode they are not bound to cypress vendor driver i.e. cyusb3 driver.

I tested the application, we can access the GPIO (all unused) with any SCB number as an input. Its working fine outputting values on gpios 2,3,4,9,12,13,14,15 using the same application.

Please check on your side.

Best Regards,

Yatheesh

0 Likes