Oops:
What are the suggested resistance values for the data and clock lines for I2C?
should read: What are the suggested pull up resistance values I should use for the data and clock lines for I2C?
Thanks,
Troy
Oops:
What are the suggested resistance values for the data and clock lines for I2C?
should read: What are the suggested pull up resistance values I should use for the data and clock lines for I2C?
Thanks,
Troy
"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"
-Stephen Hawking
Hi,
I've never actually done anything with I2C so I'm no expert - by far.
But, in case there's some confusion, the I2READ / I2CWRITE commands are both bit-banged routines meaning they do not use the I2C peripheral (the MSSP-module) built into several PICs. This means that there really are no registers to setup except enabling the pin to work as a digital I/O, ie. make sure any analog functions are turned off on the pins in question. It also means that you can use "any" pins for the I2C-lines, not only those designated SDA and SDL in the datasheet - those are for the MSSP module which I2CREAD/I2CWRITE doesn't use.
/Henrik.
Thanks for that guys! I'm really glad I asked! Your intuition was spot on Henrik, I was under the naive impression PBP used the MSSP module of the PIC.
Cheers,
Troy
Henrik and co,
Just to clarify, do I need a port with digital I/O capabilities to function for PBP's I2C communications or can I use a digital input only port? I'm using the PIC micro as the master only.
Thanks,
Troy
Ok, I'm really confused regarding Pic Basic and i2c at the moment. I've experimented with a simple circuit with a PIC18f13k50 using the Pic's official i2c data and clock pins and the thing worked (eventually). I've kinda transferred that same Pic(micro) and code to an established circuit that only had 2 different pins/ports available ie. not the MSSP module's i2c data & clock pins. It doesn't work. Can I gather some clarification on what pins are available for i2c use in general?
Thanks,
Troy
Hi,
Like I said earlier, I've got no experience with I2C but as far as I understand both signal pins must be digital outputs. I think that it should work on pins with open drain output (ie, pins which can only switch to GND). Pins that are input only won't work as far as I understand.
So, any two pins which can function as digital outputs should work. Make sure any analog functions on these two pins are disabled. If you need help, tell us which chip it is and post the code.
/Henrik.
Bookmarks