View previous topic :: View next topic |
Author |
Message |
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
18F26K22 with spi and I2c |
Posted: Mon Mar 26, 2012 9:11 am |
|
|
Does anyone have working code for this chip with both spi and I2C working?
My config is spi_2 and I2c on 1.
It seem to hang on any write to the I2C.
Thanks for any help.
Chris |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9177 Location: Greensville,Ontario
|
|
Posted: Mon Mar 26, 2012 9:15 am |
|
|
Show us your code! A small,compilable program that has the problem.
also include compiler version and what value the I2C pullups re and bus speed.
We need more information to help you. |
|
![](templates/subSilver/images/spacer.gif) |
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Mon Mar 26, 2012 9:17 am |
|
|
Thanks,
No pullups, i'm using NOFLOAT_HIGH instead. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9177 Location: Greensville,Ontario
|
|
Posted: Mon Mar 26, 2012 9:41 am |
|
|
I2C devices need the correct pullups, it's in the specs |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19382
|
|
Posted: Mon Mar 26, 2012 9:44 am |
|
|
Seriously get rid of this, and add resistors.
NOFLOAT_HIGH, can _only_ be used with slave devices that do not use NACK to mark the last transfer. It is _not_ compatible with normal I2C operation.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Mon Mar 26, 2012 9:50 am |
|
|
Thanks, but would this cause the code to hang? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
![](templates/subSilver/images/spacer.gif) |
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Wed Mar 28, 2012 3:14 am |
|
|
Thanks PCM, problem all fixed now. |
|
![](templates/subSilver/images/spacer.gif) |
|