Sequential I2C read (EEPROM) and scope probe, an issue

Hallo!

H/w I use is 24LC512 5V I2C EEPROM. The chip is connected to the C167. The only I2C data line pulled-up via 5 kOhm resistor (clock line is not). Vcc connected to ground via 0.1 uF. Clock rate is about 125 kHz. I have no trouble neither with byte write, page write, random read operations driven via pin-bang routines. However I stucked on sequential read access when migrated to it from singe byte mode.

I use uVision Keil debugger and even in static go-through step-by-step manner still experience problem with reading 2nd, 3d, etc. bytes (the 1st byte is OK) - all I read is just FFh, i.e. data line being held high. My f/w does issue data, ACK/NOACK and clocks according to I2C specs (see below).

WHEN I connect scope probe to the data and clock lines to watch the waveforms, everything becomes OK, i.e. instead of FFh I get what should be! It remains to be OK if I hold scope's probe only at data line pin (i.e. seems this is OK to have no pull up at clock line at least in this particular case). As soon as I disconnect probe, I return back to trouble. With probes attached I see waveform timing is perfect and data are what I expect (I see them also in debugger).

So, I touch data pin with probe - good, disconnect the scope - have trouble.

Any idea what can cause the problem (might it be a purely electrical issue)?

Thanks,
Nikolay.

Parents
  • Hallo!

    Here is the follow-up to the subj.

    The problem was solved by putting 8.2 kOhm resistor instead of 4.9 kOhm as pull-up for data line. Nothing other was changed. It works now for at least up to 200 kHz. Some other experiments were carried out. Here is an overview in form of "truth table":

    +----------------+--------+----------+----------+---------+
    | Pull-up @ data | 1 kOhm | 4.9 kOhm | 8.2 kOhm | 22 kOhm |
    +----------------+--------+----------+----------+---------+
    | no scope probe | FAIL   |  FAIL    |    OK    |   OK    |
    +----------------+--------+----------+----------+---------+
    | w/ scope probe | FAIL   |   OK     |    OK    |  FAIL   |
    +----------------+--------+----------+----------+---------+
    

    Unexpected is that this is higher value for pull-up resistor which has helped. Well..., the 22 kOhm was put purely dure to curiosity. Changing capacitor to 1.0 uF instead of 0.1 uF between chip's Vcc and GND did not help.

    Again, sequential write and random read of a single byte routines were working just fine all the time (for 4.9 kOhm), and it was sequential read operation that failed after the 1st byte is read.

    For sequential read MCU has to change data line direction; on the other side the MCU checks clock line each clock for possible clock stretching, i.e. direction of clock line is changed even for sequential write operation.

    The h/w is soldered on 10-layer PCB w/ standard form-factor 12x24 cm. However the EEPROM is placed onto side opposite to the MCU, no more details on tracing available.

    P.S. Would greatly appreciate somebody who can give an distinct/clear explanation of observed behavior.

    Regards,
    Nikolay.

Reply
  • Hallo!

    Here is the follow-up to the subj.

    The problem was solved by putting 8.2 kOhm resistor instead of 4.9 kOhm as pull-up for data line. Nothing other was changed. It works now for at least up to 200 kHz. Some other experiments were carried out. Here is an overview in form of "truth table":

    +----------------+--------+----------+----------+---------+
    | Pull-up @ data | 1 kOhm | 4.9 kOhm | 8.2 kOhm | 22 kOhm |
    +----------------+--------+----------+----------+---------+
    | no scope probe | FAIL   |  FAIL    |    OK    |   OK    |
    +----------------+--------+----------+----------+---------+
    | w/ scope probe | FAIL   |   OK     |    OK    |  FAIL   |
    +----------------+--------+----------+----------+---------+
    

    Unexpected is that this is higher value for pull-up resistor which has helped. Well..., the 22 kOhm was put purely dure to curiosity. Changing capacitor to 1.0 uF instead of 0.1 uF between chip's Vcc and GND did not help.

    Again, sequential write and random read of a single byte routines were working just fine all the time (for 4.9 kOhm), and it was sequential read operation that failed after the 1st byte is read.

    For sequential read MCU has to change data line direction; on the other side the MCU checks clock line each clock for possible clock stretching, i.e. direction of clock line is changed even for sequential write operation.

    The h/w is soldered on 10-layer PCB w/ standard form-factor 12x24 cm. However the EEPROM is placed onto side opposite to the MCU, no more details on tracing available.

    P.S. Would greatly appreciate somebody who can give an distinct/clear explanation of observed behavior.

    Regards,
    Nikolay.

Children
More questions in this forum