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

USB superspeed peripherals Forum Discussions

TePl_1066611
Level 3
Level 3
25 replies posted 10 replies posted 10 sign-ins

Hi All,

I'm trying to change the Pclock frequency according to the USB connection speed, but it doesn't seem to be easy. Basically, I want to automatically set the division value at 4 for USB3 connections and 24 for USB2 connections. Is this possible?

Thanks!

Terry

 

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello Terry,

The USB event CY_U3P_USB_EVENT_SETCONF will be received after a set configuration request is issued by the host to the device. At this point, we can understand if the connection is USB3 or USB2. So, when this request is received, call a function (appstart) which internally uses APIs for determining the speed of USB connection and then configures the PIB accordingly. If the GPIF II block is operating in slave mode, then the following steps can be used inside the function for meeting your requirements:

1. Use the API CyU3PUsbGetSpeed() to find the operating speed of USB connection.

2. Based on the speed, set the parameter clkDiv for the structure CyU3PPibClock_t.

3. Call the API CyU3PPibInit() for initializing the PIB. Please note that this should be the first P-port related function call and should be called before any GPIF related calls are made.

4. If the SET_CONF request is issued multiple times in your application, then the function appstop() should call the API CyU3PPibDeInit().

I have attached a modified version of SDK example project Gpiftousb which meets your requirements. Please use this as a reference for your custom project. If the GPIF II block needs to be operated in master mode, then the DLL parameters should also be configured in addition to those mentioned above. The following KBA can be used as a reference for configuring DLL :

https://community.cypress.com/t5/Knowledge-Base-Articles/Configuring-EZ-USB-FX3-GPIF-II-DLL-KBA21073...

Best Regards,
Jayakrishna

View solution in original post

0 Likes
1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello Terry,

The USB event CY_U3P_USB_EVENT_SETCONF will be received after a set configuration request is issued by the host to the device. At this point, we can understand if the connection is USB3 or USB2. So, when this request is received, call a function (appstart) which internally uses APIs for determining the speed of USB connection and then configures the PIB accordingly. If the GPIF II block is operating in slave mode, then the following steps can be used inside the function for meeting your requirements:

1. Use the API CyU3PUsbGetSpeed() to find the operating speed of USB connection.

2. Based on the speed, set the parameter clkDiv for the structure CyU3PPibClock_t.

3. Call the API CyU3PPibInit() for initializing the PIB. Please note that this should be the first P-port related function call and should be called before any GPIF related calls are made.

4. If the SET_CONF request is issued multiple times in your application, then the function appstop() should call the API CyU3PPibDeInit().

I have attached a modified version of SDK example project Gpiftousb which meets your requirements. Please use this as a reference for your custom project. If the GPIF II block needs to be operated in master mode, then the DLL parameters should also be configured in addition to those mentioned above. The following KBA can be used as a reference for configuring DLL :

https://community.cypress.com/t5/Knowledge-Base-Articles/Configuring-EZ-USB-FX3-GPIF-II-DLL-KBA21073...

Best Regards,
Jayakrishna
0 Likes