Download ad3700 manual - RTD Embedded Technologies, Inc.

Transcript
A/D BlpolarCodeTable
(110v;twos complement)
InputVoltage
OutputCode
+9.995vohs
M S B 0 1 1 11 1 1 1 1 1 1 1 L S B
+5.000volts
0100 0000 0000
0 volts
0000 0000 0000
-.00488volts
1 1 1 11 1 1 1 1 ' r 1 1
-10.000
volts
1000 0000 0000
1 LSB= 4.88millivolts
A/D UnlpolarCodeTable
(0 to +10V;straightbinary)
Input Voltage
OutputCode
+9.99756
volts
M S B1 1 1 1 1 1 1 1 1 1 1 1L S B
volts
+5.00000
1000 0000 0000
0 volts
0000 0000 0000
1 LSB= 2.44millivolts
. Programmingthe PacerClock
Two 16bit timer/countersin ttre S2S4TimerlCounterTCI are cascadedto form ttreon-boardpacerclock,
shownin Figure4-9. Whenyou want!o usethepacerclockfor continuousA/D conversions,
you mustprogramthe
clock rate.To find the value you must load into the clock to producethe desiredrate, you first haveto calculatethe
value of Divider I (TCl Counter0) and Divider 2 (TCl Counter1) shownin the diagram.The formulasfor making
this calculationare asfollows:
= ClockSourcsFrequency/(Divider
Pacerclockfrequency
1 x Divider2)
Divider1 x Divider2 = ClockSourceFrequency/Pacer
ClockFrequency
To setthe pacerclock frequencyatZ0OkJIzusing the on-board5-MHz clock source,this equationbecomes:
Divider1 x Divider
2=5MHzl200kHz --> 25=5y1171200
kHz
After you det€rminethe valueof Divider I x Divider 2, you thendivide the resultby the leastcommondenominator.The leastcommondenominatoris the value that is loadedinto Divider 1, and the result of the division, the
quotient,is loadedinto Divider 2. In our exampleabove,theleastcommondenominatoris 5, so Divider I equals5,
andDivider 2 equals2515,or5 also.The able with thediagramlists somecommonpacerclock frequencies
andthe
countersettings(usingtheon-board5-MHz clock source).
After you calculatethe decimalvalue of eachdivider, you canconvertthe result to a hex value if it is easierfor
you whenloadingtle countinto ttre 16-bitcounter.
4-16