Datasheet
Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub procedure OW_Write(dim byref PORT as byte, dim Pin as byte, dim par as
byte)
Description Writes one byte (<par>) via 1-wire bus
Example
OW_Write(PORTA, 5, $44)
5.2.18 Software I2C
BASIC provides routines which implement software I2C. These routines are hardware independent and can be used with any
MCU. Software I2C enables you to use MCU as Master in I2C communication. Multi-master mode is not supported.
5.2.18.1 Soft_I2C_Config – Configure the I2C master mode
Prototype
sub procedure Soft_I2C_Config(dim byref Port as byte, const SDA,const SCL)
Description Configure the I2C master mode.
Parameter <Port> specifies port of MCU on which SDA and SCL pins will be located;
parameters <SCL> and <SDA> need to be in range 0..7 and cannot point at the same pin;
Example
Soft_I2C_Config(PORTD, 3, 4)
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (102 sur 112)05/11/2004 02:20:55