Example program provided by Embedded Systems Academy, Copyright 2000 Visit www.esacademy.com/faq/progs for more examples This example: MASTER - name of application: main.c ==================================================== Demonstration of talking to a another I2C node on the I2C bus. Hardware requirements ===================== 2 x Phytec RDK 591 with Philips 591 Null modem cable (straight through connection) Software requirements ===================== Phytec Flash Tools (part of RDK 591) www.phytec.com Raisonance 8051 compiler system - EVAL version sufficient www.raisonance.com or Keil 8051 Compiler System - EVAL version sufficient www.keil.com Optional: Development Assistant-C by RistanCASE www.ristancase.ch SLAVE example. www.esacademy.com Tested using ============ Raisonance 51 Toolset version 6.1.1 Keil C51 Toolset version 6.00 Application description ============================================= Raisonance specific files have their names prefixed with 'r'. Keil specific files have their names prefixed with 'k'. The same source files are used for both compilers. This program sends a data byte to another 591 microcontroller the data depending on whether switch S1 or S2 is pressed, complete with error checking and timeout recovery. The function slave_write_byte does not return until either a successful transmission or an error. The function waits up to 22ms for the other 591 to be ready using a polling method. The status may be read in the variable i2c_status and will be I2C_OK or I2C_ERROR. The slave address must be F2H.