I2C on P1 Working

Just checking in to see if anyone has tested the I2C on the P1 yet? I have a MMA7660 accelerometer connected and the code worked with the photon and core. But I am not getting any response from the accl. when connected to the P1.

I have 2.2K pull-up on the lines.

@peekay123, do you know of anyway to test or confirm I2C is working? Last night I was using a scope but all i got was the pull-up voltage. I confimed I had the right settings by connecting a proto MMA7660 board to a photon and was able to measure the 100K clock freq. on that setup.

@wesner0019, some I2C issues were fixed on the latest release but only if you compile locally. I don’t believe 0.4.3 is released to the IDE yet.

@peekay123, I locally flashed my p1 with 0.4.3 yesterday. Is there anyway to confirm this by asking the P1 in some way?

@wesner0019, the I2C issue related to how the Photon behaved when the I2C bus had no slave.

So can you see the request going to the MMA7760? I have an INA219 breakout working on a Core and I can test with a Photon tonight. If that works then it may be the MMA7760 library needs some timing adjusted.

@peekay123, I was not able to see the request (although I’m quite new to using scopes). I have the MMA7660 working with a photon just not on the P1.

So you are thinking there might be a timing issue between the photon and the P1?

@wesner0019, the Photon and I2C need to be tested. Since I have a working Core setup, I can work on the Photon version easily. I also have a good scope and logic analyser if necessary. I don’t believe (like in the original Core) that a lot of time has been devoted to really testing the I2C yet so this will help. :smile:

1 Like

@peekay123, that would be awesome, any help is needed, right now my project is stuck on this accelerometer.

I’m right now just trying to figure out if its software related or my board/soldering connections. I’ve tested my board to make sure everything is connected correctly and no shorts are happening. I couldn’t find anything wrong with the layout or connections and this same setup worked with core.

Since the P1 pins are not exposed, testing is tricky.

@wesner0019, I did some initial testing last night and going from Core to Photon, the I2C would not work on the Photon. Tonight I’ll be hooking up a logic analyzer to see what is happening.

@peekay123, Funny thing is, when using the below code on my base photon (default firmware) the I2C worked and I was able to read the accelerometer. But using this same code with the P1 @ ver 0.4.3 it doesn’t work. Just giving you some info that I gathered.

1 Like

I’ve gotten I2C working on the Photon compiling via web IDE and locally on 0.4.3.

P1 doesn’t seem to work via web IDE. My local builds don’t work for P1 so I can’t test that.

@jakeypoo, which I2C device were use using?

I’m using a TotalPhase Aardvark as a Slave (photon as master)

Just running a simple demo to confirm I can read and write a couple of bytes.

@peekay123, did you have a chance last night to look at the I2C on your analyzer?

It turns out that what I thought was an I2C problem was actually the sprintf floating point issue discussed in another topic. The I2C was actually working using 0.4.3rc2

@peekay123, are you able to test this on a P1 by chance?

@wesner0019, I haven’t received my P1’s yet. How are you testing these - on a PCB?

@peekay123, I have these mounted to my custom pcb right now.

It would be awesome if particle provided a breakout board with the basics such as a LDO for power and USB connection and all necessary capacitors for testing, even if SMD soldering is required for the P1. Probably not a huge demand for it though.

Just wanted to confirm that I have basic I2C functionality working with a P1 as well as a Photon here.

I got the P1 working using the release/0.4.3 branch of the firmware repo.

@jakeypoo, Thanks, now I’m really lost, ill have to check my connections again, all though under the P1 is a bit of an issue.

Anyone have a Xray machine? LOL.

A I2C adapter is wonderful when debugging this kind of stuff.
Otherwise if you have an arduino or a core, set it up as a I2C Slave and dump debug info to UART.

Soldering the P1s is a bit of a mystery. So far I have 1 that seems to work, 1 with a bad joint on the JTAG lines, and one with a short between 3v3 and gnd under the module. Back in the oven they go!