I²C decoding misses messages

Post any questions you may have about our current range of oscilloscopes
Post Reply
Gunnar
User
User
Posts: 2
Joined: Fri Aug 03, 2018 12:50 pm

I²C decoding misses messages

Post by Gunnar » Fri Aug 03, 2018 1:29 pm

I'm trying to find a problem with the I²C bus by the help of our Pico 2205 MSO, S/N CP891/059, calibrated 2015/09/30. I'm using the serial decoder on the analog channels - one for SDA, one for SCL - with a falling edge trigger on SDA at 3V (with a 5 V bus with 100 kHz).
More specifically, the ISL22313 programmable potentiometer cannot be talked to from a Raspberry reliably quickly. However, I believe to have found that the scope (or the software, v6.13.6.3775) is unable to decode and record the I²C messages quickly enough, even with the sample rate raised to 1 MS.
I have written a small shell script that iterates over all valid config values (0...255) for all four connected potis (I²C addresses 80==0x50 ... 83==0x53), sets these to the chip's register 0x00, and reads back the resulting value from there:

Code: Select all

#!/bin/bash
i=0
while [ $i -lt 256 ]; do
        a=80
        while [ $a -lt 84 ]; do
                n=$(printf "%x" $i)
                add=$(printf "%x" $a)
                echo 0x$add \= 0x$n
                i2cset -y 1 0x$add 0x00 0x$n
# increase the sleep value, and the scope will capture all messages
# decrease the sleep value, and communication will fail (not relevant here)
                sleep 0.02
                i2cget -y 1 0x$add 0x00
                ((a++))
        done;
        ((i++))
done
The script has the following output, which shows that communication with the potis succeeds, which means further that a message for each config value between 0 and 255 has been sent to each poti:

Code: Select all

0x50 = 0x0
0x00
0x51 = 0x0
0x00
0x52 = 0x0
0x00
0x53 = 0x0
0x00
0x50 = 0x1
0x01
0x51 = 0x1
0x01
0x52 = 0x1
0x01
0x53 = 0x1
0x01
0x50 = 0x2
0x02
0x51 = 0x2
0x02
0x52 = 0x2
0x02
0x53 = 0x2
0x02
0x50 = 0x3
0x03
0x51 = 0x3
0x03
0x52 = 0x3
0x03
0x53 = 0x3
0x03
0x50 = 0x4
0x04
0x51 = 0x4
0x04
0x52 = 0x4
0x04
0x53 = 0x4
0x04
0x50 = 0x5
0x05
0x51 = 0x5
0x05
0x52 = 0x5
0x05
0x53 = 0x5
0x05
0x50 = 0x6
0x06
0x51 = 0x6
0x06
0x52 = 0x6
# ...
In different words, each value is written four times (to each potis) and immediately read back correctly.
But Pico's serial decoder only captures these messages, missing many of the actually transmitted ones:

Code: Select all

Puffer Nr.,Paket,Startzeit (s),Endzeit (s),Address Bits,Address,Address + R/W,R/W,Address ACK,Data,Data ACK
32,1,-4,59347865594007E-06,0,000178306510485621,7,52,A4,Write,0,00,0
32,2,0,000178306510485621,0,000361306499621244,7,52,A5,Read,0,29,1
31,1,-4,54999663190847E-06,0,000178349992509652,7,51,A2,Write,0,00,0
31,2,0,000178349992509652,0,000361349981645276,7,51,A3,Read,0,28,1
30,1,-4,59803712194006E-06,0,000178301952019621,7,50,A0,Write,0,00,0
30,2,0,000178301952019621,0,000361301941155244,7,50,A1,Read,0,27,1
29,1,-4,58919163994006E-06,0,000178310797501621,7,53,A6,Write,0,00,0
29,2,0,000178310797501621,0,000361310786637244,7,53,A7,Read,0,25,1
28,1,-4,54999663190847E-06,0,000178299992512621,7,52,A4,Write,0,00,0
28,2,0,000178299992512621,0,000361299981648244,7,52,A5,Read,0,24,1
27,1,-4,54999663190847E-06,0,000178299992512621,7,51,A2,Write,0,00,0
27,2,0,000178299992512621,0,000361299981648244,7,51,A3,Read,0,23,1
26,1,-4,54999663190847E-06,0,000178299992512621,7,50,A0,Write,0,00,0
26,2,0,000178299992512621,0,000361299981648244,7,50,A1,Read,0,22,1
25,1,-4,54999663190847E-06,0,000178299992512621,7,53,A6,Write,0,00,0
25,2,0,000178299992512621,0,000361299981648244,7,53,A7,Read,0,20,1
24,1,-4,59711385594007E-06,0,000178302875285621,7,52,A4,Write,0,00,0
24,2,0,000178302875285621,0,000361302864421244,7,52,A5,Read,0,1F,1
23,1,-4,54999663190847E-06,0,000178299992512621,7,51,A2,Write,0,00,0
23,2,0,000178299992512621,0,000361349981645276,7,51,A3,Read,0,1E,1
22,1,-4,54999663190847E-06,0,000178299992512621,7,50,A0,Write,0,00,0
22,2,0,000178299992512621,0,000361299981648244,7,50,A1,Read,0,1D,1
21,1,-4,59622251294006E-06,0,000178303766628621,7,53,A6,Write,0,00,0
21,2,0,000178303766628621,0,000361303755764244,7,53,A7,Read,0,1B,1
20,1,-4,59222344294007E-06,0,000178307765698621,7,52,A4,Write,0,00,0
20,2,0,000178307765698621,0,000361307754834244,7,52,A5,Read,0,1A,1
19,1,-4,59899729394006E-06,0,000178300991847621,7,51,A2,Write,0,00,0
19,2,0,000178300991847621,0,000361300980983244,7,51,A3,Read,0,19,1
18,1,-4,59387791394006E-06,0,000178306111227621,7,50,A0,Write,0,00,0
18,2,0,000178306111227621,0,000361306100363244,7,50,A1,Read,0,18,1
17,1,-4,54999663190847E-06,0,000178299992512621,7,53,A6,Write,0,00,0
17,2,0,000178299992512621,0,000361299981648244,7,53,A7,Read,0,16,1
16,1,-4,59803712194006E-06,0,000260751947124714,7,53,A6,Write,0,00 15,0 0
15,1,-4,54999663190847E-06,0,000260749987617714,7,52,A4,Write,0,00 14,0 0
14,1,-4,54999663190847E-06,0,000260749987617714,7,51,A2,Write,0,00 13,0 0
13,1,-1,8299995815596E-05,0,000164599993325965,7,53,A6,Write,0,00,0
13,2,0,000164599993325965,0,000347599982461588,7,53,A7,Read,0,11,1
12,1,-4,58974633194006E-06,0,000260710237917683,7,52,A4,Write,0,00 10,0 0
11,1,-4,59102761894006E-06,0,000178308961522621,7,50,A0,Write,0,00,0
11,2,0,000178308961522621,0,000361308950658244,7,50,A1,Read,0,0F,1
10,1,-4,59204688594006E-06,0,000178307942255621,7,53,A6,Write,0,00,0
10,2,0,000178307942255621,0,000361307931391244,7,53,A7,Read,0,0D,1
9,1,-4,54999663190847E-06,0,000178299992512621,7,52,A4,Write,0,00,0
9,2,0,000178299992512621,0,000361299981648244,7,52,A5,Read,0,0C,1
8,1,-4,54999663190847E-06,0,000178299992512621,7,51,A2,Write,0,00,0
8,2,0,000178299992512621,0,000361349981645276,7,51,A3,Read,0,0B,1
7,1,-4,54999663190847E-06,0,000260749987617714,7,51,A2,Write,0,00 0A,0 0
6,1,-4,54999663190847E-06,0,000178299992512621,7,53,A6,Write,0,00,0
6,2,0,000178299992512621,0,000361299981648244,7,53,A7,Read,0,08,1
5,1,-4,59024606294007E-06,0,000178309743078621,7,52,A4,Write,0,00,0
5,2,0,000178309743078621,0,000361309732214244,7,52,A5,Read,0,07,1
4,1,-4,59270950194007E-06,0,000178307279639621,7,51,A2,Write,0,00,0
4,2,0,000178307279639621,0,000361307268775244,7,51,A3,Read,0,06,1
3,1,-4,54999663190847E-06,0,000178299992512621,7,53,A6,Write,0,00,0
3,2,0,000178299992512621,0,000361299981648244,7,53,A7,Read,0,04,1
2,1,-4,54999663190847E-06,0,000260749987617714,7,50,A0,Write,0,00 00,0 0
Please note that because of the german UI, there is a comma as a decimal separator in the times - and they're not in seconds, but in microseconds. That has been exported the wrong way by the software. You can, however, see in the data column that many messages are missing. That can be fixed by increasing the sleep time in the above script to 0.5s. In that case, a message for each value and each of the four potis is captured by the scope as expected:

Code: Select all

Puffer Nr.,Paket,Startzeit (s),Endzeit (s),Address Bits,Address,Address + R/W,R/W,Address ACK,Data,Data ACK
32,1,-2,84999673283437E-06,0,000111449996481383,7,53,A6,Write,0,00,0
32,2,0,000111449996481383,0,000225899989686695,7,53,A7,Read,0,0B,1
31,1,-2,84999673283437E-06,0,000111449996481383,7,52,A4,Write,0,00,0
31,2,0,000111449996481383,0,000225849989689664,7,52,A5,Read,0,0B,1
30,1,-2,89390311986596E-06,0,000111406090094352,7,51,A2,Write,0,00,0
30,2,0,000111406090094352,0,000225856083299664,7,51,A3,Read,0,0B,1
29,1,-2,89390311986596E-06,0,000111406090094352,7,50,A0,Write,0,00,0
29,2,0,000111406090094352,0,000225856083299664,7,50,A1,Read,0,0B,1
28,1,-2,89166800886597E-06,0,000111408325205352,7,53,A6,Write,0,00,0
28,2,0,000111408325205352,0,000225858318410664,7,53,A7,Read,0,0A,1
27,1,-2,89305676886596E-06,0,000111406936445352,7,52,A4,Write,0,00,0
27,2,0,000111406936445352,0,000225856929650664,7,52,A5,Read,0,0A,1
26,1,-2,84899739783436E-06,0,000111450995816383,7,51,A2,Write,0,00,0
26,2,0,000111450995816383,0,000225850989024664,7,51,A3,Read,0,0A,1
25,1,-2,84705747183437E-06,0,000111452935742383,7,50,A0,Write,0,00,0
25,2,0,000111452935742383,0,000225852928950664,7,50,A1,Read,0,0A,1
24,1,-2,89268380486596E-06,0,000111407309409352,7,53,A6,Write,0,00,0
24,2,0,000111407309409352,0,000225857302614664,7,53,A7,Read,0,09,1
23,1,-2,84899739783436E-06,0,000111450995816383,7,52,A4,Write,0,00,0
23,2,0,000111450995816383,0,000225850989024664,7,52,A5,Read,0,09,1
22,1,-2,84999673283437E-06,0,000111449996481383,7,51,A2,Write,0,00,0
22,2,0,000111449996481383,0,000225899989686695,7,51,A3,Read,0,09,1
21,1,-2,89342180686597E-06,0,000111406571407351,7,50,A0,Write,0,00,0
21,2,0,000111406571407351,0,000225856564612664,7,50,A1,Read,0,09,1
20,1,-2,84899739783436E-06,0,000111450995816383,7,53,A6,Write,0,00,0
20,2,0,000111450995816383,0,000225850989024664,7,53,A7,Read,0,08,1
19,1,-2,89027988886596E-06,0,000111409713325352,7,52,A4,Write,0,00,0
19,2,0,000111409713325352,0,000225859706530664,7,52,A5,Read,0,08,1
18,1,-2,84999673283437E-06,0,000111449996481383,7,51,A2,Write,0,00,0
18,2,0,000111449996481383,0,000225899989686695,7,51,A3,Read,0,08,1
17,1,-2,89268380486596E-06,0,000111407309409352,7,50,A0,Write,0,00,0
17,2,0,000111407309409352,0,000225857302614664,7,50,A1,Read,0,08,1
16,1,-2,84999673283437E-06,0,000111449996481383,7,53,A6,Write,0,00,0
16,2,0,000111449996481383,0,000225899989686695,7,53,A7,Read,0,07,1
15,1,-2,89117837086597E-06,0,000111408814843351,7,52,A4,Write,0,00,0
15,2,0,000111408814843351,0,000225858808048664,7,52,A5,Read,0,07,1
14,1,-2,84999673283437E-06,0,000111449996481383,7,51,A2,Write,0,00,0
14,2,0,000111449996481383,0,000225899989686695,7,51,A3,Read,0,07,1
13,1,-2,84591447883436E-06,0,000111454078735383,7,50,A0,Write,0,00,0
13,2,0,000111454078735383,0,000225854071943664,7,50,A1,Read,0,07,1
12,1,-2,84591447883436E-06,0,000111454078735383,7,53,A6,Write,0,00,0
12,2,0,000111454078735383,0,000225854071943664,7,53,A7,Read,0,06,1
11,1,-2,84999673283437E-06,0,000111449996481383,7,52,A4,Write,0,00,0
11,2,0,000111449996481383,0,000225899989686695,7,52,A5,Read,0,06,1
10,1,-2,84456548083437E-06,0,000111455427733383,7,51,A2,Write,0,00,0
10,2,0,000111455427733383,0,000225855420941664,7,51,A3,Read,0,06,1
9,1,-2,84999673283437E-06,0,000111449996481383,7,50,A0,Write,0,00,0
9,2,0,000111449996481383,0,000225849989689664,7,50,A1,Read,0,06,1
8,1,-2,84999673283437E-06,0,000111449996481383,7,53,A6,Write,0,00,0
8,2,0,000111449996481383,0,000225849989689664,7,53,A7,Read,0,05,1
7,1,-2,89102771986596E-06,0,000111408965494352,7,52,A4,Write,0,00,0
7,2,0,000111408965494352,0,000225858958699664,7,52,A5,Read,0,05,1
6,1,-4,59705736794007E-06,0,000178302931773621,7,51,A2,Write,0,00,0
6,2,0,000178302931773621,0,000361302920909244,7,51,A3,Read,0,05,1
5,1,-2,84444445683438E-06,0,000111455548757383,7,50,A0,Write,0,00,0
5,2,0,000111455548757383,0,000225855541965664,7,50,A1,Read,0,05,1
4,1,-2,84999673283437E-06,0,000111449996481383,7,53,A6,Write,0,00,0
4,2,0,000111449996481383,0,000225899989686695,7,53,A7,Read,0,04,1
3,1,-2,84999673283437E-06,0,000111449996481383,7,52,A4,Write,0,00,0
3,2,0,000111449996481383,0,000225899989686695,7,52,A5,Read,0,04,1
2,1,-2,89117837086597E-06,0,000111408814843351,7,51,A2,Write,0,00,0
2,2,0,000111408814843351,0,000225858808048664,7,51,A3,Read,0,04,1
1,1,-2,84999673283437E-06,0,000111449996481383,7,50,A0,Write,0,00,0
1,2,0,000111449996481383,0,000225899989686695,7,50,A1,Read,0,04,1
I'm trying to figure out if I'm using a too cheap scope, or if anything is configured in the wrong way, or if this is a software issue. I'd be glad to hear from you on this issue. Thanks!

bennog
Advanced User
Advanced User
Posts: 50
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: I²C decoding misses messages

Post by bennog » Fri Aug 03, 2018 5:23 pm

is this scope capable of capturing the whole process in streaming mode.

Then you can decode every message.

Other option is using triggers and capture every step from 0 to 255 with enough data to capture write and read back.

Then leave enough time between the steps so the pc can download the data from the scope (this is why you are missing messages, the scope is transferring data to the pc), and rearm the trigger for the next step.

I prefer streaming mode, so from 0 to 255 as fast as possible and set scope sample time to 5 sec or so.
Then turn on decoding (do not turn on decoding on forehand) because the software limits the max samples when decoding is enabled before you start capturing.

Benno

Gunnar
User
User
Posts: 2
Joined: Fri Aug 03, 2018 12:50 pm

Re: I²C decoding misses messages

Post by Gunnar » Wed Mar 27, 2019 10:33 am

Thanks for the hint, Benno. Pico's documentation on streaming mode is not really helpful, but it seems to come down to turning off serial decoding as you suggested, record long enough buffers, and decode them only after stopping the measurement. You still have to be lucky not to have any messages ript apart across buffer limits.

Post Reply