BRAK Project-> Design info-> Electronics-> I2C card



Quik links

The BRAK Project
What's new
Project background
Design info
Student projects
Photo gallery
Vendor info
Related projects
Relevant links
Site map
Project timeline
The Next Generation

Brak E-mail
Engineering
Pacific

Page maintained by
khughes@uop.edu

I2C Bus Interface Card


(click photo for full-size image)

This card is designed to interface between the PC and auxiliary controllers using the I2C serial bus. It plugs into an 8-bit ISA bus slot on the PC. The ultrasonic controller and motor controller have been converted to use the I2C bus for communications. The advantages of this are (1) the boards can mounted outside the PC case for easy access and (2) valuable bus slots in the PC aren't used.

The card uses an on-board microcontroller which has an integrated I2C bus interface built in to coordinate the actual communications on the serial bus. The PC communicates with this controller using a SRAM buffer on the card and logic which controls who (the PC or the microcontroller) can access this buffer. A normal transfer would be for the PC to place information into this buffer, then signal the control logic that the microcontroller should be activated. The microcontroller then reads the information from the buffer, interprets what to transfer over the I2C bus, then places a status code (and possibly data read from the bus) back into the buffer. It then signals the control logic that it is finished and that an interrupt should be sent to the PC. The PC can then read the information from the buffer.

This card uses a Philips Semiconductor 8xC652 microcontroller, an Altera Corporation EPM7064LC44 FPGA, a 74245 octal bus transceiver, and a 8Kx8 SRAM (only 16 bytes are actually used, but these devices can be found for about $1 apiece). The 8xC652 features a built-in I2C bus interface. This device is configured to be a master on the bus and in the current Brak system is the only master, even though the I2C bus is designed for multi-master applications. We're specifically using a P80C652FBA 44-pin PLCC microcontroller which is ROMless (which means we also have to add a 27C256 32Kx8 EPROM and 74LS573 octal address latch for development) but a final design can use a OTP version of the controller. The card has a jumper which allows either ROMless or OTP devices to be used. The EPM7064LC44 provides the control logic between the PC and the 8xC652, as well as controlling all access to the SRAM buffer. It generates the read, write, enable, and address logic for the buffer. The 74245 controls the direction of data transfer between the buffer and the PC bus; when the microcontroller is accessing the buffer this latch prevents data from appearing on the PC's bus.

This card was designed in spring of 1996 and wirewrapped in the summer of 1997. After testing indicated that the prototype really worked (this was my first attempt at anything using an Altera FPGA) a printed circuit board was manufactured in winter of 1998 and will be used on Brak starting the summer of 1998.

Since Brak runs the Slackware distribution of the Linux Operating System, we have also had to write device drivers for this card. A good reference for anyone attempting to do this is "Linux Device Drivers" by Alessandro Rubini, published by O'Reilly and Associates. The device driver for this card has to handle the other I2C bus boards in the system in addition to the card itself. Writing the driver was an experience in familiarizing myself with timing issues in an operating system, the kind of thing I hadn't done in many years. Anyway, the device driver works as a loadable kernel module which can be installed easily into the kernel on boot-up.

The C program development for the 8051 itself was (and is) conducted in a convoluted manner which I won't go into here. I included this source for reference. Future plans will be to port the source (if possible) to one of the freeware 8051 compilers which I've only recently discovered. In the meantime the assembly files can be assembled with the ml-asm51 assembler. They are byte-for-byte compatible with the Intel HEX format files.

Parts List

Part numberDescriptionQtyPrice
Newark Electronics
33T EPM7064LC44-15Altera FPGA 1 $5.35
Marshall Industries
P80C652FPAAMicrocontroller, byte-oriented I2C interface 1 $10.00
Jameco Electronics
42892SRAM, 8Kx8 DIP-28, 150ns 1 $2.49
Mouser Electronics
511-M74HCT245Bus transceiver, octal 1 $0.92
511-M74HCT573Latch, octal D-type 1 $0.81
511-M27C256B-15FEPROM, 32Kx8, DIP-28 150ns 1 $3.57
151-1544IC Socket, PLCC-44 tin thru-hole 2 $1.34
73-XT49S1600-20 Crystal, 16MHz, HC-49/US 1 $0.73
571-26403623IC Socket, DIP-28 0.600" thru-hole 2 $0.14
571-26404643IC Socket, DIP-20 0.300" thru-hole 2 $0.10
154-UL6641PCB modular jack, RJ11, 6 position/4 contact 4 $0.87
571-34356400DIP switch, 3 position 1 $1.37
517-6121TGHeader, 0.100" double row, 80 contacts 1 $1.66

Board designs

  • V1.0 Schematic in Adobe PDF (19Kb)
  • V1.0 Schematic in PostScript (136Kb)
  • OrCAD Schematic files and libraries
  • Gerber 274-X format

Software

Tools (programs you may need)


Create FREE graphics at FlamingText.com