User avatar
joan
Posts: 13538
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: I2C failure rate

Thu May 19, 2016 12:37 pm

PhilE wrote:@joan The source of the clock isn't the issue here - it is that the I2C (and SDHOST) interfaces share the VPU's clock output.
I'm afraid I wasn't thinking about the OP's problem. I was just trying to find out if PLLD will always be 500 MHz as I have had conflicting reports.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1817
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C failure rate

Thu May 19, 2016 12:47 pm

Off Topic questions, especially ones that aren't obviously so, aren't helpful.

rricharz
Posts: 57
Joined: Tue Apr 19, 2016 8:46 am
Location: Switzerland
Contact: Website

Re: I2C failure rate

Thu May 19, 2016 1:22 pm

@PhilE
Thanks for your interesting explanations.

Here are the numbers:

Case 1: core_freq not set, i2c_arm_baudrate=50000
not busy: 31 kBaud
busy: 54 kBaud

Case 2: core_freq=500, i2c_arm_baudrate=50000
not busy: 26 kBaud
busy: 54 kBaud

Case 3: core_freq not set, i2c_arm_baudrate=25000
not busy: 16 kBaud
busy: 25 kBaud

You are right that this is all within specs, but it is not what one would expect at first. Anyway it does explain why my i2c failure rate changes when the rpi becomes busy. Obviously there is some critical timing somewhere. What got me was of course case 2, not knowing that something set my core_freq and baudrate to some non-standard values.

pallzoltan
Posts: 4
Joined: Mon Feb 24, 2014 1:46 pm

Re: I2C failure rate

Wed Jun 13, 2018 10:52 am

Hey guys, two years later I ran into the same problem with different hardware. It's an MCP9600 board which gives me good temperatures when the Pi is more or less idle and gets crazy when I use it.
Any changes or solutions showed up?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1817
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C failure rate

Wed Jun 13, 2018 10:58 am

That means that the reduced I2C clock rate - i2c_arm_baudrate* (normal_freq/turbo_freq) - is OK but the full rate - i2c_arm_baudrate - is possibly too high. The default i2c_arm_baudrate is 100KHz, which would make the reduced rate 62.5KHz. Try setting:

Code: Select all

dtparam=i2c_arm_baudrate=60000

pallzoltan
Posts: 4
Joined: Mon Feb 24, 2014 1:46 pm

Re: I2C failure rate

Fri Jun 15, 2018 4:00 pm

Unfortunately my readings are off the charts with this setting. Anything else I could try, PhilE?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1817
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C failure rate

Fri Jun 15, 2018 4:03 pm

What clock speed are you requesting? My suggestion was based on the default of 100kHz, but if you have reduced this then you will also need to reduce the new value proportionally.

pallzoltan
Posts: 4
Joined: Mon Feb 24, 2014 1:46 pm

Re: I2C failure rate

Sat Jun 16, 2018 10:00 am

Clock speed being core_freq? I did not set core_freq, only dtparam=i2c_arm_baudrate=60000.

On the other hand, I manually set the CPU scaling governor to powersave (don't need a lot of computing power in my case) and the I2C readings are flawless. I suppose I'd get the same result for performance.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1817
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: I2C failure rate

Sat Jun 16, 2018 4:19 pm

No, clock speed being a more accurate name for the I2C bus speed set using i2c_arm_baudrate. Whatever value you find works well at idle, multiply it by 250/400 and use that add the new value.

Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 11 guests