![]() |
| RabbitNet Peripheral Cards User's Manual |
4. D/A Converter Card
Chapter 4 describes the features and the use of the D/A Converter Card, one of the peripheral cards designed for use with the RabbitNet expansion ports on selected Rabbit Semiconductor single-board computers, operator interfaces, and RabbitCore Prototyping Boards.
Figure 27 shows a conceptual view of the D/A Converter Card connected to a master.
![]()
NOTE The OP7200 master and the RabbitCore Prototyping Boards do not supply any power to the slave. 4.1 Features
- 8 channels of 12-bit analog outputs
- 2 channels are software-configurable for output voltage ranges of 0-2.5 V, 0-5 V, 0-10 V, or 0-20 V, remaining 6 channels have software-configurable output voltage ranges of 0-10 V or 0-20 V
- 2.5 kHz update rate
- output impedance 8 W
- can be mounted in standard 100 mm DIN rail trays sold by other suppliers
- interfaces with master through RabbitNet serial protocol at 1 Megabit per second using standard Ethernet cable up to 10 m (33 ft) long
4.1.1 Software
The D/A Converter Card is a slave; the master to which it is connected is programmed using version 8.01 or later of Rabbit Semiconductor's Dynamic C. If you are using a BL2500 or an OP7200 as your master with an earlier version of Dynamic C, Rabbit Semiconductor recommends that you upgrade your Dynamic C installation. Contact your authorized Rabbit Semiconductor distributor or your Rabbit Semiconductor Sales Representative for more information on Dynamic C upgrades.
4.2 Connections
Use a straight-through CAT 5/6 Ethernet cable to connect the D/A Converter Card's RJ-45 RabbitNet jack to a RabbitNet port on the master. You may use either port if you are connecting to a master such as the BL2500 that has more than one RabbitNet port.
NOTE The RJ-45 RabbitNet jacks are serial I/O ports for use with a master and a network of peripheral boards. The RabbitNet jacks do not support Ethernet connections. ![]()
You will also have to provide two separate DC power supplies to your D/A Converter Card: +5 V and a DCIN of 9-32 V. These power supplies are connected via the polarized friction-lock terminal at header J1. You may assemble a suitable cable using the friction-lock connectors from the Connectivity Kit described in Section 1.1.3. If you are using a BL2500 or BL2600 as your master, you may draw this power from the BL2500 or BL2600 as shown in Figure 28.
When selecting DCIN, note that DCIN must be at least 3 V more than the voltage of the D/A converter output. For example, if AOUT0 is configured for 0-20 V, DCIN must be at least 23 V, otherwise the maximum D/A converter output will be DCIN - 3 V.
NOTE Even if you are not drawing power from a master, you will need to connect the D/A Converter Card ground to the ground on your master. The GND pin on header J3 should be used. 4.2.1 Power Supply
Figure 29 illustrates the assembled friction-lock connector wiring diagram for the power supplies used to supply power to the D/A Converter Card.
![]()
4.3 Pinout
The D/A Converter Card pinouts are shown in Figure 30.
![]()
4.3.1 Headers
D/A Converter Cards are equipped with one polarized 1 × 9 friction-lock terminals at J4, a 1 × 4 friction-lock terminal at J1 (DCIN and +5 V power supplies), and an RJ-45 RabbitNet jack.
No header is installed at J3, which is used to program the D/A Converter Card at the factory.
4.3.2 Indicator LED
An indicator LED (DS1) located near the header J3 location turns on when the D/A Converter Card is powered up, then goes off when the D/A Converter Card has completed its initialization process and is running. The LED will be on while the D/A Converter Card is receiving a transmission from the master.
4.4 D/A Converter Outputs
Figure 31 shows the D/A converter outputs.
![]()
The D/A converter outputs are buffered and scaled to provide outputs that are software-configurable for voltage ranges of 0-10 V and 0-20 V. Channels AOUT0 and AOUT1 can also be configured in software to provide output ranges of 0-5 V.
While each D/A converter channel can output up to 10 mA, the total power dissipation by the LM324 op-amp at any instant must be kept below 400 mW, or (400 mW)/(DCIN × 4) mA per channel.
The D/A Converter Card outputs can be updated asynchronously as raw data are processed and written, or they may be updated simultaneously by executing the
rn_anaOutStrobe()function call with theopmodeparameter in thern_anaOutConfig()function call set for synchronous operation. Further details are provided in Section 4.5.3, "D/A Converter Card Function Calls."4.4.1 Calibration
The D/A converter outputs are factory-calibrated for the 0-10 V output range, and typical calibration constants are stored in the flash memory for the other voltage ranges. You may recalibrate the D/A converter outputs at a later time using the
rn_anaOutCalib()software function described in Section 4.5.3, "D/A Converter Card Function Calls."The calibration constants are stored in flash memory in a table form. When you recalibrate your D/A Converter Card, only the calibration constants related to the voltage range you recalibrated will be overwritten.
The
DAC_CAL.Csample program illustrates how to perform the calibration and save the calibration data. The sample program is found in the in theSAMPLES\RABBITNET\RN1300directory. See Section 4.5.2, "Sample Programs," for more information on sample programs and how to use them.4.5 Software
This section provides the libraries, function calls, and sample programs related to the D/A Converter Card.
4.5.1 Dynamic C Libraries
In addition to the library associated with the master single-board computer such as the BL2500 or OP7200, one other library is needed to provide function calls for the D/A Converter Card.
RNET_AOUT.LIB--provides functions unique to the analog outputs on the D/A Converter Card. Function calls for this library are discussed in this chapter.Functions relevant to RabbitNet peripheral cards in general are described in Section 1.3.4. Other functions applicable to all devices based on Rabbit microprocessors are described in the Dynamic C Function Reference User's Manual.
4.5.2 Sample Programs
Sample programs are provided in the Dynamic C
SAMPLESfolder.The various folders contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries. For example, the sample program
PONG.Cdemonstrates the output to the STDIO window.To run a sample program, open it with the File menu (if it is not still open), then compile and run it by pressing F9 or by selecting Run in the Run menu. The RabbitNet peripheral card must be connected to a master such as the BL2500 with its Demonstration Board connected as explained in the Coyote (BL2500) User's Manual or other user's manual. The BL2500 or other master must be in Program Mode, and must be connected via the programming cable to a PC.
The
SAMPLES\RABBITNET\RN1300subdirectory contains the following sample programs. When running these sample programs, the D/A Converter Card may be connected to either RabbitNet port on a master such as the BL2500 that has two RabbitNet ports. The sample program will usern_find()and the product RN1300 as the search criteria to first find any D/A Converter Cards connected to the master. The first D/A Converter Card found will run the sample program.
DAC_ASYNC.C--This sample program outputs a voltage that can be read with a voltmeter. The output voltage is calculated using the calibration constants located on the D/A Converter Card EEPROM (simulated in flash memory).
- The D/A Converter Card is set up for the asynchronous mode of operation, which updates a D/A converter output at the time it is being accessed via the
anaOutVolts()oranaOut()functions. (i.e., theanaOutStrobe()function is not used to update the D/A converter outputs).- The sample program
DAC_SYNC.Cillustrates the synchronous mode of operation.- Before you run this sample program, make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting. Connect a voltmeter to the output channel (DAC0-DAC7) you are going to be using, then compile and run this program. You will prompted with additional instructions via the Dynamic C STDIO window during the execution of this sample program.
NOTE This sample program must be compiled to flash.
DAC_SYNC.C--This sample program outputs a voltage that can be read with a voltmeter. The output voltage is calculated using the calibration constants located on the D/A Converter Card EEPROM (simulated in flash memory).
- The D/A Converter Card is set up for the synchronous mode of operation, which updates all D/A converter outputs at the same time when the
anaOutStrobe()function executes. The outputs are all updated with values previously written using theanaOutVolts()and/oranaOut()functions.- Before you run this sample program, make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting. Connect a voltmeter to the output channel (DAC0-DAC7) you are going to be using, then compile and run this program. You will prompted with additional instructions via the Dynamic C STDIO window during the execution of this sample program.
NOTE This sample program must be compiled to flash.
DAC_CAL.C--This program demonstrates how to recalibrate a D/A converter channel using two known voltages, and defines the two coefficients, gain, and offset, that will be rewritten into the D/A Converter Card's EEPROM (simulated in flash memory).
- This program will first look for a device using
rn_find()and the product RN1300 as the search criteria, and will use the first D/A Converter Card found.- Before you run this sample program, make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting. Connect a voltmeter to the output channel (DAC0-DAC7) you are going to be using, then compile and run this program. You will prompted with additional instructions via the Dynamic C STDIO window during the execution of this sample program.
NOTE The calibration constants set at the factory will be overwritten when you run this sample program.
DAC_READ_CALDATA.C--Dumps the calibration data for all the D/A converter channels. The calibration gain factor, offset values, and mode of operation will be displayed for each channel via the Dynamic C STDIO window.4.5.3 D/A Converter Card Function Calls
int rn_anaOutConfig(int handle, char config, int opmode, int reserved);
- Configures the D/A Converter Card to the desired voltage range. Once the D/A Converter Card has been configured, use
rn_anaOut(),rn_anaOutVolts(), andrn_anaOutStrobe()to control the D/A Converter Card outputs.Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
configis a configuration code used to set the voltage ranges for the D/A Converter Card channels. Make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting.
Configuration Code Voltage Ranges Channels 0-1 Channels 2-7
1 Default setting after reset
opmodeis the mode of operation
- 0 = asynchronous--outputs are updated at the time raw data are written (default mode after reset)
- 1 = synchronous--outputs are updated when
rn_anaOutStrobeis executed
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOut, rn_anaOutVolts, rn_anaOutStrobe
int rn_anaOut(int handle, int channel, int rawdata, int reserved);
- Sets an analog output channel to a voltage that corresponds to the raw data value.
- If the D/A Converter Card is set to the asynchronous mode of operation (the default mode), the output channel will be updated at the time the raw data are being written.
- If the D/A Converter Card is set to the synchronous mode of operation, all the D/A converter outputs will be updated with the raw data values previously written (or default value of zero) when the
rn_anaOutStrobefunction is executed.
- The voltage range of the D/A converter outputs will be 0-10 V (default) or one of the other voltage range options previously set with the
rn_anaInConfig()function. Make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting.
Configuration Code Voltage Ranges Channels 0-1 Channels 2-7
1 Default setting after reset
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
channelis the channel number (0 to 7) corresponding to AOUT0-AOUT7
rawdatais the raw-data value (2 bytes)
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command and a return pointer to the raw input data. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOutConfig, rn_anaOutVolts, rn_anaOutStrobe
int rn_anaOutVolts(int handle, int channel, float voltage, struct rn_dacCalTable *tables, int reserved);
- Sets an analog output channel to a voltage using previously set calibration constants to obtain the desired voltage. Remember to run the
rn_anaOutRdCalib()function before executing this function so the calibration table will contain valid data. Here's an example.
for(channel=0; channel < 8; channel++) {
rn_anaOutRdCalib(device0, channel, &DacCalTable1, 0);
}
- If the D/A Converter Card is set to the asynchronous mode of operation (the default mode), the output channel will be updated at the time the raw data are being written.
- If the D/A Converter Card is set to the synchronous mode of operation, all the D/A converter outputs will be updated with the raw data values previously written (or default value of zero) when the
rn_anaOutStrobefunction is executed.
- The voltage range of the D/A converter outputs will be 0-10 V (default) or one of the other voltage range options previously set with the
rn_anaInConfig()function. Make sure that the DCIN for the D/A Converter Card is at least 3 V more than the maximum voltage of the D/A converter output voltage range you will be selecting.
Configuration Code Voltage Ranges Channels 0-1 Channels 2-7
1 Default setting after reset
Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
channelis the channel number (0 to 7) corresponding to AOUT0-AOUT7
voltageis the desired output voltage, which must be less than or equal to the maximum voltage in the voltage range specified by thern_anaInConfig()function
rn_dacCalTable *tablesis a pointer to a table structure that contains the calibration constants for channels 0-7 for the selected mode
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command and a return pointer to the voltage input data. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOutConfig, rn_anaOut, rn_anaOutStrobe
int rn_anaOutStrobe(int handle, int reserved);
- Strobes the D/A Converter Card to update all the D/A converter outputs with the raw data values previously written (or a default value of zero).
NOTE This function is only valid if the D/A Converter Card is set to the synchronous mode of operation using the rn_anaOutConfigfunction call.Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command and a return pointer to the voltage input data. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOutConfig, rn_anaOut, rn_anaOutVolts
int rn_anaOutCalib(int channel, int value1, float volts1, int value2, float volts2, DacCal *table, int reserved);
- Calibrates the response of the desired analog output channel as a linear function using the two conversion points provided. Values are calculated and the results are sent to the analog output device using the function
anaOutWrCalib().
- Each channel will have the following information:
- linear constant or gain
- voltage offset
Parameters
channelis the channel number (0 to 7) corresponding to AOUT0-AOUT7
value1is the first raw analog output value (0-4095)
volts1is the voltage corresponding to the first output value
value2is the second raw analog output value (0-4095)
volts2is the voltage corresponding to the second output value
DacCal *tableis a pointer to a table structure that contains the calibration constants
reservedis reserved for future use. Set to 0.Return Value
- 0, if successful.
- -1 if not able to make calibration constants.
See Also
rn_anaOutWrCalib, rn_anaOutRdCalib
int rn_anaOutWrCalib(int handle, int channel, DacCal *table, int reserved);
- Writes the calibration constants, gain, and offset previously calculated by
rn_anaOutCalib()into the device flash memory.Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
channelis the channel number (0 to 7) corresponding to AOUT0-AOUT7
DacCal *tableis a pointer to a table structure that contains the calibration constants
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command and a return pointer to the raw input data. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOutRdCalib, rn_anaOutCalib
int rn_anaOutRdCalib(int handle, int channel, DacCal *table, int reserved);
- Reads the calibration constants, gain, and offset into a calibration descriptor table
rn_dacCalTable.Parameters
handleis an address index to device information. Usern_device()orrn_find()to establish the handle.
channelis the channel number (0 to 7) corresponding to AOUT0-AOUT7
DacCal *tableis a pointer to a table structure that contains the calibration constants
reservedis reserved for future use. Set to 0.Return Value
- The status byte from the previous command and a return pointer to the raw input data. -1 means that device information indicates the D/A Converter Card is not connected to the master.
See Also
rn_anaOutWrCalib, rn_anaOutCalib4.5.4 Status Byte
Section 1.3.5 provides information on the status bytes returned by various function calls.
4.6 Specifications
4.6.1 Electrical and Mechanical Specifications
Figure 32 shows the mechanical dimensions for the D/A Converter Card.
![]()
NOTE All diagram and graphic measurements are in inches followed by millimeters enclosed in parentheses. Table 9 lists the electrical, mechanical, and environmental specifications for the D/A Converter Card.
4.6.2 Physical Mounting
Figure 33 shows position information to assist with interfacing other boards with the D/A Converter Card.
![]()
| Rabbit Semiconductor www.rabbit.com |