Using the CYUSBS236 as an I2C slave

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

cross mob
Frck
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hello,

we want to use the CYUSBS236 as a I2C/USB bridge for our linux distribution system. We want to switch between master and slave mode. For this we use your driver. Master mode is working quite well, but when we try to switch to slave mode, the setted slave adress is not visible on the bus (this also happens, when we try it via the USB Serial Configuration Utility).

It also seems that the driver only supports Master Mode (in the i2c write function the output value always addresses a slave).

Is the current version of the driver of the CYUSB236 able to perform as slave? Do you have example code for a linux distribution with your Driver?

0 Likes
1 Solution
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi, 

Yes, the  driver of the CYUSB236 is able to perform as slave. Currently we do not have any example project demonstrating I2C slave functionality. 

Can you please let me know how are you configuring the device?

 

However, let me clarify few points using our device as I2C slave.

1. If your requirement is to perform I2C slave read, then you have to follow below steps:

  1. Call CyI2cRead() with specific time out parameter (let's say 5 sec).
  2. Then initiate I2C Master write within the time out mentioned in step-1.

2. If your requirement is to perform I2C slave write, then you have to follow below steps:

  1. Call CyI2cWrite() with specific time out parameter (let's say 5 sec).
  2. Then initiate I2C Master read within the time out (5 sec) mentioned in step-1.

 Regards

View solution in original post

0 Likes
4 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

Please confirm if you have followed steps (USB Serial Configuration Utility) in section 3.3.4 of this document https://www.cypress.com/file/123476/download and if that works

Regards,
Rashi
0 Likes
Frck
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hello,

we followed the whole guideline multiple times, but it only worked for master mode and not for slave mode. As i said before in slave mode the slave adress is not visible on the bus.

0 Likes
Frck
Level 1
Level 1
5 sign-ins First reply posted First question asked

Frck_0-1637596936891.png

So does the driver really support slave mode? It's a little bit irritating that the read/write function always sends a slave address. (as you can see in the Screenshot the slaveadress is Part of wValue). The data handling also leaves questions open if slave mode is really supported, as there does not seem to be an event handler. How is the write function in slave mode used, if there hasn't been a notification about a request from the master?

0 Likes
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi, 

Yes, the  driver of the CYUSB236 is able to perform as slave. Currently we do not have any example project demonstrating I2C slave functionality. 

Can you please let me know how are you configuring the device?

 

However, let me clarify few points using our device as I2C slave.

1. If your requirement is to perform I2C slave read, then you have to follow below steps:

  1. Call CyI2cRead() with specific time out parameter (let's say 5 sec).
  2. Then initiate I2C Master write within the time out mentioned in step-1.

2. If your requirement is to perform I2C slave write, then you have to follow below steps:

  1. Call CyI2cWrite() with specific time out parameter (let's say 5 sec).
  2. Then initiate I2C Master read within the time out (5 sec) mentioned in step-1.

 Regards

0 Likes