Jump to content

IIC suddenly stopped working


wackazong
 Share

Recommended Posts

Hi!

Yesterday I had everything, now nothing.... My IIC stopped working, and I cannot find out why.

I made a debug routine which just sends a MIOS_IIC_Start and then a MIOS_IIC_Stop about every second to the IIC bus. Am I right that both SDA and SCL should change from about 5V (after issuing Stop) to about 0V (after issuing start) in that interval?

My SDA changes from 0V (after Start) to 4.8V (after Stop) in the said interval, with nothing attached but the pullup resistors. That seems ok. (4.8 V is the supply voltage of the core, the pullup resistors are connected to 5V, because I use a schottky diode in front of the PIC power supplay for other reasons (in-circuit programming adapter))

MY SCL (also with pullup) changes from 4.8V after Stop (the supply voltage of the PIC) to 5V after Start (the supply voltage of the rest of the board). That seems strange to me, shouldn't the line be low then? But maybe the pullup resistors play a role, and whether the PICs Pin is draining power or not. But I have no idea...

Do you have any hints for troubleshooting IIC connections? I have an Oscilloscope, but do not really know how to use it for debugging IIC.

I use IIC to drive some PCA9635 LED chips (datasheet attached).

Please remember: The whole configuration worked beautifully without a flaw yesterday, and then suddenly IIC stopped working. Therefore the basic setup should be ok, I just have no idea what I changed.

Any help really appreciated,

ALEXander.

PCA9635.pdf

PCA9635.pdf

Link to comment
Share on other sites

Its actually three PCAs connected to the bus, and each one of them worked perfectly... I took all three of them out, soldered in another one, connected them to another core, nothing works....

One question I have: How can I see whether the slave sends an ACK or not? MIOS_IIC_ByteSend gives back 0 when the slave sends a NAK, but the description does not say if not 0 means "ACK received".

Regarding the driver: I am happy to share it, I did not so far because there are some features left I want to implement (group brightness for example). But I will, don't worry. I thought about making an assembler module, but its really not wort it since its only a bunch of IIC commands. BTW, its posted here already: http://www.midibox.org/forum/index.php/topic,12257.0.html

Link to comment
Share on other sites

Wohooo! I shredded one of my four-layer prototype boards, but now it works again, with another core. I have absolutely no idea why.... But I am happy again.

...

stryd, therefore looking forward to you looking at how to accelerate my code :) and thanks for the tips.

look at the nice colorfade. actually, when I press the buttons, the corresponding led flashes briefly in blue, but the camera cannot really capture it :)

46MERPmsIWQ

ALEXander.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...