View previous topic :: View next topic |
Author |
Message |
JamesW, kent, England Guest
|
Multiple I2C busses on one processor |
Posted: Thu Aug 06, 2009 10:37 am |
|
|
Hi Folks,
Simplest question ever.
I have an application where I need to use 15 MCP23008 I/O expanders. Problem is - there are only 8 available addresses to use.
Can I do the same with #USE_I2C as you can with #USE_RS232 and create multiple I2C ports on a PIC?
Or is it a little more complicated than that?? If it is, can anyone recommend a more elegant solution please?
Thanks in advance
James |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 06, 2009 10:56 am |
|
|
Yes, just create two i2c busses. Each of the two busses will have its own
#use i2c statement, which defines the i/o pins used by the bus. Each
bus must have its own set of pull-up resistors on it. The compiler
supports named "streams" for #use i2c(), similar to #use rs232().
See the manual. |
|
|
JamesW, kent, England Guest
|
|
Posted: Thu Aug 06, 2009 11:13 am |
|
|
Thanks for the help
James |
|
|
|