Thread: I2C signls
View Single Post
  #6 (permalink)
Old 8th June 2008, 09:41 AM
mkaras
CE - Apprentice
 
mkaras's Avatar
 
Join Date: 8th June 2008
Location: Oregon USA
I'm a Crazy Electrical Engineer practicing HW and Embedded FW Design Engineer
Posts: 11
Default Re: I2C signls

No you do not require I2C between the comparator output and the MCU. Just connect the outputs right to port pins of your MCU that your FW will setup as inputs. The FW can read all four port bits directly by accessing the port input register in the I/O section of the MCU.

You would be using I2C to connect up other devices that had a higher level of complexity. Several examples could include a temp sensor, a serial EEPROM or a port expander. In the latter case you may choose something like a port expander if your project has already used up all the port pins on the MCU and you still need more.

If you were to add an I2C bus to your design it takes two wires, SCL and SDA, each with pullup resistors, that would connect from the MCU to the various devices. For example if you had a temp sensor and a RTC chip both could be connected to these same wires as a "bus". You can drive the I2C bus prototcol from the MCU via a FW routine implementing what is often called a bit-banging approach or you could take advantage of an on-board I2C controller circuit that many modern MCUs have now days. For the second method the FW support to talk to the attached devices accesses internal registers of the onboard I2C controller.
__________________
- mkaras
mkaras is offline   Reply With Quote