View previous topic :: View next topic |
Author |
Message |
ferrumvir
Joined: 01 Feb 2006 Posts: 64 Location: England
|
Trouble shooting I2C |
Posted: Wed May 30, 2007 2:53 pm |
|
|
I found a couple of stumbling blocks using I2C, hopefully this post will stop other people tripping on them like I did.
1/ Don't try the I2C without the pull up resistors (4.7k Ohms), this will effectively hang the PIC which will require the watchdog to recover. Don't ask my why, it just does.
2/ Don't use the routine "setup_spi(FALSE);" as this will also the I2C working. I had copied the setup used on several other projects and didn't realise that this would cause problems... But it did.
For those who'll ask, compiler v3.249, PIC18F2680 & PIC18F258.
Cheers Scott |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
ferrumvir
Joined: 01 Feb 2006 Posts: 64 Location: England
|
|
Posted: Wed May 30, 2007 3:56 pm |
|
|
Thanks for the info, I searched the forum before I discovered my errors and failed to find anything, I also searched before I posted, nothing.
This highlights my inability to know what keywords to search for!
Fingers crossed it'll help someone...
Cheers Scott |
|
|
|