• Part: AN541
  • Description: Using PIC16C5x as a Smart IIC Peripheral
  • Manufacturer: Microchip Technology
  • Size: 141.67 KB
Download AN541 Datasheet PDF
Microchip Technology
AN541
AN541 is Using PIC16C5x as a Smart IIC Peripheral manufactured by Microchip Technology.
.. Don Lekei NII Norsat International Inc. Using a PIC16C5X as a Smart I2C™ Peripheral Author: FIGURE 1: I2C TIMING INTRODUCTION PIC16C5X microcontrollers from Microchip are ideally suited for use as smart peripheral devices under the control of the main processors in systems, due to their low cost and high speed. They are capable of performing tasks which would simply overload a conventional microprocessor, or require considerable logic circuitry, at a cost petitive with lower mid-range PLDs. To minimize the engineering overhead of adding multiple controllers to a product, it is convenient for the auxiliary controllers to emulate standard I/O peripherals. A mon interface found in existing products is the I2C bus. This efficient, two-wire, bi-directional interface allows the designer to connect multiple devices together, with the microprocessor able to send data to and receive data from any device on the bus. This interface is found on a variety of ponents, such as PLLs, DACs, video controllers, and EEPROMs. If a product already contains one or more I2C devices, it is simple to add a PIC16C5X emulating a patible ponent. This application note describes the implementation of a standard slave device with multiple, bi-directional registers. A subset of the full I2C specification is supported, which can be controlled by the same software which would talk to a Microchip 24LCXX series EEPROM. t SH Start t CL t CH More Bits Stop Data Bit 1 1 0 1 1 1 1 R/W A SDA SCL Each byte of a transfer is 9-bits long (see timing chart in the program listing). The talker sends 8 data bits followed by a '1' bit. The listener acknowledges the receipt of the byte and gives permission to send the next byte by inserting a '0' bit over the trailing '1'. The listener may indicate "not ready for data" by leaving the acknowledge bit as a '1'. The clock is generated by the master only. The slave device must respond to the master within the timing specifications of the I2C...