I2CThe I2C object provides a two wire communications bus which can be used for communicating with I2C devices (e.g I2C EEPROMs) and also other CPUs.
The I2C bus can be driven from
Using a timer interrupt driven I2C bus allows comms to be performed as a high priority foreground task.
Simulation DetailsThe I2C object generates machine code which is directly executable in the target system. No additional debug code is generated for the target when the simulator is used in place of a real CPU. Signaling between different CPUs is performed by reading from and writing to real CPU I/O ports. The simulator uses XPUT objects mapped directly to the CPU's I/O ports to route the signals between simulated CPUs (see INPUT objects for further information).
Code GenerationThe I2C object has several properies associated with it which are used to guide the code generator during the code generation phase. These properties are accessed via the I2C settings object dialog.
The properties are:
Adding I2C Objects To A DesignNormally a I2C object is added to a design by copying it from the template window to the drawing window or from an existing I2C object already on the drawing window. It must form part of a CPU if code is to be generated for it. This is done by placing it within the perimitor of a CPU object and using the I2C objects add to group function or gather function to tie it to the CPU.