I2C - strange output on the logic analyzer

I2C - strange output on the logic analyzer

Postby picn00b » Wed Jan 26, 2022 12:20 pm

[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 8450 times
Last edited by picn00b on Wed Jan 26, 2022 1:49 pm, edited 1 time in total.
picn00b
 
Posts: 5
Joined: Tue Feb 11, 2020 11:17 am

Re: I2C - strange output on the logic analyzer

Postby picn00b » Wed Jan 26, 2022 1:47 pm

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 ;)
picn00b
 
Posts: 5
Joined: Tue Feb 11, 2020 11:17 am

Re: I2C - strange output on the logic analyzer

Postby ric » Tue Feb 01, 2022 6:09 am

It's always nice to figure out a solution yourself :)
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 661
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to SSP (IIC, SPI)

Who is online

Users browsing this forum: No registered users and 1 guest

cron