AFC, Auto-Flow-Control

 

First:

Up to our knowledge Twister (Twister1200 or on top of Unity) is the only serial interface board for Amiga which offers AFC besides the traditional mechanisms. The following text will try to explain why this is very important.

Some History and Background Information:

In former times the Amiga was known to be a Computer which took a majority of its performance not from the main CPU but from its Chipset. The chipset offered Coprocessors for sound, graphics and more. Unfortunately the engineers did not design a serial interface having equivalent strength because of price. While the chipset supplies the data, an additional interface chip (CIA) is used for handshake. The chip was done for the predecessor of the 68000 CPU and nearly the same device can be found inside the legendary C64. When used at Amiga the 68000 CPU has to slow down to 10% of it's native access speed.

At the early years of Amiga the lack was not noticeable because of very slow modems. Allthough people clearly noticed the trouble at faster Null-modem connections. As said before the chipset offers the data while an external unit has to handle the handshake. It is telling the communication partner when to go and when to wait. When having a closer look to the mechanism the limitation might get clear. The chipset is able to temporary store one character a time for sending direction an the same for receiving direction. If the interface would not be cut into two pieces the chipset could offer and get the characters by using a simple hardware based algorithm. Unfortunately there are some lines of code (so-called Interrup-Handler) at the AmigaOS which are controling the cooperative work of the chips. Beside handling the data flow in both directions it has to sign a temporary stall to the machine on the other end of the line. This is the mayor reason for following kind of trouble:

 

  1. The CPU has to interrupt its normal work any time one character is reaching the serial receive buffer. This is hard work and strong overhead even for modern CPUs which have to store/restore their internal state each time and kill the cache, too. At 57,000 BPS in one direction (download only) this happens 6,000 times per second. This load is strongly wasting CPU power for a very thin job (By the way please don't have a look at CPU monitors - CPU time which goes into IRQ handlers is simply stolen from the overall time).

  2. Addditionally it is required to have a software which is able to offer a response time of less than 1 / 6,000 sec to get the character out of the hardware before it is getting overwritten by the next one. The AmigaOS has got a nice design and offers response which is fast enough to match this requirements - at least most time. All people will have noticed a message "buffer overrun" or something equivalent f.e. at the terminal programm. That's exactly what happens if CPU/Software combo was not fast enough to get the charater in time or sign a slow-down. A character got lost. It was overwritten by the next one.

  3. This topic should better be called 2b: Additionally there is a further problem at Amiga. A well conveived computer has got Interrupts to sign something. There is even a convention for a driver programmer to cause a minimum tripping delay time when IRQs are handeled. The movement of data on the other hand is done via DMA, the direct access to memory by the extension itself, not CPU! Unfortunately the Amiga is no more able to do DMA. This was caused by unsuitable rigging of the machines and limitations inside the chipset. That's a real bad thing and one of the reasons why the mainboards are very obsolete. This is particularly unfortunate for extensions which need a constant data stream, e.g. any sound card. To give a sound card the capability to do noly-breaking sound it has to inevitably the INTERRUPT to move the data. That however has consequences for other extensions which require likewise constant data rates. The reaction delay to INTERRUPT requests simply rises strongly. As said before the Amiga allready fails to serve the unnecessarily extremely high requirements of the serial interface. Finally the the interface even fails for very low rates if another streaming device is runnin in the system.

Having this in mind it's allready allmost unimportant how high the possible datarates on a serial interface could be. Real live throughput anyway is only a fraction of the physical maximum. The line drivers which are used at Amiga are not able to communicate faster than 115,200 BPS without violating the EIA RS-232 standard.

What do today's interface modules offer?

For the Amiga there are several serial interface cards. They try to fix the described probems with different effectivity. All newer extensions make use of the 16Cx50 family of chips. Therefore it's not too difficult do a comparsion. A higher number for the "x" means more enhanced capabilities. Well known chips are 450, 550, 650. The 16450 is called generation one in the following text.

  1. Generation: The 450 is used at old PCs. Please don't ask yourself why it moves only 10% of the CPS rate expected when having a setup of 115.200 BPS with an old '368. The chip no better than the stuff used at Amiga chipset.

  2. Generation: The 550 offers 2 x 16 characters buffer for send and receive. If it would be possible to use the full size of the buffers the CPU could visit the chip only one time each 16 characters. At least for the sender it fact works fine. For the receiver a tradeoff between overrun errors and efficiency must be made. A programmer of a driver has to use something between 1 and 16 characters of the buffer (strong tendency to 1) to prevent too many overruns. This means the CPU load stays high for the receiver routines. A simple modem is still fast enough to slow down the machine.

  3. Generation: Based on the experiences of the predecessors the 650 was done years ago. At that family it's the first time the buffers are directly connected to the handshake lines of the interface. Additionally the size of the buffers was extended to 2 x 32 characters. As soon as the chip detects missing space at receive buffer it signs a wait state immediately. The job of the CPU is limited in moving data when the chip reports a predefined fill level via an Interrupt. The enhanced mechanism is called automatic flow control. While the buffering worked fine and causes a low load to CPU another problem was detected. Some peripheral devices (f.e. MODEMs) respond to the handshakelines very slowly. This fact can cause a major drop-down of the overall transfer speed. Sometimes it might be helpfull to take a higher Bitrate setting for the interface. Unfortunately cheaper modems don't support high rates or response delay increases, too. The chip is slightly more expensive than the 550 used at most other interfaces.

  4. Generation: The 750 is done as a result of all that experiences. Beside a doubling of the buffersize to 64 chars each the autoflow capability was enhanced again. An inteligent driver is able to reduce delays caused by handshake to a minimum. This device was focused for Twister1200 rev.2 but today price is the only base for sales. The chip is again more expensive than the 650 and can't be used as long users don't recognice the difference and ask for it.

  5. Generation: The greatest chip of the family done is the 850. The changes are 128 bytes of buffer each and a build-in IRDA interface. This is even the mayor reason to increase the buffer to 128. The Autoflow works perfectly with this device and probably can't made better. This chip even can't be used at Amiga because of missing demand of users for its features.

Which features does the interface board offer?

We stopped trying to make fair comparsions to other boards. Keep in mind Twister is the only one for Amiga which really offers AFC additionaly to the old de-facto polling approch. It has got a driver which really makes use of the AFC capability if you like. Additionally it makes use of a powerfull line driver which usually is only used at much more expensive boards and typically drives 691,200 BPS (460,800 min.) safely. Since a generic user does not know about autoflow and wouldn't honor a higher price the 750 and 850 boards will probably never appear in series boards (increases price about USD 5). As said before your modem might prevent Twister from doing usefull transfer speed. If you can't fix it by increasing the BPS rate, you might better disable the AFC feature with the tool which comes with the board. You still make use of the bigger buffers compared to other boards. You might run into trouble when using a soundboard the same time, though. At least it works much better than the internal serial.

A look at other computer systems:

Don't expect modern machines are using nice chips on their boards. Some manufacturers tried to do so, but nobody payed attention (the guys from Seatle included). People simply don't care too much for a better chipset if it's more expensive. On the other hand there are expansion cards available which are strongly used by professional users (mostly Unix machines). They offer low system load even when a number of ports is running in parallel. The Mac made use of a really nice DMA driven Chipset from 1991 to 1998. Today it's replaced by USB. Bitrates of 230,400 BPS up to 1,000,000 BPS at strong CPS rates caused very low load, too.