I have read through some of the posts on I2C problems, but not sure mine is due to resistor values as I have swopped it out with just about everything you can find between 4.7k and 10k
I have build several of these devices before, so also pretty sure the PCB design is not the problem. There is one difference between the previous and latests design and that is that I simply removed the I2C Multiplexer as we now only have 3 x I2C populated on the board for this particular project, so they are now connected directly to the µC SDA/SCL pins with a PU on each.
I used the code below to scan for I2C devices, my coding skills are terrible, but found this scanner in the forum and just replaced Serial.print with Particle.publish.
// Simple Scanner ///////////////
#include "application.h"
void setup()
{
Wire.begin();
Serial.begin(115200);
while (!Serial) Particle.process();
Particle.publish("I2C Scanner", PRIVATE);
}
void loop()
{
byte error, address; //variable for error and I2C address
int nDevices;
Particle.publish("Scanning", PRIVATE);
nDevices = 0;
for (address = 1; address < 127; address++ )
delay(10);
{
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Particle.publish("I2C device found at address 0x", PRIVATE);
if (address < 16)
Particle.publish("0", PRIVATE);
Particle.publish("Found I2C 0x" + String(address,HEX), PRIVATE);
nDevices++;
}
else if (error == 4)
{
Particle.publish("Unknown error at address 0x", PRIVATE);
if (address < 16)
Particle.publish("0", PRIVATE);
Particle.publish("Found I2C 0x" + String(address,HEX), PRIVATE);
}
}
if (nDevices == 0)
Particle.publish("No I2C devices found", PRIVATE);
else
Particle.publish("done", PRIVATE);
delay(5000);
}
The devices are ABRACON 1805 RTC and MAX17055 fuel gauge. Reflow seem absolutely fine, actually one of best to date, no bridges at all
Do you mean you have three sets of pull-ups (6 resistors in total)?
If so, that's not right since you'd then have the pull-ups in parallel giving you only a third of the individual values.
Other than that we don't have enough info to advise better.
How exactly are your signal lines wired?
What level are you pulling up to?
Have you checked the continuity of your signal lines between sensors and µC?
Have you checked the voltage levels on the signal lines (either end)?
Can you get a oscilloscope/logic analyzer trace of your signal lines?
Do you get anyParticle.publish() event - if so what exactly?
Also, if you haven't got a Serial client connected, this line might pose an issue as it may keep the code flow stuck at that line
I can send you the board file if need, but will not be able to in Forum due to NDA. Aside from that, All SCL lines meet prior to PU and from there connect to SCL pin on µC. Same with SDA lines.
3.3V
Yes I have... working fine. Sorry, should have included this in initial post.
No, will do that now. I removed all other I2C components, only have he AB1805 populated now. I thought maybe one component was placed incorrectly (Ambient sensor with worst possible PIN1 indicator) but seems not to be the problem
Unfortunately I do not have either one. Maybe one day when I am all grown up
Hhmm… Sorry, I should learn to be more thorough in explaining, I just went according to the pin name on our initial schematic design. The actual voltage supplied by the regulator is 3.75V which means the AB1805 is getting supply voltage of 3.75 Also, there are two other I2C devices, one which is 5V tolerant and neither one of them seems to be working
We have been powering these devices like this for the past year or so, the only change was now removing the Multiplexer, connecting all I2C lines directly to the µC.
Solved by removing the external pull-ups altogether. Scanner code posted is for some reason not working. Serial scanner detected I2C after external pull-ups were removed.
You can only publish once per second on average. You’re far exceeding that if you have more than once I2C device. If you exceed the limit, the events may be discarded.
For an I2C scanner, it’s best to scan the whole bus and publish the results as a single string if you want to publish it, but usually it’s easier to just use USB debug serial.
Thank you for the feedback. I know I am terrible at coding. Will see whether I can fix it, will maybe include delay(1000);. in the IF statement
Just on that note, at the time of writing the post, I had only the AB1805 populated; I removed the other two devices, so if I understand correctly then this should not have been a problem. This was however before the external PU’s were removed.
Are you using bare AB1805s or some sort of breakout?
If the sensor (breakout) comes with its own set of pull-ups you may run into the same issue as mentioned above (parallel resistances reduce the total).
Bare components, no breakout boards. After removing the PU’s on the I2C lines, it seems to be working just fine. I populated more components, serial scanner is now detecting all of them. I am working on my other scanner that publishes to the cloud, got it working as well, just the string needs formatting. Trying to figure that out.
This scanner publishes to Particle Cloud as apposed to printing to serial monitor. It is just basic scanner to see whether all I2C components are detected before handing the hardware to the real programmers