C Control The I Unit-M Advanced 5 Vdc Inputs / outputs 16 x digital I/Os / 8 x analogue or digital I/Os Program memory 2 198805 Datenbogen

Produktcode
198805
Seite von 42
 
Syntax: OBJECT.instruction 
 
 
CONFIG.INIT 
CONFIG.GET MyByte 
MyByte = MyByte OR 00000001b 
CONFIG.PUT MyByte 
CONFIG.OFF 
 
The Example shows how to read/write  
a special bit to set up a configuration  
(here: PWM DACs to SERVO MODE) 
 
 
 
 
 
 
 
 
I²C-BUS OBJECT 
The IIC Object supports all basic functions to design I²C-Bus driver programs in an very easy manner. The 
I²C-Bus is connected to PORT 9 (SDA) und PORT 10 (SCL). An I²C-BUS error flag can be accessed at the 
CONFIG 1 register. Even Word sized values are accepted, the bus will transfer a single byte (Lo-Byte in 
case of a word) only  
 
Beside of the general INIT und OFF procedure the I²C-Bus Object supports some more I²C-Bus Object 
special Instructions required for Bus control. 
 
 
IIC.INIT 
Activate the Object to get access to its registers for read/write operation. Close other Objects prior to open. 
 
Syntax: OBJECT.instruction 
 
 
IIC.START 
IIC.STOP 
Send a START CONDITION prior to any bus access. Send a STOP CONDITION to terminate bus access 
 
Syntax: OBJECT.instruction  
 
 
IIC.GET 
IIC.INIT 
IIC.START 
IIC.SEND MyAddress 
IIC.SEND MyByte 
IIC.STOP 
IIC.OFF 
IIC.SEND 
Access the I²C bus to read/write a binary value. 
 
Syntax: OBJECT.instruction Variable 
 
variable:
  Variable, value or constant which is moved to the 
                Bus at write acces.  
                Variable the value is moved to at bus read access. 
                Valid for word and byte size. 
 
 
The Example shows writing the value Mybyte to a I²C Bus device at address MyAddress 
 
IIC.OFF 
Close the Object prior to open any other Object. 
 
Syntax: OBJECT.instruction 
 
 
 
 
 
23