Page 1 of 1

I2C - strange output on the logic analyzer

PostPosted: Wed Jan 26, 2022 12:20 pm
by picn00b
[Solved] - just a silly mistake

-----
Hello folks,

I started a project with a IPC16F15225, used MPLAB X v5.50 and MCC to configure a small test project,
with I2C. I checked the box for using an interrupt for I2C.
I also uncommented the IDE-generated lines to enable global + peripheral interrupts - and then it would not wait forever for i2c not being busy ;)
So far, so good. Except that I'm always getting back zeroes when reading fhe first register of a device.

So I attached one of those cheap Saleae clones as a logic analyzer & capturing from Sigrok, I get a strange looking pulse pattern.
I am calling, from the i2c1_master_example.c, I2C1_Read2ByteRegister().
See image below.
There seems to be one clock pulse missing even just for the address - if that's what it's sending there. The I2C protocol decoder doesn't display anything.
And no pulses for the register to be read.
(btw, there is only one thing connected, a MAX7500 temperature sensor.)

Any ideas what might be wrong?

i2c-weird.png
i2c-weird.png (13.29 KiB) Viewed 3856 times

Re: I2C - strange output on the logic analyzer

PostPosted: Wed Jan 26, 2022 1:47 pm
by picn00b
Nevermind. I was irritated by the long "pauses" and all and thought something must be weird.
Turns out I wrongly assumed I need to feed a slave address that's left-shifted by 1, from projects with a different MCU.
So the device ACK any anything else is of course missing, and the address bits look wrong, no surprise ;)

Re: I2C - strange output on the logic analyzer

PostPosted: Tue Feb 01, 2022 6:09 am
by ric
It's always nice to figure out a solution yourself :)