<LOGO> ElectroMac
Chapter 1 - Overview & Introduction

In this investigation I plan to study an interface which I built for the Macintosh called 'ElectroMac'. For the rest of this chapter I will introduce interfacing in general. In the later chapters I will then go on to describe ElectroMac's hardware, firmware and software. In chapter 2 I will describe the hardware and firmware, in particular the command set used to communicate with ElectroMac. Finally chapter 3 will describe the software I wrote for the Macintosh to control and communicate with ElectroMac.

Interfaces are all around us in one form or another. They allow computers to control electronic circuits. The best example of this is traffic light control, computers and video cameras are used to monitor traffic throughout the city. There are sensors in the road to count the number of vehicles. The computer cannot normally receive this data and turn on and off the lights. There is an 'interface' between the computer and the lights, allowing the computer to switch the high voltages.

Very often interfaces are part of the computer system rather than a separate unit. A separate interface 'box' is more often used in an experimental environment such as in a laboratory, classroom or workshop. These have general purpose sockets allowing the user to easily connect and rearrange the connection of devices.

Interfaces can also monitor Analogue signals - a range of voltages rather than just on or off. This could be used to monitor temperature, pressure, position senors, speed sensors. A good example of this is something like the UK super car, Thrust SSC which broke the land speed record. During the test runs sensors were placed all over to measure every little change in the car. Sensors measured the stress and strain in key areas of the car, and fed the results into the computer. These could then be analysed after the trial run.

Unfortunately there are very few electronic interfaces available for the Apple Macintosh computer and the ones that exist are very expensive (200-400). For this reason I decided to build my own interface called ElectroMac. It has 8 digital inputs and outputs and 2 analogue input and output channels. It connects to the Macintosh via serial (Modem or Printer ports).

ElectroMac features:
  • 8 Opto-Isolated input lines.
  • 8 output relays.
  • 2 10-bit analogue inputs (0 to 2.5v)
  • 2 16-bit analogue outputs (0 to 2.5v)
  • Interrupt on input change
  • Serial communication at 38.4kbaud
Because this is a Computing investigation I will not go into any detail about the electronics involved. The centre of ElectroMac is a PIC16C64 microcontroller. Microcontrollers are a small computer processors which are built into a control applications from traffic light controllers to washing machines. They execute programs in machine code turning on and off outputs and responding to inputs. The PIC is a microcontroller made by Microchip, an American electronics manufacturer. PICs are used a lot by hobbyists because they are self contained and required very few external components. They have built in RAM and ROM program memory so there is no need for complex bus circuitry. The PIC16C64 is a 40-pin device giving 33 I/O pins. It has 2k of program memory and 128 bytes of RAM. ElectroMac has a 20Mhz clock allowing it to communicate at high baud rates accurately. ElectroMac uses Maxim A/D and D/A chips to convert the analogue signals.

©1998 Nicholas Humfrey <e-mail> <www>