ssi_logo

9323 Hamilton

Mentor, Ohio 44060 - USA

Tel:+1-440-357-1400

Fax:+1-440-357-1416

Scientific Solutions ® Inc.

On-Line Reference:

ISA DMA vs. PCI BusMastering


Both the ISA and the PCI bus have the ability to transfer data to/from computer memory without the intervention of the computer's main CPU.  For ISA cards, this is called Direct-Memory-Access or commonly abbreviated as DMA.  For PCI cards this is called BusMastering.  Although both DMA and BusMastering accomplish the same task, the methods used are quite different.  An understanding of the difference is helpful if you are trying to run or migrate software written for an ISA card on a PCI card.

An important point to note is although add-in computer cards can support DMA or BusMastering, this does not mean that software written for these cards must use it.  That is, computer boards that have the ability to perform hardware data transfers (DMA / BusMastering) also have the ability to transfer the data under direct software control using programmed I/O.  An example is the Scientific Solutions LabMaster DMA products.  As the name implies, these products have the ability to perform DMA transfers.  Some programs written for this card use the DMA feature, while other software applications do not.  The original 1981 version of the LabMaster products did not have DMA capability.  When DMA was addd in 1986, the term "DMA" was appended to the name to distinguish between the cards that supported DMA and the cards that did not.  However, software written for the original non-DMA version of the LabMaster run perfectly well on the DMA version.

ISA DMA:

Because of the differences between the ISA bus and the PCI bus, the LabMaster DPCI does not implement "DMA" like its "ISA" equivalent.  This means that if you have software written for the LabMaster DMA/ISA that does not use DMA it will run without modification on the LabMaster DPCI, however it the software uses DMA then the DMA functions will not run.

On the ISA bus there is a DMA controller located on the computer motherboard that is programmed to transfer data to/from an I/O device. Software written to do DMA transfers over the ISA bus program this DMA controller directly.  When a DMA transfer is requested by the LabMaster DMA/ISA, the DMA controller on the computer motherboard takes control of the computer bus from the host CPU and performs the transfer.

There is no such DMA controller on the PCI bus, so your code written for the DMA controller on the ISA bus will not work.  Instead, on the PCI bus the card itself takes the role of the DMA controller and is called a BusMaster.  The LabMaster PRO is a BusMaster device.  It takes control of the PCI bus and performs the transfer to/from the card.

We can add BusMastering functions to the LabMaster DPCI card.  However programming the BusMastering for PCI will be different than programming  DMA for ISA.  If you were trying to run your existing ISA code then this would be an issue.  However, since you are going to update your software then this is not an issue.


With the PCI bus there is no such "default" controller.  Certainly a PCI card does not have to be a BusMaster and in fact most PCI cards are not BusMasters because it is more difficult and costly to make.  However, these non-BusMaster cards cannot in themselves perform DMA transfers, nor can they assume that there is a BusMaster available that will do the task.  If you wanted one of these "PCI Slave" devices to have the ability to have DMA, then you would have to install another PCI card (a PCI BusMaster) into your system that could perform the transfers for the "PCI Slave".  Then you would have to program the PCI BusMaster card to handle the DMA transactions for the "PCI Slave" card.  How would the PCI BusMaster know when the PCI slave wanted to be serviced - that is a good question as there is no pin on the PCI bus (like there is on the ISA bus) for a PCI Slave to request a DMA transfer.  So then somehow the software would have to monitor the PCI Slave card (maybe by reading a status bit) and when the PCI Slave wants to do a transfer, then the software would program the PCI BusMaster to perform the transfer. However, this sort of defeats the idea of BusMaster as being a hardware action that is indpendent of software monitoring or interrupts.  I do not believe anyone makes a "Generic PCI BusMaster" add-in card because if a card needs BusMaster capabilities, then it should have the BusMaster function as part of its design and becuase of the lack of a good method for a PCI Slave to request a DMA service.  Having to add two PCI cards is not as efficient on bus bandwidth (increase time for the PCI bus to settle) nor is it very cost effective.

For hardware start-of-conversion, an on-board timer on the LabMaster card is programmed  at the sample clock rate - for the LabMaster PRO this is 3usec.  A second on-board timer (the scan clock) is used to gate the sample clock on and off and in your case would be programmed for a 1000usec clock rate.  Then on each tick of the scan clock, the sample clock fires off four pulses at 3usec spacing.  This acquires the four A/D samples with minimal skew between the samples as is referred to as "burst mode" sampling (or sometimes called pseudo-simultaneous sampling) and is the method the LabMaster PRO uses to acquire data.  The samples are put into the LabMaster PROs on-board memory.  Then the LabMaster PRO takes over the PCI bus as a BusMaster and transfers the samples from the on-board memory to the computer's memory.  This A/D conversion, sample memory storage and BusMaster operation are all independent simultaneous hardware operations on the card.  Also, the on-board timers are very very accurate with no jitter.  The application software then retrieves the samples from the computer memory and stores these to disk.  Two computer memory buffers can be set up so that the LabMaster PRO is filling one buffer as the application software is emptying the other (ping-pong buffering) for longer acquisitions.  The LabMaster PRO can store 4000 samples in its on-board memory.  The LabMaster PRO's on-board memory assures that no samples are lost due to delays or latency in the operating system (windows is not a real-time operating system).  What this means is that if more A/D samples are acquired before the LabMaster PRO has access to the PCI bus to transfer the previous samples that this is not a problem as the newly acquired samples will just be stored in the on-board memory.  So the LabMaster PRO hardware does most of the work.  But the hardware has to be initialized by software and the software has to be able to create memory buffers in the computer memory space.

DMA:
DMA on ISA and DMA on PCI are very much different.

For ISA systems, there is a device on the computer motherboard called a DMA controller.  This is a specialized device that the application software programs to perform transfers from I/O directly to Memory and is called the Direct Memory Access (DMA) controller.  Once programmed, when an ISA card has data available it will initiate a request on the ISA bus for a DMA transfer (called DREQ, for DMA Request).  The DMA controller sees this request and takes control of the ISA bus, kicking off your CPU.  Once the DMA controller has control of the ISA bus it performs a simultaneous I/O read (From the LabMaster DMA ISA card) and a Memory Write (to the computer memory).

In PCI systems there is NOT a DMA controller in the computer.  So your application program is trying to program a device on the computer motherboard that does not exist.  Instead, PCI devices themselves "can" be BusMasters and take control of the PCI bus and perform the transfer from themselves (the card) to the computer.

The correct term for ISA is that the add-in card is a "DMA Slave"
The correct term for PCI is that the add-in card is a "BusMaster"
Both can be considered "DMA", i.e. Direct Memory Access - however the process is very much different.

So software written to use a DMA controller on ISA computer motherboards does not work on PCI systems.

ISA DMA:
For ISA cards, Direct-Memory-Access is a means by which data on the ISA card is transferred from the card to computer memory (and vice-versa) by means of a "DMA Controller" which is located on the ISA computer motherboard.  When the ISA card has data (or requires data) it puts out a request on the ISA bus.  The "DMA Controller" sees this request and takes control of the ISA bus by kicking off your main CPU (Intel/AMD processor).  Once the DMA Controller has control of the ISA bus, it transfers the data to/from the ISA card and the computer memory.  This is called Direct-Memory-Access (DMA) and is controlled by the hardware.  However, in order for DMA to occur the application software has to directly program the DMA controller (which is located on the computer's motherboard).  The DMA Controller is "specific" to ISA motherboard, i.e. it is NOT present on PCI motherboards (unless the computer has both ISA and PCI slots).  The ISA card is really called the "DMA Slave" as it requests a data transfer, but the "DMA Controller" has control over the actual transfer.  Just because an ISA card supports DMA functions (The LabMaster AD can do DMA), it does not mean that it has to be used.  A card that supports DMA also supports just transferring the data to/from the card using register read/write operations called "Programmed I/O". It is  up to the software application to determine if DMA is used or not.  Some applications use DMA, while others do not, and use programmed I/O instead.  Our LabPac32 supports the LabMaster AD using programmed I/O.

PCI BusMastering:
For PCI cards, there is no such thing as a DMA Controller in the computer.  Instead when the PCI card has data to transfer, the PCI card itself takes control over the PCI bus (kicking off the main Intel/AMD CPU).  Just like the case with ISA DMA, not all PCI cards support BusMastering and even if a card does, it is up to the software to determine if it uses BusMastering or just transfers data using register access.  Sometimes people refer to PCI BusMastering also as DMA on the PCI bus.  BusMastering is a better name as it is more descriptive of the actual transfer, i.e. the PCI add-in card is the Bus Master as oppose to the ISA card which is a DMA Slave.


As I have noted, ISA DMA is very specific to the ISA bus, i.e. the application software is actually writing to a device on the ISA motherboard - a device that does not exist on PCI computer motherboards.  I do not know if your software is using ISA DMA or not, but I thought a discussion of it could be helpful.