PSOC 4200 I2C Raspberry Pi 2 doesn't work for 5V

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

cross mob
RoJa_1564316
Level 1
Level 1

Hello,

   

I try to connect an PSOC 4200 ( CY8CKIT-049-42XX) as slave via I2C to an Raspberry Pi 2 as master.

   

With 3.3V on 4200 from Raspberry, all works fine, with 5V over USB on kit nothing happens on SDA and SCL.

   

SDA is stays at 3.3V, but SCL is about 5V ? No signal to see on scope or LA.

   

I thought I2C should work with both voltages on one line.

   

 

   

Where do 5V come from ? 4200 I2C lines should open drain high side or ?

   

Then 5V can only come over high impedance, whereas Raspberry has 1.8K to 3.3V,

   

which should result in about 3.3V ?

   

What is the high threshold of both lines in this mode ? I find different CMOS and LVTTL in datasheet.

0 Likes
8 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Where did you connect the pull-up-resistors? To the power rail of the PSoC, or to the power rail of the RasPi? Note that the RasPi is, AFAIK, not capable of handling 5V on its inputs!

   

Did you configure the pins of the PSoC to be open drain?

0 Likes

Raspi has fixed on board 1.8K resistors connected to 3.3V.

   

So as I am using PSoC 4 Serial Communication Block (SCB) in I2C mode, SDA and SCL should work open drain to high, as specified for standard I2C. So 4200 SDA and SCL output impedance should very high, when off or very low to GND if on. So resistors on Raspi board should draw to 3.3V if 4200 is off,  When on, 4200 should draw pins to near 0V.

   

5V VDD from 4200 should have no impact at all for open drain to high.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Maybe your code activates the internal pullup-resistors?

   

( via SCB_scl_SetDriveMode(SCB_scl_DM_RES_UP); )

0 Likes

No, I use (SCB) 3.0 right from component catalog, selected I2C and changed only address to mine and rate to 100kHz, which work fine for 3.3V. In software I do nothing than setting buffers and wait for arrival of message from master ( Raspi ).

   

I disconnected Raspi and measured SCL  pin 4.0 on 4200 connected over 20k tied to GND and found 4,8V with USB power to kit ???

   

I would have guessed that it should be much lower for an I2C slave SCL pin.

   

Again, all works fine with 3.3V from Raspi, but I would like to use 5V for 4200, which should be compatible, as for example https://learn.sparkfun.com/tutorials/i2c

   

In any case, Raspi should be able to drive SCL, but this seems not to be possible, as SCB I2C ties SCL pin over low resistance to 5V.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Hmm, maybe try to use the above API to set the drive mode to open collector then. (I thought this is the default, but maybe I'm wrong). Otherwise you can open a support case with Cypress (top right menu, 'MyCases').

0 Likes

@hli: thank you for your help. I finally got to work with 5V coming from Raspi. But still doesn't work with 5V over USB to the kit. Until now I have no idea why this doesn't work also. But so far so good.

0 Likes
Anonymous
Not applicable

The reason port 4.0 and 4.1 don't work for I2C on the  CY8CKIT-049-42XX is that they are used as an SCB block for programming the chip. Instead use  port 04. and 0.5, or port 3.0 and 3.1 . If the USB is unplugged then as you noted above port 4.0 and 4.1 will work.

0 Likes
GuNo_288966
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

When you need the PSoC4 to run at 3.3V, you can remove R6 from the board. This separates the VDD voltages of both parts of the board. Then the USB bridge part is powered with 5V over USB, the PSoC4 part can be powered by another source.

0 Likes