Diamond Systems PR-Z32-E-ST, PR-Z32-EA-ST Perform an A/D conversion on the current channel

Page 49

14.4 Perform an A/D conversion on the current channel

After the above steps are completed, start the A/D conversion by writing to Base + 0. This write operation only triggers the A/D if AINTE = 0 (interrupts are disabled). When AINTE = 1, the A/D can only be triggered by the on-board counter/timer or an external signal. This protects against accidental triggering by software during a long-running interrupt-based acquisition process.

outp(base,0x80);

14.5 Wait for the conversion to finish

The A/D converter chip takes up to 5 microseconds to complete one A/D conversion. Most processors and software can operate fast enough so that if you try to read the A/D converter immediately after starting the conversion, you will beat the A/D converter and get invalid data. Therefore the A/D converter provides a status signal to indicate whether it is busy or idle. This bit can be read back as bit 7 in the status register at Base + 3. When the A/D converter is busy (performing an A/D conversion), this bit is 1 and the program must wait. When the A/D converter is idle (conversion is done and data is available), this bit is 0 and the program may read the data. Here are examples:

while (inp(base+3) & 0x80); // Wait for conversion to finish before proceeding

This method could hang your program if there is a hardware fault and the bit is stuck at 1. Better is to use a loop with a timeout:

int checkstatus()

// returns 0 if ok, -1 if error

 

int i;

 

 

for (i = 0; i < 10000; i++)

 

{

 

 

if !(inp(base+3) & 0x80) then return(0);

// conversion completed

}

 

 

return(-1);

// conversion didn’t complete

 

14.6 Read the data from the board

Once the conversion is complete, you can read the data back from the A/D converter. The data is a 16-bit value and is read back in two 8-bit bytes. The LSB must be read from the board before the MSB, because the data is inserted into the board’s FIFO in that order. Unlike other registers on the board, the A/D data may only be read one time, since each time a byte is read from the FIFO, the FIFO’s internal pointer advances, and that byte is no longer available. Note that reading data from an empty FIFO returns unpredictable results.

The following pseudo-code illustrates how to read and construct the 16-bit A/D value:

LSB = inp(base);

MSB = inp(base+1);

Data = MSB * 256 + LSB; // combine the 2 bytes into a 16-bit value

The final data is interpreted as a 16-bit signed integer ranging from –32768 to +32767.

Note: The data range always includes both positive and negative values, even if the board is set to a unipolar input range. The data must now be converted to volts or other engineering units by using a conversion formula as shown on the next page.

In scan mode, the behavior is the same except that when the program initiates a conversion, all channels in the programmed channel range will be sampled once, and the data will be stored in the FIFO. The FIFO depth register will increment by the scan size. When STS goes low, the program should read out the data for all channels.

Prometheus CPU User Manual V1.44

Page 49

Image 49
Contents Prometheus Table of Contents 22.4 22.2CPU DescriptionSystem Features FeaturesProcessor Section Analog Input Counter/TimersAnalog Output Digital I/OPrometheus Board Drawing O Headers Main I/O Connector J3Cable a Cable BCOM1 COM4 Connector Part NumbersLPT1 IR RX, IR TXInput Power J11 Ethernet J4 Output Power J12USB J5 Watchdog/Failsafe Features J6 Auxiliary Serial Port Connector J15IDE Drive J8 Floppy Drive J7Signal Name Definition Data Acquisition I/O Connector J14 Model PR-Z32-EA onlyJ2 PC/104 16-bit bus connector J1 PC/104 8-bit bus connector 11 PC/104 Bus ConnectorsJ10 System Configuration Jumper ConfigurationCmos RAM J6 Watchdog Timer & System Recovery System Resources System FeaturesCPU Chip Selects Console Redirection to a Serial Port Watchdog Timer Backup Battery Failsafe Mode / Bios RecoverySystem Reset Flash MemoryBios Settings BiosDOS Bios Download / Recovery Disk-On-Board Flash File Storage Initial SetupOperating System Formatting Life Cycle Management and Calculations Known LimitationsEthernet System I/OParallel Port Serial PortsInstalling an OS From a Floppy Drive onto a Flashdisk Module Booting to DOS From a Floppy DriveInstalling an OS from a Hard Disk onto a Flashdisk Module Data Acquisition Circuit Base Address Data Acquisition Circuitry I/O MAPBase + Write Function Read Function LSBAD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 Data Acquisition Circuit Register MapRegister Bit Definitions Command RegisterBase + Value = Base + 0 value + Base + 1 value Base + ReadBase + Write Not Used Read AD9 AD8Base + Read/Write Channel Register Base + Write Analog Input Gain STS Wait Dacbsy OVF Scanen Base + Read Analog Input StatusCKSEL1 CKFRQ1 CKFRQ0 Adclk Dmaen Tinte Dinte Ainte Base + Read/Write Interrupt / DMA / Counter ControlBase + Read/Write Fifo Threshold FT5 FT4 FT3 FT2 FT1 FT0DA7 DA6 DA5 DA4 DA3 DA2 DA1 DA0 Base + WriteBase + Read Channel and Fifo Status FD5 FD4 FD3 FD2 FD1 FD0DACH1 DACH0 Base + Write DAC MSB + Channel NoDA9 DA8 Base + Read Analog Operation StatusBase + Read / Write Digital I/O Control Register Base + Read / WriteDioctr Dira Dirch Dirb Dircl Dioctr =Base + Read/Write Counter/Timer D15 Base + Read/Write Counter/Timer D7Base + Read/Write Counter/Timer D23 Ctrno Latch Gtdis Gten Ctdis Cten Load CLR Base + Write Counter/Timer Control RegisterREV7 REV6 REV5 REV4 REV3 REV2 REV1 REV0 Base + Read Fpga Revision CodeData Acquisition Circuit Configuration Single-ended / Differential Inputs Analog Output ConfigurationUnipolar / Bipolar Inputs Input Range Resolution 1 LSB Analog Input Ranges and ResolutionOverview Input Range SelectionPerforming AN A/D Conversion LSB = inpbase MSB = inpbase+1 Perform an A/D conversion on the current channelInput voltage = A/D value / 32768 * Full-scale input range 15.A/D SCAN, INTERRUPT, and Fifo Operation LOW, High Prometheus A/D Operating ModesAinte Scanen Resolution Analog Output Ranges and ResolutionDescription LSB = Output voltage rangeREF 1 LSB 16.4 D/A Conversion Formulas and TablesConversion Formulas for Bipolar Output Ranges Generating AN Analog Output 18.1 A/D bipolar offset Analog Circuit Calibration18.2 A/D unipolar offset 18.3 A/D full-scaleDigital I/O Operation Counter 0 A/D Sample Control COUNTER/TIMER OperationCounter 1 Counting/Totalizing Functions Counter Command SequencesCounter Outpbase+15,0x01 Outpbase+15,0x81 Data Acquisition Specifications Using the Flashdisk with Another IDE Drive ConfigurationPower Supply Flashdisk Module23. I/O Panel Board Panel Board Top Side / External Use I/O Connectors Panel Board I/O ConnectorsLocation Type Description USB aJ12 pinout to/from DC/DC power supply Panel Board Power ConnectionsJ3 Pinout J5 USB J9 Pinout InstallationFlash Disk Programmer Board Photo No Cable No Description 25.I/O CablesCable Kit C-PRZ-KIT PL5 pin no PL5 Signal J25 pin no J25 Signal VGA Accessory BoardPL5 pin no DB15F pin no Signal Mounting Prometheus on a Baseboard Prometheus Connector Manufacturer Manufacturer Part NoLinks Website informationPage 28.PC/104 Mechanical Drawing

PR-Z32-E-ST, PR-Z32-EA-ST specifications

The Diamond Systems PR-Z32-EA-ST and PR-Z32-E-ST are pioneering solutions in the realm of embedded computing systems, designed to meet the challenging demands of various industrial applications. These boards harness advanced technologies and a comprehensive feature set to ensure exceptional performance, flexibility, and reliability.

At the heart of the PR-Z32 series is a robust processor architecture that combines efficiency with processing power. The systems are built around the Zynq-7000 SoC (System on Chip), which integrates a dual-core ARM Cortex-A9 processor with Xilinx FPGA technology. This hybrid architecture provides the ability to run complex algorithms and custom logic concurrently, making the boards ideal for applications requiring intense computational tasks such as image processing, data acquisition, and real-time control.

One of the main features of the PR-Z32-EA-ST and PR-Z32-E-ST is their versatility. Both variants support a wide range of I/O options, including USB, Ethernet, CAN, and serial interfaces. This range of connectivity allows for integrations with various sensors, actuators, and other peripheral devices, making it suitable for industrial automation, robotics, and IoT projects. The inclusion of multiple GPIO pins also enhances the capability of the boards to interface with additional hardware.

In terms of performance, the PR-Z32 series supports substantial amounts of on-board memory, which can be essential for applications requiring the storage and processing of large datasets. The configurations are often customizable, allowing users to select the appropriate amount of RAM and on-board flash memory for their specific applications.

Reliability is a critical characteristic of the Diamond Systems PR-Z32 series. The boards are built to withstand adverse environmental conditions, making them suitable for deployment in industrial environments. They are often designed to operate over a wide temperature range, ensuring functionality in both hot and cold climates. Additionally, the boards are compliant with various industry standards, assuring users of their robustness and durability.

Moreover, the PR-Z32-EA-ST and PR-Z32-E-ST support real-time operating systems (RTOS) and conventional operating systems such as Linux. This support provides developers with the flexibility to choose the best environment for their applications, whether they require real-time performance or full-fledged operating system features.

In conclusion, the Diamond Systems PR-Z32-EA-ST and PR-Z32-E-ST are formidable options for those seeking powerful, versatile, and reliable embedded computing solutions. With their advanced SoC architecture, flexible I/O options, extensive memory configurations, and environmental resilience, these boards are well-equipped to tackle the challenges of modern industrial applications.