I2C not working in 2.7.4

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

I2C not working in 2.7.4

Post by SeeCwriter »

When I compile an existing project with v2.7.4, I2C quits working on my Nano. There is no activity on clock or data.

Code: Select all

I2CInit();
I2CReadBuf( AD7415_ADDRESS, buf, 2 );
I2CReadBuf() returns 0x04. I suspect that indicates a timeout.

Update:

I imported Nano example project I2C_TempSensor into Eclipse, changed the I2C address from 0x48 to 0x49 to match my hardware, compiled it, and loaded it into my board. No I2C bus activity.

"Error calling I2CSendBuf()"
"Error 4 calling I2CReadBuf()"

Update 2:

Using the Nano Dev Kit, I loaded example program I2C_TempSensor into it. Same errors as above, no I2C bus activity.


I'm using a Nano54415 with v2.7.4 of the IDE.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: I2C not working in 2.7.4

Post by rnixon »

Does it work if you load in an image with your previous version software? That would be a really good data point. It might help also to do a file compare between the I2C library source between the two versions.
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: I2C not working in 2.7.4

Post by pbreed »

Did you set the pins functions?

The 54415 has so many individual pins modes that we were having trouble setting sensible defaults.
its best practice to explicitly set any pins you are using to their intended fuction.
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

Re: I2C not working in 2.7.4

Post by SeeCwriter »

No, I wasn't setting the pins because I2CInit() sets them. But even explicitly setting the pins in my code does nothing. And I would have been surprised if did.

Looking at the Nano Dev Kit motherboard schematic, there doesn't appear to be a temperature sensor on the board. The I2C signals just connect to the P3 connector. Presumably to connect to my own external sensor. And there does not appear to be any pull-ups on the I2C signals. That could explain why there is no activity on the I2C lines on the Dev Kit board. But that would not explain why there is no I2C activity on my board, which does have pull-ups.
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

Re: I2C not working in 2.7.4

Post by SeeCwriter »

Adding pullups to the I2C lines on the Nano Dev Kit does not help. Still no activity running the I2C_TempSensor example.
I've gone through the I2C library code (i2cmaster.h, i2cmaster.cpp, sim5441x.h) and I could not see anything obviously wrong, like the wrong I2C bus being selected.

Looks like it's time to submit Tech Support ticket.
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

Re: I2C not working in 2.7.4

Post by SeeCwriter »

My system has both a time-of-day clock and a temperature sensor on the i2c bus.
It turns out that changes made to rtc.cpp in v2.7.4 to use Multichannel function calls causes the i2c bus to crash if you also try to use non-multichannel functions to access other devices on the bus.
joepasquariello
Posts: 85
Joined: Mon Apr 28, 2008 7:32 am

Re: I2C not working in 2.7.4

Post by joepasquariello »

Can anyone comment on the status of this issue? Is it something that needs to be fixed, and if so, was it addressed in 2.7.5?

Thanks,

Joe
SeeCwriter
Posts: 608
Joined: Mon May 12, 2008 10:55 am

Re: I2C not working in 2.7.4

Post by SeeCwriter »

I don't think there is anything to fix, with the possible exception of the documentation.

I was using i2cmaster.h, which works with pre 2.7.4 libraries. With v2.7.4, I needed to change to multichanneli2c.h for the i2c bus to work correctly.

Something in the release notes indicating that that change was needed would have been helpful and saved a lot of troubleshooting time.
joepasquariello
Posts: 85
Joined: Mon Apr 28, 2008 7:32 am

Re: I2C not working in 2.7.4

Post by joepasquariello »

Okay, thanks for that clarification. I'm currently on 2.5.3, but I'll print out this thread and add it to my Netburner doc folder.

Joe
Post Reply