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 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 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. |
|
|
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Mon Mar 26, 2012 9:17 am |
|
|
Thanks,
No pullups, i'm using NOFLOAT_HIGH instead. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Mon Mar 26, 2012 9:41 am |
|
|
I2C devices need the correct pullups, it's in the specs |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
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 |
|
|
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Mon Mar 26, 2012 9:50 am |
|
|
Thanks, but would this cause the code to hang? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
cwedgwood
Joined: 16 Mar 2012 Posts: 12
|
|
Posted: Wed Mar 28, 2012 3:14 am |
|
|
Thanks PCM, problem all fixed now. |
|
|
|