Difference between revisions of "MiniVNA ICD"

From MyLabWiki
Jump to: navigation, search
(Command structure)
 
(7 intermediate revisions by the same user not shown)
Line 23: Line 23:
 
|}
 
|}
  
In the following, each line is terminated with an enter, i.e. 0x0D character.
 
  
 
== Operating Modes ==
 
== Operating Modes ==
  
The miniVNA can work in two modes, the difference being what the miniVNA measure at the physical level (TBC):
+
The miniVNA can work in two modes, a reflection mode and a transmission mode:
 
# Reflection mode – used for measuring various parameters on antennas and cables.
 
# Reflection mode – used for measuring various parameters on antennas and cables.
#* Opcode 0 (TBC)
+
#* Opcode: 0
 
#* Both ADCs connected to the bridge
 
#* Both ADCs connected to the bridge
 
# Transmission mode – used for measuring filters attenuators, etc.
 
# Transmission mode – used for measuring filters attenuators, etc.
#* Opcode 1 (TBC)
+
#* Opcode: 1
 
#* The second ADC is connected to the DET port
 
#* The second ADC is connected to the DET port
 
  
  
Line 40: Line 38:
  
 
;DDSRATIO = 10737.41824
 
;DDSRATIO = 10737.41824
:DDS increment for a 1kHz signal. Multiply the desired frequency in kHz with this constant. This factor is achieved via the frequency calibration in the windows version of the miniVNA control software.
+
:DDS increment for a 1kHz signal. Multiply the desired frequency in kHz with this constant. If the frequency is in Hz, multiply by 10.737414824. This factor is obtained from the frequency calibration in the windows version of the miniVNA control software.
  
 
;VEL = 0.66?
 
;VEL = 0.66?
 
: Velocity factor??? See windows config.
 
: Velocity factor??? See windows config.
  
 +
 +
== Command structure ==
 +
 +
Each command to the miniVNA consists of 4 numbers separated by a UNIX newline character 0x0D.
 +
# The opcode 0 or 1
 +
# The start frequency multiplied by the DDSRATIO (use 0 to turn DDS off)
 +
# The number of measurements to take (if 0 the DDS won't be activated)
 +
# The frequency step size multiplied by DDSRATIO (can be 0)
 +
 +
The miniVNA will respond with the measurements taken:
 +
* The number of samples will be equal to the number of measurements requested
 +
* 4 bytes per sample corresponding to the "phi" and "rl" (see blow)
 +
 +
  typedef struct _device_ROW { /* the serial port/usb device */
 +
      gushort phi;
 +
      gushort rl;
 +
  } DEVICE_ROW, *PDEVICE_ROW;
  
 
== Frequency Generator ==
 
== Frequency Generator ==
Line 51: Line 66:
  
 
Controller → VNA:
 
Controller → VNA:
<pre>
+
  0                           # opcode
 +
  f(kHz)*10737.41824         # start freq
 +
  1                           # number of measurements
 +
  0                           # frequency step * DDSRATIO
  
 
VNA &rarr; Controller
 
VNA &rarr; Controller
 
''TBD''
 
''TBD''
  
Reset is done by setting the frequency to 0:
+
Reset by setting the frequency to 0:
<pre>
+
  0
 +
  0
 +
  1
 +
  0
  
 
Example:
 
Example:
  
 
[[Category:Instruments]]
 
[[Category:Instruments]]

Latest revision as of 14:45, 6 November 2011

The miniVNA is a small and inexpensive antenna analyzer from mini Radio solutions. It connects to a computer via USB and it can measure SWR, RL, Rs, Z +/-jx, Phase, Cable length, R/L/C in the range 0.1Mhz to 180MHz. It comes with a quite all right control software for windows. There is also a Gnome version of the software called gVNA. Unfortunately, it depends on GNOME, it hasn't been updated for three years now and I have never been able to build it.

This document describes the miniVNA USB protocol that has been reverse engineered from user manuals and available software. The purpose is to have a control reference for writing a new control application for the miniVNA.

Connection Details

Baud rate: 115200
Data bits: 8
Parity: None
Stop bits: 1
HW flow: None


Operating Modes

The miniVNA can work in two modes, a reflection mode and a transmission mode:

  1. Reflection mode – used for measuring various parameters on antennas and cables.
    • Opcode: 0
    • Both ADCs connected to the bridge
  2. Transmission mode – used for measuring filters attenuators, etc.
    • Opcode: 1
    • The second ADC is connected to the DET port


Constants

DDSRATIO = 10737.41824
DDS increment for a 1kHz signal. Multiply the desired frequency in kHz with this constant. If the frequency is in Hz, multiply by 10.737414824. This factor is obtained from the frequency calibration in the windows version of the miniVNA control software.
VEL = 0.66?
Velocity factor??? See windows config.


Command structure

Each command to the miniVNA consists of 4 numbers separated by a UNIX newline character 0x0D.

  1. The opcode 0 or 1
  2. The start frequency multiplied by the DDSRATIO (use 0 to turn DDS off)
  3. The number of measurements to take (if 0 the DDS won't be activated)
  4. The frequency step size multiplied by DDSRATIO (can be 0)

The miniVNA will respond with the measurements taken:

  • The number of samples will be equal to the number of measurements requested
  • 4 bytes per sample corresponding to the "phi" and "rl" (see blow)
 typedef struct _device_ROW { /* the serial port/usb device */
     gushort phi;
     gushort rl;
 } DEVICE_ROW, *PDEVICE_ROW;

Frequency Generator

To start a frequency generator, i.e. constant frequency with no sweep

Controller → VNA:

 0                           # opcode
 f(kHz)*10737.41824          # start freq
 1                           # number of measurements
 0                           # frequency step * DDSRATIO

VNA → Controller TBD

Reset by setting the frequency to 0:

 0
 0
 1
 0

Example: