|
|
|
Bean
SW_I2C
|
SW emulated I2C using two I/O pins.
Parameters of the bean.
|
Properties:
-
Bean name - Name of the bean.
-
Data pin - CPU general input/output pin used as the Serial Data pin (SDA) of the I2C interface. This pin should be connected to the Serial Data line (for details about settings see Bean Inheritance & Bean Sharing).
-
Clock pin - CPU general input/output pin used as the Serial Clock pin (SCL) of the I2C interface. This pin should be connected to the Serial Clock line (for details about settings see Bean Inheritance & Bean Sharing).
-
Mode selection - Operating mode selection. This property selects MASTER or SLAVE mode of the I2C interface.
-
Slave address - When working as a SLAVE, this property determines the slave identification address of this I2C interface. The bean in the slave mode uses 7-bit slave addressing. Possible values are from 8 (0000100) to 119 (01110111). The other values are reserved for other purposes of I2C bus, for further information see I2C bus specification. This property is not available for the MASTER mode.
-
Clock timeout - When working as a SLAVE, this property determines a timeout of the clock pulse polling. The property value represents (2^timeout – 1) tests of each clock pulse of the Serial Clock line (SCL). The Processor Expert (TM) does not guarantee any exact time value for the clock polling. The lower value of this property should be used for faster communication or the higher value for slower communication. If the timeout value is elapsed, methods return ERR_BUSOFF error code. This property is not available for the MASTER mode.
-
Output buffer size - When working as a MASTER, this property determines output buffer size, possible values 0 - 65535 bytes. This property is not available for the SLAVE mode.
-
I2C bus mode - When working as a MASTER, this property determines the I2C specification. Possible values:
"STANDARD MODE" - serial clock frequency is less than 100 kHz (I2C Standard Mode)
"FAST MODE" - serial clock frequency is less than 400 kHz (I2C Fast Mode)
"UNLIMITED" - serial clock frequency is higher than "FAST-MODE" (value not specified)
This property is not available for the SLAVE mode.
-
Automatic stop condition - When working as a MASTER, the stop condition is automatically sent at the end of send/receive methods to terminate the communication or the stop condition has to be sent by SendStop method, which allows to make the combined format of communication on the I2C bus, i.e., the send/receive methods are not automatically terminated by stop condition. In this case, after any send/receive method another send/receive method or SendStop method has to be immediately called. This property is not available for the SLAVE mode.
-
Acknowledge polling trials - When working as a MASTER, this property determines a number of trials (1 .. 65535) to get the slave acknowledgement. If acknowledgement is not detected during trial loop, it is assumed that slave returned NACK (not acknowledge). If trials equal to one, no polling is provided and the serial data line is checked for a valid acknowledgement one time. The minimum recommended value is 2000. This property is not available for the SLAVE mode.
-
Initialization - Initial settings (after power-on or reset).
-
Slave address init - When working as the MASTER, this property determines the slave address initialization value of a slave device to be communicated with. The range of the value is from 8 (00001000) to 123 (011111011), the other values are reserved for other purposes of the I2C bus. The values from 120 (01111000) to 123 (01111011) involve 10-bit slave addressing (011110XX), including two MSBs of the slave address (XX). The address may be changed by SelectSlave method. This property is not available for the SLAVE mode.
-
Enabled in init. code - Enabled in initialization code.
-
Events enabled in init. - Events enabled in initialization.
-
CPU clock/speed selection - Settings for the CPU speed modes: identifies whether the bean is supported or not.
|
|
|
Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.
|
|
|