6 Replies Latest reply on Jun 23, 2010 2:09 AM by robert.seczkowski

    ezI2c module in CY8c24994

    robert.seczkowski

      I have used sucessfully miniprog3 for I2C data exchange with PC as Master.

         

      BUt when it came to PSOC1 The miniprog3 reads or writes wrong data!

         

      for example :

         

      write 04 01 (addres 4 first byte of 1) is sucessfully acknowledged up to 0B (data) (w 04+ 01+ p) and (w 04+ 0C- p)

         

      write 04 0C up to FF doesn't get acknowledged

         

      speed 100k on both sides, no external pullups resitors(as it was not required with psoc 3)

         

      What is wrong?

         

      I played with P10 and P11 pin configuration from res-pullup to open-drain-low but no success

        • 1. Re: ezI2c module in CY8c24994
          robert.seczkowski

          One mor thing:

             

          although I have only one device connected The miniprog shows the list of  devices(for me it looks to be two of them):

             

          Devices list:  8bit  7bit
               address:  08    04

             

          following is funny thing

             

          w 08- 01- p
          s 08+ 01+ p
          r 04+ 0F+ 0F+ 0F+ 01+ 00+ 00+ 00+ p
          s 08+ 01+ p
          r 04+ 0F+ 0F+ 0F+ 01+ 00+ 00+ 00+ p
          w 04+ 08+ 01- p
           

          • 2. Re: ezI2c module in CY8c24994
            robert.seczkowski

            another issue:

               

            miniprog3 shows 3920mV against measured on VTARG pin 4820mV

               

            Why is that?

            • 3. Re: ezI2c module in CY8c24994
              robert.seczkowski

              There is no communication either in 50K speed not 400k speed

              • 4. Re: ezI2c module in CY8c24994
                ganesh.raaja.maharajan

                The first problem that you have described (where 0x0C to 0xFF are not acknowledged) is strange.  I am not able to comment on this without having a look at the PSoC1 project.

                   

                Regarding the address:
                The 7 bit address is the address value without the Read / Write bit.  This is the address that you would have set in the I2C user module parameter in the PSoC1 project.  When a Master wants to read or write to the I2C slave, it left shifts the 7 bit address by one bit and adds the Read / Write bit.  A 0 in the R/W bit means a write operation and a "1" means read operation.  So, when Master wants to write to the slave, it will use address 0x08 and to read 0x09.

                   

                Now coming to the "w" and "s" commands.  The "w" command is a write command where you pass the 7 bit address.  The bridge application will left shift the address add the R/W bit and send to the slave.  So, when you use 0x04 in the "w" command, the slave will respond.  When you use "0x08" in the "w" command, the Master will actuall be sending "0x10" as the address and hence the slave will not respond.

                   

                The "s" command is to generate a start condition and hence has to be followed by the 8 bit address.  So, if you want to write to the slave, you will use "s 0x08" followed by the data.  This is why you see the slave "ACK" the 0x08 address when "s" command is used.

                   

                The "r" command is similar to "w" command, where you provide the 7 bit address and hence the "r" command with 0x04 is working fine.

                   

                Best Regards,
                Ganesh

                • 5. Re: ezI2c module in CY8c24994
                  robert.seczkowski

                  Thanks for Your feedback. It clarifies addressing issue.

                     

                  But still I'm not able to understand why:

                     

                  w 04+ 02+ p
                  w 04+ 0A+ p
                  w 04+ 0C- p
                   

                     

                  The only explanation seems to me as a chip failure (PC, miniprog3,cables are the same as with PSOC3).

                     

                  Above communication is only related to psoc1 hardware . The is no software API which can interfere with above comunication

                     

                  EzI2C_GetActivity() returns 1 at the end of W 04 0C p I guess not after every byte (I hope)

                     

                  Regards

                     

                  Robert

                  • 6. Re: ezI2c module in CY8c24994
                    robert.seczkowski

                    The issue seems to be solved.

                       

                    The innocent line seems to be the cause:

                       

                    E2PROM_E2Read(255,(unsigned char*)&configData,64);

                       

                    255 is offset from preconfig value and normally should be set to 0;

                       

                    If not things like above happen

                       

                    regards

                       

                    robert