View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
i2C comunication reset PIC |
Posted: Wed Mar 14, 2007 12:22 pm |
|
|
Hi,
I have a control pannel connected with main board by a i2c bus. The system work fine but I have a problem when I switch on the power supply of pannel, SCL line goes low just some ms and reset the main board.
I saw it with my oscilloscope and do some test, stopping i2C comunication of main board the problem disappear. I belive the problem is in I2C comunication and low state of SCL by a slave.
Any suggestion to solve the problem ?
Regards,
Fabry |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 14, 2007 12:31 pm |
|
|
Quote: | SCL line goes low just some ms and reset the main board. |
Do you mean that the PIC actually does a hardware reset ?
See page 37 of the i2c specification:
http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf
On the right side of the page, it says you can use series resistors of
300 ohms on the SDA and SCL pins to protect from high voltage spikes. |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Thu Mar 15, 2007 2:12 am |
|
|
Hi PCM,
I've that resistors and I solved, with them, EMC problem. Increasing the value it's just a little bit better. The bus is 3 meters long so I don't want have problem of data comunication.
I'll work around !
Regards, |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Thu Mar 15, 2007 4:41 am |
|
|
Hi,
I've another consideration about:
Some EMC burst don't reset the board but stop the I2C comunication. Other function of board continue to work. I found an continue clock, by master, of SCL line but there's no data on SDA. When I restart bus comunication with reset of SSPEN bit, the comunication restart to work.
I think to solve the problem with a timeout of valid I2C comunication, after some seconds without valid data I restart I2C bus by SSPEN bit.
I'm interest to understand why SCL line toggle and if there are others valid solutions to find the stop of I2C.
Have you got to suggest me ?
Thanks for help. |
|
|
|