4 Replies Latest reply on Jun 5, 2012 10:49 AM by user_62720120

    EZ I2C not working

    user_62720120

       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

        • 1. Re: EZ I2C not working
          user_14586677

          The following TRM notes affect what you are doing ?

             

           

             

          Regards, Dana.

          • 2. Re: EZ I2C not working
            user_62720120

             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

            • 3. Re: EZ I2C not working
              user_78878863

              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)

              • 4. Re: EZ I2C not working
                user_62720120

                 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