Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | Work-around for SDA becomming stuck low.

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

Work-around for SDA becomming stuck low. - Andrew Lohmann - Sep 28 8:06:00 2005

Hi, I have found that SDA pin on Ramtron's FM24C64 non-volatile memory can
become stuck low, under fault conditions with another IIC bus device on
the bus. I am using the IIC bus peripheral on MC9S12E128. I have found a
work-around but does anyone know a better fix?

I have a daughter board fitted which if it is an old type does not have
any IIC bus devices fitted, but if it is a new type it has a FM24C64. I
use the errors returned to signal which type of daughter board is
fitted. If there is an error then a second FM24C64 on the mother boards
SDA line becomes stuck low.My work around is:-

On detecting a bus error,
1) I toggle the SCL line at least four times. This releases the SDA line
stuck low.
2) I then write to the mother board FM24C64, which happens to fail, but
will be fine latter.

--
Andrew Lohmann AMIIE
Design Engineer

PLEASE NOTE NEW EMAIL ADDRESS IS:
andrew.lohmann@andr...

Bellingham + Stanley Ltd.
Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
Tel: +44 (0) 1892 500400
Fax: +44 (0) 1892 543115
Website: www.bs-ltd.com -----------------------------Disclaimer-----------------------------

This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the addressee. If you are not the addressee please note that any distribution, reproduction, copying, publication or use of this communication or the information is prohibited. If you have received this communication in error, please contact us immediately and also delete the communication from your computer. We accept no liability for any loss or damage suffered by any person arising from use of this e-mail.

-----------------------------Disclaimer-----------------------------




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: Work-around for SDA becomming stuck low. - Michal Konieczny - Sep 28 12:56:00 2005

> On detecting a bus error,
> 1) I toggle the SCL line at least four times. This releases the SDA line
> stuck low.

I2C slave devices can become stuck when there's some glitch in the
system and read/write cycle is aborted "in the middle". To recover from
this situation you need to generate enough clock edges to finish
unfinished cycle. Four cycles is not enough, may work but it's not
bulletproof.
Also include SDA line in the process to simultaneously generate STOP
condition. The following loop always does the job for me:

for (i = 0; i < 16; ++i)
{
SDA low
SCL low
SCL high
SDA high
}

16 times may be an overkill, but makes no harm and proved to be 100% sure.

Regards,

--
Michal Konieczny
mk@mk@....





(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: Work-around for SDA becomming stuck low. - Andrew Lohmann - Sep 29 7:21:00 2005

Thanks Michal, That worked fine. I set the pin WOMMn true first then waited 5uS between
each pin change. I also waited for the lines to reach 1 when writing 1.

Andrew Michal Konieczny wrote:

> > On detecting a bus error,
> > 1) I toggle the SCL line at least four times. This releases the SDA
> line
> > stuck low.
>
> I2C slave devices can become stuck when there's some glitch in the
> system and read/write cycle is aborted "in the middle". To recover from
> this situation you need to generate enough clock edges to finish
> unfinished cycle. Four cycles is not enough, may work but it's not
> bulletproof.
> Also include SDA line in the process to simultaneously generate STOP
> condition. The following loop always does the job for me:
>
> for (i = 0; i < 16; ++i)
> {
> SDA low
> SCL low
> SCL high
> SDA high
> }
>
> 16 times may be an overkill, but makes no harm and proved to be 100% sure.
>
> Regards,
>
> --
> Michal Konieczny
> mk@mk@.... > SPONSORED LINKS
> Freescale semiconductor inc
> <http://groups.yahoo.com/gads?t=ms&k=Freescale+semiconductor+inc&w1=Freescale+semiconductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=106&.sig=K2HGv-zFlv5OYUv_QxIq_Q>
> Microcontrollers
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Freescale+semiconductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=106&.sig=SYHwNJjjGQXRvtt_GybT4g>
> Pic microcontrollers
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Freescale+semiconductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=106&.sig=umVbbnUwsPzEzKKD_pQfUw>
>
> 8051 microprocessor
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Freescale+semiconductor+inc&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=106&.sig=NO-nSKjHoAlh9XtZ8LB1_A >
> ------------------------------------------------------------------------
> >. > ------------------------------------------------------------------------ -----------------------------Disclaimer-----------------------------

This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the addressee. If you are not the addressee please note that any distribution, reproduction, copying, publication or use of this communication or the information is prohibited. If you have received this communication in error, please contact us immediately and also delete the communication from your computer. We accept no liability for any loss or damage suffered by any person arising from use of this e-mail.

-----------------------------Disclaimer----------------------------- [Non-text portions of this message have been removed]




(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )