In this chapter we will explain the way the RaPID Real Time board works. The principle is illustrated in figure 2.1.
The board generates pulses of 1 micro second on the I/O CHCHK pin of the ISA connector. These pulses originate from the counters on the board or from an external source. Take care to put the jumpers in the correct location to have the correct external voltage or frequency range.
If the internal timers/counters are used, only the jumper of the frequency selector must be set to the correct location (see Figure 1.4). For external timing signals the frequency selector must be set to the EXT pin and the 2 voltage selector jumpers must be set to the correct voltage. (see Figure 1.5)
This timing signal is, after some processing, immediately send to the NMI pin of the micro processor of the PC. If an edge is seen by the processor on this pin it thinks that there are serious problems with the ISA cards. This i however not true, but Windows 95 does not see the difference. The virtual machine manager (VMM) of Windows 95 gives immediately control control to a NMI service routine. Normally this routine notifies the user of the problem and most of the time the computer then crashes. The RaPID real time software consists of an NMI service routine that, instead of notifying the user for serious problems, performs all the measurements, the calculations of the controller and the supervision of the plant. After the control task is performed control is returned to Windows 95. The advantage of using the NMI interrupt instead of the normal interrupt lines is that this NMI interrupt has the highest priority in the PC. The normal interrupt lines generate signals that are processed by the Windows 95 kernel. There is always a lot overhead from this kernel and the highest priority interrupts in Windows 95 have still a lower priority as e.g. the handling of swapping of the computer memory. The use of the NMI guarantees a response within microseconds. The interrupt routine, which does all the computing and the measurements, runs at ring 0, which means at the same level as the kernel of windows itself. The service routines of the normal interrupt lines run at ring 3. Since all other interrupts are disabled during NMI processing, the control is only given back to the Windows 95 kernel after all the computations and measurements are done. This method therefore guarantees an immediate response when the RaPID Real Time board generates a pulse.
NMI's can be also generated by other devices. For instance the parity check of the memory of the computer and the watchdog timer generate also NMI's. The NMI service routine checks the source of the NMI. Parity errors and watchdog timeouts NMI's are send to the appropriate Windows 95 service routines. Only the I/O CHCHK NMI's are intercepted by our service routine to do all the computations and measurements.
The virtual device driver, called vnmid.vxd, responsible for
intercepting the NMI signal and doing all the measurements and
calculations is located under the
c:
windows
directory at installation.