Last Update: 11/08/08

PRODUCTS
CANPORT
CANTEC11
CAN232

Phone:                    (248)477-6639

Last Update:11/08/08

 

PIC Project #1 - RS232 to I2C Interface

The I2C232 provides an RS232 interface to the I2C bus. The interface uses ASCII commands for use with any terminal program.

The MicroChip PIC16C63 provides the intelligence and both the SCI and I2C peripherials to power the I2C232 adapter.

For more information on the I2C interface, look at the pdf file from Philips Semiconductor - The I2C Bus and how to use it.

The I2C232 uses the PCB from the CAN232 with the appropriate jumpers to bring the SCL and SDA lines to the connector. Photo shown with parts. wpe4.gif (19084 bytes)
The I2C232 is available for custom applications. Send your requirements to Emicros for a quote. wpe5.gif (19103 bytes)

The software sample is written in C for a specific application. A general purpose interface is not available at this time but is planned for the future. The information detailed here should provide the basic framework for designing and implementing your I2C application quickly and efficiently.


Requirements

Provide a simple interface device ideally suited for interfacing a PC (or similiar device) to an I2C bus. Commands must use simple ASCII characters as commands.


Schematic

 wpe3.gif (15866 bytes)

top


Hardware Description

The I2C232 uses a PIC16C63 (click here for data sheet) from Microchip. The PIC16C63 (U1) contains a serial interface and an I2C interface and makes this project simple and yet very powerful. The ceramic resonator, Y1, provides an 8 Mhz clock frequency.

Power to the module is provided through connector J1 pin 1 with pin 2 providing the ground. Diode D1 protects against reverse voltage and Z1 clamps the input voltage to save levels. Voltage regulator U3 converts the input voltage to +5 volts.

The MAX232 (U2) converts the +5 volt signals from the micro to RS232 levels. Connector J1 is a 25 pin female connector (DB25).

top


Software Description

The software is written in C and compiled using the CCS C Compiler. I recommend this compiler as the $99 was a small investment that saved alot of time.

The C source file pici2c.c contains the RS232 interrupt service routine that collects the commands. After the command is captured the main() function processes the RS232 command into an I2C message. The sample shown is application specific but can be tailored to any other application.

top