Announcement

Collapse
No announcement yet.

I2C and TC74

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ESPsupport
    replied


    while (I2C_AckStatus==0)

    Should be

    while (I2C_AckStatus()==0)

    Not sure if that will fix it though

    Leave a comment:


  • Orphee
    started a topic I2C and TC74

    I2C and TC74

    HelloI always have a problem with I2C, not all I2C functions, but just one with TC74. I tried many things but it doesn't workHere is my last code
    HTML Code:
    func ReadTemp(var Adress)
    
      I2C_Idle();  
      I2C_Start();
      I2C_Write(Adress); 
      while (I2C_AckStatus==0)
      wend
      I2C_Write(0);
      while (I2C_AckStatus==0)
      wend
      I2C_Start();
      I2C_Write(Adress+1); 
      while (I2C_AckStatus==0)
      wend
      Temperature:=I2C_Read(); 
      I2C_Nack(); 
      I2C_Stop();
    endfunc
    I have many others I2C parts (time, potentiometer, 3 PIC slaves). They seem to work perfectly. There is just a problem with "ReadTemp" function (here result always zero but, with some erratic values
Working...
X