|
EVAL-AD5933EBZ Datasheet, PDF (17/32 Pages) Analog Devices – Evaluation Board for the 1 MSPS 12-Bit Impedance Converter Network Analyzer | |||
|
◁ |
Preliminary Technical Data
EVAL-AD5933EB
phase2 = (theta * 180) / pi
'convert from radians to degrees
ElseIf ((real > 0) And (img < 0)) Then
theta = Atn(img / real)
phase2 = ((theta * 180) / pi ) +360
'4th quadrant theta = minus angle
ElseIf ((real < 0) And (img < 0)) Then
theta = -pi + Atn(img / real)
phase2 = (theta * 180) / pi
'3rd quadrant theta img/real is positive
ElseIf ((real < 0) And (img > 0)) Then
theta = pi + Atn(img / real)
phase2 = (theta * 180) / pi
'2nd quadrant img/real is neg
End If
End Function
â-----------------------------------------------------------------------------------------------------------
Private Sub Sweep ()
â the main sweep routine
âThis routine coordinates a frequency sweep using a mid point gain factor (see datasheet).
'The gain factor at the mid-point is determined from the real and imaginary contents returned at this mid
âpoint frequency and the calibration impedance.
'The bits of the status register are polled to determine when valid data is available and when the sweep is
âcomplete.
'-----------------------------------------------------------------------------------------------------------
IndexArray = 0
'initialize counter variable.
Increment = NumberIncrements + 1 'number of increments in the sweep.
Frequency = StartFrequency
'the sweep starts from here.
â------------------------- PROGRAM 30K Hz to the START FREQUENCY register ---------------------------------
DDSRefClockFrequency = 16E6
StartFrequency = 30E3
âAssuming a 16M Hz clock connected to MCLK
âfrequency sweep starts at 30K Hz
TempStartFrequency = (StartFrequency / (DDSRefClockFrequency / 4)) * 2^27 âdial up code for the DDS
TempStartFrequency = Int(TempStartFrequency) â30K Hz = 0F5C28 hex
StartFrequencybyte0 = 40
StartFrequencybyte1 = 92
StartFrequencybyte2 = 15
â40 DECIMAL = 28 HEX
â92 DECIMAL = 5C HEX
â15 DECIMAL = 0F HEX
'Write in data to Start frequency register
WritetToPart &H84, StartFrequencybyte0 '84 hex lsb
WritetToPart &H83, StartFrequencybyte1 '83 hex
WritetToPart &H82, StartFrequencybyte2 '82 hex
â--------------------------------- PROGRAM the NUMBER OF INCREMENTS register ------------------------------
âThe sweep is going to have 150 points 150 DECIMAL = 96 hex
'Write in data to Number Increments register
WritetToPart &H89, 96
âlsb
WritetToPart &H88, 00
âmsb
â--------------------------------- PROGRAM the FREQUENCY INCREMENT register ------------------------------
âThe sweep is going to have a frequency increment of 10Hz between successive points in the sweep
DDSRefClockFrequency = 16E6
FrequencyIncrements = 10
âAssuming a 16M Hz clock connected to MCLK
âfrequency increment of 10Hz
TempStartFrequency = (FrequencyIncrements / (DDSRefClockFrequency / 4)) * 2^27 âdial up code for the DDS
TempStartFrequency = Int(TempStartFrequency) â10 Hz = 335 decimal = 00014F hex
FrequencyIncrementbyt0 = 4F
FrequencyIncrementbyt1 = 01
FrequencyIncrementbyt2 = 00
â335 decimal = 14f hex
'Write in data to frequency increment register
WritetToPart &H87, FrequencyIncrementbyt0 '87 hex lsb
WritetToPart &H86, FrequencyIncrementbyt1 '86 hex
WritetToPart &H85, FrequencyIncrementbyt2 '85 hex msb
â--------------------------------- PROGRAM the SETTLING TIME CYCLES register ------------------------------
Rev. PrC | Page 17 of 32
|
▷ |