10.2 FIFO Description

Diamond-MM-32DX-AT uses a 1024-sample FIFO (First In First Out) memory buffer to manage A/D conversion data. It is used to store A/D data between the time it is generated by the A/D converter and the time it is read by the user program. In enhanced mode the entire 1024-sample FIFO is available, and in normal mode only 512 samples are available. The FIFO may be enabled and disabled under software control.

In single-conversion mode, the FIFO features are not generally needed so FIFO use should not be selected. However the FIFO is still actually being used. Each A/D sample is stored in the FIFO, and when the software reads the data, it reads it out of the FIFO. In low-speed sampling, each time a conversion occurs, the program reads the data, so there is always a one to one correspondence between sampling and reading. Thus the FIFO contents never exceed one sample.

For high-speed sampling or interrupt operation, the FIFO substantially reduces the amount of software overhead in responding to A/D conversions as well as the interrupt rate on the bus, since it enables the program to read a number of samples all at once rather than one at a time. In addition, the FIFO is required for sampling rates in excess of the maximum interrupt rate possible on the bus. Generally, the fastest sustainable interrupt rate on the ISA bus running DOS is around 40,000 per second. Since Diamond-MM-32DX-AT can sample up to 250,000 times per second, the FIFO is needed to reduce the interrupt rate at high speeds. When the interrupt routine runs, it reads multiple samples from the FIFO. The interrupt rate is equal to the sample rate divided by the number of samples read each interrupt. On Diamond-MM-32DX-AT, this number is programmable using the register at Base + 6. The usual value is 1/2 the maximum FIFO depth, or 512 samples. Therefore, the maximum interrupt rate for Diamond-MM32DX-AT is reduced to 488 per second, easily sustainable on any popular operating system.

IMPORTANT NOTE: If both Scan and FIFO operation are enabled, then the interrupt will still occur at the programmed FIFO threshold, and the interrupt routine will read the indicated number or samples and then exit. This will happen even if the number of samples is not an integral number of scans. For example, if you have a scan size of 10 and a FIFO threshold of 256, then the first time the interrupt routine runs, it will read 256 samples, consisting of 25 full scans of all 10 channels and then 6 samples from the next scan. The next time the interrupt routine runs, it will read the next 256 samples, consisting of the remaining 4 samples from the last scan it started to read, the next 25 full scans of 10 samples, and then the first 2 samples of the next scan. This continues until the interrupt routine ends in either one-shot or recycle mode. In one-shot mode, the last time the interrupt routine runs it will read the entire contents of the FIFO, so that all data will be made available

Last updated