View previous topic :: View next topic |
Author |
Message |
SBS
Joined: 15 Aug 2005 Posts: 18
|
General i2c question... |
Posted: Tue Sep 27, 2005 9:43 pm |
|
|
From what I've read, you can have either a HW i2c or a SW i2c...
Can you have multiple i2c connections to other hardware with one PIC?
My application requires me to connect to an LCD display, AD converter and a Keypad. From what I've read, I can define an i2c protocal with #use i2c(...).
This can be set up to use the hardware i2c or a software (bit banging) i2c.
How can one set up two? One HW one SW?
Thanks,
Sal |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Tue Sep 27, 2005 9:47 pm |
|
|
Why would you need two? Can't you hand all of your I2C devices on the same bus (be it h/w or s/w)? Do addresses conflict that badly? |
|
|
SBS
Joined: 15 Aug 2005 Posts: 18
|
|
Posted: Tue Sep 27, 2005 9:57 pm |
|
|
DOH! I knew that!
Thank! |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue Sep 27, 2005 10:40 pm |
|
|
kender wrote: | Why would you need two? Can't you hand all of your I2C devices on the same bus (be it h/w or s/w)? Do addresses conflict that badly? |
You may want more than one bus if you are dealing with divices that support different bus speeds (such as 100K versus 400K) and you need to talk to one at high speed. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Sep 28, 2005 6:47 am |
|
|
Or say that you are talking between PICs with I2C and each PIC has its own external EEPROM. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Sep 28, 2005 8:18 am |
|
|
or 5V and 3.3V
and keep like devices together on a bridge |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Fri Oct 07, 2005 5:52 pm |
|
|
Mark wrote: | Or say that you are talking between PICs with I2C and each PIC has its own external EEPROM. |
That's an interesting one. I wonder if it's possible to do this with just #use i2c(...) and without writing custom I2C bit-banging code? |
|
|
Joshua Lai
Joined: 19 Jul 2004 Posts: 42 Location: Malaysia, PJ
|
|
Posted: Fri Oct 07, 2005 9:44 pm |
|
|
asmallri wrote: |
You may want more than one bus if you are dealing with divices that support different bus speeds (such as 100K versus 400K) and you need to talk to one at high speed. |
How to do that? How to specificy i2c speed in #use i2c(...)?
If not specify, what is the default i2c speed? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|