Diamond Power Products MM-48-AT user manual Guidelines for Selecting Fifo Use Fifoen and Fifoth

Page 33

Guidelines for Selecting FIFO Use (FIFOEN and FIFOTH)

The below data is a guideline for interrupt use that will work in typical applications and systems. Each application’s optimum performance will be based on the processor speed, operating system, sampling method, and need to obtain data as soon as possible.

Sample rate

Suggested use

Rate < 500Hz

FIFO not needed; one interrupt per sample or scan is acceptable.

 

This setting applies to both single A/D samples and A/D scans.

500 <= Rate < 50,000 FIFO should be used to reduce interrupt overhead. Set FIFOTH = 1 to select the lower threshold of 256 samples to allow the application program to obtain A/D data as quickly as possible.

Rate >= 50,000Hz FIFO should be used. Set FIFOTH = 0 to select the higher threshold of 1024 samples to reduce the interrupt rate and resulting overhead.

A/D Operation Table

The following table describes the behavior of the A/D circuit in the 8 major operating modes based on scan, FIFO, and interrupt settings.

AINTE

FIFOEN

SCANEN

Operation

 

 

 

 

 

 

0

0

0

Single A/D conversions are triggered by write to B+0.

 

 

 

 

STS stays high during the A/D conversion.

 

 

 

 

No interrupt occurs.

 

 

 

 

The user program monitors STS and reads A/D data when it goes low.

0

0

1

A/D scans are triggered by write to B+0. All channels between LOW and HIGH

 

 

 

will be sampled.

 

 

 

 

STS stays high during the entire scan (multiple A/D conversions).

 

 

 

No interrupt occurs.

 

 

 

 

The user program monitors STS and reads all A/D values when it goes low.

0

1

0

Same operation as case 000 above.

 

 

 

 

 

 

0

1

1

Same operation as case 001 above.

 

 

 

 

 

1

0

0

Single A/D conversions are triggered by the source selected with CLKSEL.

 

 

 

STS stays high during the A/D conversion.

 

 

 

 

A/D interrupt occurs after each conversion is done (when STS goes low).

 

 

 

The interrupt routine reads one A/D sample each time it runs.

 

1

0

1

A/D scans are triggered by the source selected with CLKSEL.

 

 

 

STS stays high during the entire scan (multiple A/D conversions).

 

 

 

A/D interrupt occurs after the entire scan is complete.

 

 

 

 

The interrupt routine reads out one entire A/D scan (multiple values) each time

 

 

 

it runs.

 

1

1

0

Single A/D conversions are triggered by the source selected with CLKSEL.

 

 

 

STS stays high during the A/D conversion.

 

 

 

 

A/D interrupt occurs when HF goes high (256 A/D conversions have occurred).

 

 

 

The interrupt routine reads out 256 samples (half the FIFO) each time it runs.

1

1

1

A/D scans are triggered by the source selected with CLKSEL.

 

 

 

STS stays high during the entire scan (multiple A/D conversions).

 

 

 

A/D interrupt occurs after the scan is complete AND HF is high (i.e. an integral

 

 

 

no. of scans has occurred and the FIFO is half full or more).

 

 

 

 

The interrupt routine reads out enough complete scans to equal 256 or more

 

 

 

samples each time it runs.

 

 

 

 

Diamond-MM-48-AT User Manual V1.01

Page 33

Image 33
Contents DIAMOND-MM-48-AT Table of Contents Description DIAMOND-MM-48-AT Board Drawing Signal Name Definition O Header Pinout and PIN DescriptionJ3 Analog and Digital I/O Signal Name Definition Relay output contacts J4 Relays and OptocouplersOptoisolated input contacts Base Address Board ConfigurationBase Address Jumper Position Hex Decimal Interrupt Level SelectionOptocoupler Polarity ReservedAnalog Input Range Overview Base + Write Function Read FunctionLSB MSB Write operations Register Map Bit AssignmentsDA7 DA6 DA5 DA4 DA3 DA2 DA1 DA0 Read operationsBase + Write Register DefinitionsDefinitions Base + ReadAD9 AD8 Base + Read/Write A/D Channel RegisterHIGH3 HIGH2 HIGH1 HIGH0 LOW3 LOW2 LOW1 LOW0 Base + Read/Write Relay Control Port Base + Read/Write Digital I/O Configuration RegisterRELAY7 RELAY6 RELAY5 RELAY4 RELAY3 RELAY2 RELAY1 RELAY0 DIR3 DIR2 DIR1 DIR0Base + Read Digital I/O Data and Edge Status DIO3 DIO2 DIO1 DIO0DEDGE3 DEDGE2 DEDGE1 DEDGE0 DIO3 DIO2 DIO1 DIO0 OEN3 OEN2 OEN1 OEN0 POL3 POL2 POL1 POL0Base + Write Channel and Control Register Daupdt DACH2 DACH1 DACH0OEDGE3 OEDGE2 OEDGE1 OEDGE0 OPTO3 OPTO2 OPTO1 OPTO0 Dapre Daprld Reset Fiforst Adstart Base + Write Command RegisterPOL ADCH3 ADCH2 ADCH1 ADCH0 Base + Read Status RegisterCKSEL1 CKFRQ1 CKFRQ0 Scnint Clken Clksel Base + Write Configuration RegisterAdbusy Dabusy CKSEL1 CKFRQ1 CKFRQ0 Scnint Clken Clksel Base + Read Configuration & Status RegisterFifoth Fifoen Scanen Base + Write Fifo Control RegisterBase + Read Fifo Status Register OVF Fifoth Fifoen ScanenClrt Clrd Clro Clra Tinte Dinte Ointe Ainte Base + Write Interrupt Control RegisterTint Dint Oint Aint Tinte Dinte Ointe Ainte Base + Read Interrupt Status RegisterBase + Read/Write Counter/Timer D7 Base + Read/Write Counter/Timer D15Base + Read/Write Counter/Timer D23 Base + Write Counter/Timer Control Register Ctrno Latch Gtdis Gten Ctdis Cten Load CLRCtrno Base + Read/Write Eeprom / TrimDAC Address Register Base + Read/Write Eeprom / TrimDAC Data RegisterBase + Write Calibration Control Register Base + Write Eeprom Access Key RegisterBase + Read Calibration Status Register Base + Read Fpga Revision CodeResolution Analog Input Ranges and ResolutionInput Ranges Single Ended and Differential InputsPerforming AN A/D Conversion LSB = readbase MSB = readbase+1 Data = MSB * 256 + LSB Trigger an A/D conversion on the current channelInput voltage = A/D value / 32768 * Full-scale voltage Trigger D SCAN, FIFO, and Interrupt OperationClken Clksel Conversion or ScanInterrupt Operation Fifo OperationFifoen Fifoth Scanen Fifoen =Guidelines for Selecting Fifo Use Fifoen and Fifoth Operation TableAinte Fifoen Scanen Analog Output Overview Generating AN Analog Output Reference Voltages Autocalibration Operation12.2 A/D calibration 12.3 D/A CalibrationDigital I/O Operation Optocoupler Operation Procedure for enabling interrupts on selected edgesPolarity and logic readback Edge detection assumes OENn = 1 to enable edge detectionRelay Operation COUNTER/TIMER Operation Counter 0 A/D Sample ControlCounter 1 Counting/Totalizing Functions Counter Command SequencesCounter Outpbase+15,0x01 Outpbase+15,0x81 Specifications AutocalibrationGeneral