Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: Interfacing AD5933 with teensy3.2, I2C issue

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    17

    Interfacing AD5933 with teensy3.2, I2C issue

    hello every one,
    I am using teensy3.2 i want to interface teensy3.2 with AD5933, but when i used basic scanner example of i2c_t3-master.h library, the AD5933 is not responding, i am using 5V, 4.7kohm pullup resistor and 18 SDA0 ,19SCL0 pins, AD5933 is working because when i interfaced this IC with arduino using wire.h library its responding, do you have any idea why its not working, please share your valuable experience, i will be grateful to you.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    First, the Teensy is a 3.3V system, so power the chip with 3.3V, too. Second, connect 3k3 resistors as pullups to 3.3v.

  3. #3
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    now i am using 3.3k ohm resistor with 3.3v but its still not responding.



    Code:
    #include "i2c_t3.h"
    
    
    void setup()
    {
      Wire.begin();
    
      Serial.begin(115200);
    Wire.begin(I2C_MASTER,0x00,I2C_PINS_18_19, I2C_PULLUP_EXT, 400000);
      while (!Serial);            
      Serial.println("\nI2C Scanner");
    }
    
    
    void loop()
    {
      byte error, address;
      int nDevices;
    
      Serial.println("Scanning...");
    
      nDevices = 0;
      for(address = 1; address < 127; address++ ) 
      {
        // The i2c_scanner uses the return value of
        // the Write.endTransmisstion to see if
        // a device did acknowledge to the address.
        Wire.beginTransmission(address);
        error = Wire.endTransmission();
    
        if (error == 0)
        {
          Serial.print("I2C device found at address 0x");
          if (address<16) 
            Serial.print("0");
          Serial.print(address,HEX);
          Serial.println("  !");
    
          nDevices++;
        }
        else if (error==4) 
        {
          Serial.print("Unknown error at address 0x");
          if (address<16) 
            Serial.print("0");
          Serial.println(address,HEX);
        }    
      }
      if (nDevices == 0)
        Serial.println("No I2C devices found\n");
      else
        Serial.println("done\n");
    
      delay(5000);           // wait 5 seconds for next scan
    }

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Is this the unmodified Scanner code? If yes there is still a a hardware problem. Or try 100KHz first.

  5. #5
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    this code is modified but i am using i2c_t3.h library for teensy3.2 i have already try 100kHZ but its not working...
    Is this code is correct for teensy3.2??

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,674
    Try using File > Examples > Wire > Scanner. That one definitely does work. I used it just yesterday!

    If the scanner doesn't find your chip, maybe you have some sort of hardware problem? We might be able to help see if, if you show photos.

    Some rare chips, like SGTL5000, do not respond until they receive a clock or reset pulse or some other way to turn them on.

  7. #7
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    Now i am using wire library but its still not working ,i have connected this IC with arduino using wire library its works, but when i connect teensy3.2 it does not responding, and on SCL pin i saw only 3.3v DC signal. I am unable to upload picture because whenever i try to upload the photo, after uploading i get this message every time "forum.pjrc.com says upload of file failed" and my picture type is "JPEG" or "PNG".

  8. #8
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    Click image for larger version. 

Name:	image.jpg 
Views:	31 
Size:	116.2 KB 
ID:	16275 it's circuit photo.

  9. #9
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    This photo creates more questions than it solves..
    -Where is 3v3 connected?
    -What's the red wire near USB?
    -Are there pins soldered in the row where VBAT is?
    -On the blue board with the chip I can see 3x 3.3V 3x GND, and I2C - Where is the output of the chip ?
    - Is it correct that GND is connected to the red marked line on the breadboard, and 3.3V to blue?
    - Have you checked if SDA and SCL are swapped?
    - Can you post a link to the blue board, or post a schematic?

  10. #10
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    I don't see capacitors on the blue board - are there any?
    Why are Pin 18 and 19 not soldered? From the photo, it looks like they are not.
    I can't see this exactly on the photo... are you sure you use 18/19 and not 17/18?

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,674
    Want to help figure out what's wrong, but indeed this photo is not good. Can't really see how the wires plug into the breadboard. Those paper labels were probably meant to help, but they block the view.

  12. #12
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    First of all thank you so much for your kind response.i hope this image will clear all the ambiguities .I have connected my teensy3.2 with AD5933 IC , showed in the picture. The link below is AD5933 IC datasheet. I am just scanning my IC(AD5933) using wire library,scanner example.

    Click image for larger version. 

Name:	Image.jpg 
Views:	21 
Size:	29.5 KB 
ID:	16278



    Link: https://www.analog.com/media/en/tech...ets/AD5933.pdf

  13. #13
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    Click image for larger version. 

Name:	image1.jpg 
Views:	16 
Size:	97.7 KB 
ID:	16291

    Please suggest me any expert opinion...

  14. #14
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    Maybe answer some of the questions above. The schematic is not helpful, it's just standard. The datasheet says you need some capacitors - it may work without, but not reliable so I'd add them. For I2C more likely there is something wrong with the physical connections (questions above). Can you post a better photo - a close up of the teensy on the breadboard with all connections and Tell us what this blue board is.

  15. #15
    Junior Member
    Join Date
    Feb 2019
    Posts
    17
    Thank you Gays, It Worked. You were right Frank, the problem was with physical connections. I refresh the teensy headers and it worked... I used wire library.....
    Thank you Frank B, PaulStoffregen...Thanks a lot for your response and time...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •