EZ I2C not working

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

cross mob
lock attach
Attachments are accessible only for community members.
HuEl_264296
Level 5
Level 5
First like given 25 sign-ins First solution authored

 Hi,

   

I am trying to use the EZ I2C Slave component on a CY8C3666 to emulate an I2C EEPROM in my project. However, it is not working.

   

 

   

The symptoms I see is that the master does a Start bit, then 8 clocks, but the 9th clock for the AK bit is missing. Perhaps it's being held low for clock stretching? I don't know, it's hard to tell.

   

 

   

So I tried the following:

   

* The EZ I2C example project on my CY8C3666 project board. This works fine.

   

* The EZ I2C example project on my CY8C5566 dev board. This works fine.

   

* Wiring the I2C Master into the dev board. This works fine.

   

 

   

So I'm sure that all of the components work individually. The only thing I can think that's wrong is the set up of my project; the configuration of the EZI2C component or the code. I have checked my code against the example project, and it looks OK. Also, I am using the I2C0 pins 3 & 4 in all cases.

   

 

   

The only difference I can see between my project and the example project is the EZI2C config window. In the example project, the Pin Connections option is greyed out, even though everything else looks the same. Nothing I do seems to be able to un-grey this option.

   

 

   

Is there anything I could be missing?

   

 

   

Hugo

0 Likes
4 Replies
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The following TRM notes affect what you are doing ?

   

 

   

Regards, Dana.

0 Likes
HuEl_264296
Level 5
Level 5
First like given 25 sign-ins First solution authored

 Hi Dana,

   

 

   

I don't think this helps. There's no way to tell if the PSoC is actually clock stretching because there's no way to tell who's pulling the clock line low.

   

 

   

What I would like to know is why are some options greyed out in the config window in one project, but available in the other project?

   

 

   

Hugo

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

I think this is because 'wakeup from sleep' is not supported for your PSoC5 device (only with the upcoming PSoC5 LP), and the 'PinConnection' are only needed for this. (Look at the data sheet for an explanation of these 2 options).

   

(But if I'm right with that, the 'wakeup from sleep' checkbox should be enabled on the PSoC3 device, which it isn't. But this could also be because your I2C pins are not connected to the right pins)

0 Likes
HuEl_264296
Level 5
Level 5
First like given 25 sign-ins First solution authored

 Thanks Hli,

   

 

   

That's helpful. 

   

 

   

I finally discovered the real reason it was working with the PSoC5 and not the PSoC3. Speed.

   

 

   

1) The PSoC5 defaults for a 48MHz main clock, while the PSoC3 is 24MHz.

   

2) Selecting 150kbps speed for the I2C was not enough, even though the I2C clocks at exactly this speed. I had to set it to 300kbps.

   

 

   

Many thanks for your time.

   

 

   

Hugo

0 Likes