*==========================================* # Hacker Port - Motivation and Description # *==========================================* The Old Hacker Port =================== Almost every hardware hacker who has connected some of his homemade hardware to his PC has used the parallel port for this purpose. The reason is the ease to control every single bit of the 12 outputs and 5 inputs individually and emulate almost every digital interface with the parallel port or with even multiple ones if more pins are needed. Over the time, various devices were connected to to the PC that way and the parallel port became also known as the hacker port. The Problem =========== A few big companies have decided to remove the parallel port from the modern PC. This is understandable, because the parallel port hardware still uses the 8-bit ISA bus which is very slow. Also in PCs with a CPU clock frequency of some GHz, an access to the parallel port (i.e. the x86 out or in instruction to this IO port needs about 1 us. This is very much compared to the time of less than 1 ns needed by a move instruction (1000 times slower). To eliminate the slow ISA bus which is already no more available for expansion cards on modern motherboards, the parallel port has to be removed, too. According to the big companies, the parallel port will be replaced with the Universal Serial Bus (USB). The USB does not allow easy control of its pins, because it uses a rather complex serial protocol to achieve it's speed of 12 MBit (USB version 1.1) or even 480 MBit (USB 2.0). So the replacement of the parallel port will result in a PC with no hacker port. The effect can already be seen very clearly when looking at newer notebooks. Nowadays, they often do not have serial ports and some already do not have a parallel port. It can be expected that the parallel port is unavailable for most PCs in a few years, because the number of serial ports on most motherboards has already decreased from two to one or even zero. A Possible Solution =================== To solve this problem, it would be possible to use an USB interface in every homebuilt hardware item that shall be connected to the PC. Of course, this is expensive, needs much time for the development and is not comfortable to use for less experienced hardware hackers. So the idea is to develop a realtively universal and relatively cheap hardware that connects to the USB and provides an interface somewhat similar to the parallel port. If the software, the scematics and probably even a printed circuit board design is provided for free on the net, everybody with a little bit of experience in hardware hacking will be able to build such a device and use the new interface for purposes he would have used the parallel port. Because of the additional interface logic needed for this device, not all features of the parallel port will be able to replicate. For example the IRQ line connected to the ACK pin of the parallel port is not simulatable using USB, because USB is polling based a protocol. The PC periodically asks every device if they want to send something. This makes it impossible to realize some kind of real interrupt and leads to a relativly high delay for all actions of about 1 ms. But it's better to have some individually controlable pins with a high delay than to have none at all. :-) Some standard tasks that need a faster reaction can be realized by the microcontroller in the new device that is needed anyway because of the USB protocol. The New Hacker Port =================== At the moment, I'm developing the prototype of the hacker port. It will mainly consist out of an USB 1.1 interface chip and a microcontroller. I've chosen to use the old USB 1.1 for two reasons: First, I do not know any USB 2.0 chip that is solderable by hand for everybody (due to the small pins). Further, there are still some hardware hackers out there that have got an old notebook that does not have any USB 2.0 ports. Everything I'll develop for the hacker port will be released under the GNU public license. This will enable others to contribute, ensure that the device is usabale by everbody and also ensure that no evil company makes much money with it. Features Of The Hacker Port =========================== connection to PC via USB 1.1 ---------------------------- This is chosen, because USB is the will be the new standard port for connecting devices to a PC. It is also possible to power the device from the PC when using USB. USB 2.0 is not chosen because there are no chips with reasonable pin size and not everybody has got USB 2.0 yet. 16 digital outputs & 16 digital inputs -------------------------------------- IO pins were the main reason to develop this device. So there are 16 output and 16 input pins for anything to do with them. Because of the USB latency it is not possible to write the outputs or read the inputs more often than every millisecond. 2 pulse width modulation (PWM) outputs -------------------------------------- Perhaps one would want some kind of analog output. But analog outputs are hard to realize with digital electronic. So an signal alternating between LOW and HIGH is used. This signal has always got the same frequency but the percentage of the on-period is changed between 0 and 100. Maybe, the frequency will become configurable later... examples: 0% -------------------------------------------- ---- ---- -- 20% -- ---------------- ---------------- ---------- ---------- -- 50% -- ---------- ---------- ---------------- ---------------- -- 80% -- ---- ---- -------------------------------------------- 100% The number of 2 was chosen, because the processor has got 2 PWM pins. 5 analog inputs --------------- Analog inputs are useful when reading in variable resistors or temperature sensors. Well, the processor has got has got 5 analog inputs, so why not use them? You will make of them for sure. :-) I2C master ---------- Serial EEPROMS, IO expanders, some sensors and a lot more are controlled via the I2C bus. Mostly, these little devices are I2C slaves, so the hacker port will be a I2C master. The processor is also able to be a slave or operate in I2C multi master mode. Maybe, these two other modes will be added later... UART ---- This is quite the same as the serial port in a PC. But the microcontroller only provied the RX and TX pins. So hardware handshaking via RTS and CTS will not be possible... JTAG interface -------------- The hacker port will be able to be a JTAG master. This can be used to program and debug a number of microcontrollers and FPGAs. E.g. AVRs use this interface. The hacker port will not be able to be debugged by JTAG. PIC programmer -------------- A PIC microcontroller is used in the hacker port. Of course, the hacker port must provide a possibility to program another PIC. Thus it is possible to program the PIC18F442 for a friend so that he can build his own hacker port... About This Document =================== Date: 2004-04-30 Author: Stefan Schuermans <1stein@schuermans.info> This document is published under the GNU public license. Further Information =================== http[s]://1stein.schuermans.info/hackerport/ http[s]://1stein.schuermans.info/