EmbeddedRelated.com
Forums
Memfault Beyond the Launch

I2C data line (SDA) goes low and hangs

Started by Basic Poke June 4, 2008
I have a PIC18F66J50 with a Microchip EEPROM on the I2C port.
Sometimes when I program the MCU using MPLAB, the I2C data line (SDA)
goes low and stays there. Any read or write I then attempt results in
a bus collision error and doesn't work. Here is the sequence of events:

* cycle power to the MCU/EEPROM board
* compile with MPLAB
* program the target device with MPLAB. There is chatter on the SCL
and SDA lines, then SDA goes low and stays. This does not happen every
time.

Any help?
Thanks
BasicPoke
The problem was that during download to the target MPLAB was allowing
the program to run briefly and an I2C message was started and
apparently interrupted while the external EEPROM was driving the data
line low. To fix it, at the beginning of my code I basically send
out clock pulses until the data line is released.
BP
--- In p..., "Basic Poke" wrote:
>
> I have a PIC18F66J50 with a Microchip EEPROM on the I2C port.
> Sometimes when I program the MCU using MPLAB, the I2C data line
(SDA)
> goes low and stays there. Any read or write I then attempt results
in
> a bus collision error and doesn't work. Here is the sequence of
events:
>
> * cycle power to the MCU/EEPROM board
> * compile with MPLAB
> * program the target device with MPLAB. There is chatter on the
SCL
> and SDA lines, then SDA goes low and stays. This does not happen
every
> time.
>
> Any help?
> Thanks
> BasicPoke
>

But the I2C can be interupted, there is no time out on the bus.
Are you sure that you are clocking out the ACK ?
Sounds to me like your not clocking the bus again to get rid of the ACK.

----- Original Message ----
From: Basic Poke
To: p...
Sent: Thursday, 5 June, 2008 2:38:52 PM
Subject: [piclist] Re: I2C data line (SDA) goes low and hangs
The problem was that during download to the target MPLAB was allowing
the program to run briefly and an I2C message was started and
apparently interrupted while the external EEPROM was driving the data
line low. To fix it, at the beginning of my code I basically send
out clock pulses until the data line is released.
BP

--- In piclist@yahoogroups .com, "Basic Poke" wrote:
>
> I have a PIC18F66J50 with a Microchip EEPROM on the I2C port.
> Sometimes when I program the MCU using MPLAB, the I2C data line
(SDA)
> goes low and stays there. Any read or write I then attempt results
in
> a bus collision error and doesn't work. Here is the sequence of
events:
>
> * cycle power to the MCU/EEPROM board
> * compile with MPLAB
> * program the target device with MPLAB. There is chatter on the
SCL
> and SDA lines, then SDA goes low and stays. This does not happen
every
> time.
>
> Any help?
> Thanks
> BasicPoke
>

__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html

Memfault Beyond the Launch