Teensy 4.1 I2C not reading slave device

Status
Not open for further replies.

pantryThief

New member
The project:
I'm trying to get readings from a very sensitive tri-axial magnetometer, which requires that I use a high precision ADC. I've selected the MCP3424 (4 input, differential 18 bit) ADC for this purpose, and it uses I2C to communicate the digital signal back to the microcontroller. The board is a Teensy 4.1.

The problem:
Whenever I connect the teensy to the adc and give them power, the teensy invariably cannot receive data from the ADC. I have tried using the Wire library "scanner" example, as well as several example files from a specific MCP3424 library.

Troubleshooting:
1. Devices respond when an arduino is swapped for the teensy
2. All wires are in the correct positions, and connections have been double ultra mega triple checked with a multimeter
3. Using the "Scanner" example from the "wire" library does not return any results on teensy, but the same wiring configuration returns an address on Arduino (tested on 3x individual MCP3424 chips)
4. I am using pins 19 and 18 for the I2C connection, and have tried swapping them d o z e n s of times to make sure sure I haven't accidentally got the wires wrong.
5. Have also tried pins 17 and 16 with wire1(), which fail to produce results.


I'm at my wits end. The teensy is new, and I've checked my soldering. Blink program runs correctly. I swear I got these ADCs working on an old teensy 4.1 that I've since fried, but I can't remember what I did to make it run.
 
It sounds like you need pull-up resistors. These are a pair of resistors, one that connects pin 18 to 3.3v, and the other that connects pin 19 to 3.3v. Many I2C devices include pull-up resistors, but not all do. Typically in a 3.3v system, you want to use 2.2K resistors, but you can use higher values (4.7K is typically used for 5v systems, and I believe you can go up to 10K). Note, if you use higher resistor values (or have multiple resistors on the I2C bus), it can means that you won't be able to do the highest I2C speeds.

If the scanner doesn't work, then that means your wiring is not correct.

I assume you've connected the ground and 3.3v wires from the Teensy to the appropriate ground and VIN wires on the device. But just in case, make sure they are connected.

Make sure you don't have a solder bridge that connects pin 18 to pin 19 on your board.

You might want to check the datasheet for your device. There have been 5v I2C devices in the past that would not run on 3.3v systems. Note, if your device runs the I2C bus at 5v, you will likely need to do level shifting to switch from Teensy's 3.3v system to 5v. Otherwise you might damage the Teensy.
 
Thank you for the response!

An image of my setup

The ADCs operate between 3.3 and 5v, I can't see a solder bridge on the teensy. Have added the pullup resistors (6.8k was all I had, but I should be seeing something right?)

Still no dice :(

EDIT: might add that I've specifically checked the SDA/SCL pins with a multimeter for a short.
 
Hello,

from your image it seems you made a mistake with your wires.
You have connected +5V from your ADC to GND of the breadboard instead to 3.3V.
 
Good eye! I moved some stuff around when I added the pull up resistors and must have missed that.

Sadly didn't fix the issue.
 
Looks like you have resistor connected to c2- on the ADC, no resistor connected to SDA.

Cable connections on the ADC are to C2- and SDA. You could have shifted the connections up/down one.

The resistors look like 680 Ohms or 220 Ohms. Difficult to see which way to read them.

Can't see if there is a resistor connected to SCL on the ADC.

C3+ on the ADC is connected to GND.
 
Thanks for the response!

The perspective appears to be a bit skewed around the edges sorry, those connections are actually in the correct places.

Resistors are 6.8K, which is a little high, and might reduce the speed of transmission but should still elicit a response.
 
Status
Not open for further replies.
Back
Top