I2C Clock Stretching

15 thoughts on “I2C Clock Stretching

  1. Dear support,

    I have been trying to interface my Telit GE863-PY module to Cypress PSoC via I2C.  I have successfully  wrote some data with the function IIC.readwrite().  However, during the read of the data, Telit module (as the master) appends a stop condition just after the ack of the address  byte + read bit (I am monitoring all the data flow with a logic analyzer). 

    According to my readings about I2C interface, I am suspicious that PSoC cannot place the data on SDA line very quickly.  If Telit I2C implementation has no support for clock stretching, then it is normal that I see a stop condition just after the address ack, but I am not sure about that.  Any idea to overcome this issue?

    I also tried all the old functions, they didn’t help either.

    Kind Regards,

     

    Erol 

      1. you could try IIC related AT commands, but pay attention to the address device coding is different respect to Python. Any way the telit module doesn’t support clock stretching.

        Please send a snapshot of the logic analyzer and the piece of code managing the operations

        1. Dear Luca,

          I am sending you many snapshots of the analyzer. It contains both working ones (that I have tried with PSoC development kit) and non-working ones (with Python IIC).

          Thanks for your help & Best Regards,

           

          Erol 

          1. Hi Erol,

             

            which kind  of microprocessor is in your Cypress PSoC

             

            CY7C60323-LTXC

             CY7C60333-LTXC
            CY7C60323-PVXC

             

            ?

             

            BR

            Luca

             

          2. Hi Luca,

            It  is CY8C29466-PXI. I am using the sample echo program of the datasheet and for testing purposes, I use Cypress Bridge Control Panel to generate I2C commands to test that slave code is OK.  I can also send you my PSoC project in case you need.

            Best,

             

            Erol 

          3. Hi Luca,

            Thanks for the reply.  I tried the code you sent and some other variations based on your code.  However, it didn’t work unfortunately.  When we pass the default device address for the creation of I2C bus, Telit writes the buffer with success (PSoC just does not care about the register address, it behaves as if it is ordinary data).  And for the read command, Telit does not generate a read command, it continues to write to the bus some random (I guess) data.

            I am attaching the logic analyzer results for your interest. The script is the one that you sent me.  

            If you have some other idea, please share it with me and I will try it as soon as possible and send you the results.

            Kind Regards,

             

            Erol 

          4. Hi Erol,

            we will analyze your files.

            In the meantime we have requested a CY8C29466-24PXI processor.

            Have you tried with the AT commands but taking care about the different way to write the device address (read the Note in the AT command reference guide) respect to the I2C or Python?

             

            KR

            Luca

          5. Hi Luca,

            Thanks for your great support. I am trying the Telit SPI library with the same PSoC in the meantime.  It seems that I will have to create a new thread for that 🙂

            After SPI trials I will get back to I2C and keep you updated with AT commands for I2C. 

            Best,

             

            Erol 

          6. Hi Erol,

            we will analyze your files.

            In the meantime we have requested a CY8C29466-24PXI processor.

            Have you tried with the AT commands but taking care about the different way to write the device address (read the Note in the AT command reference guide) respect to the I2C or Python?

             

            KR

            Luca

      2. Dear Nikolay,

        Thanks for your advice. I had already tried but I wasn’t able to address the device, then. I will try again and post in case of success. 

        Best Regards,

         

        Erol 

  2. Hi Luca,

    I tried the command:

    AT#I2CWR=7,6,3,0,3 and entered 3 bytes of data as

    >452565

    followed by a Ctrl-Z. I already executed the SELINT command and set it to 2.

    But I receive an CME Error 3 as:

    CME Error: Operation not allowed 

     

    Do I need to do something else except from these commands?

    Thanks in advance,

     

    PS: I am running the commands from Hyperterminal for testing purpose, not from Python engine.

     

    Erol