|
LED
(SWR display) |
Approximate
SWR |
LED
(wattmeter display) |
Forward Power |
| D1 (green) | 1.1 | D11 (green) | 280mW |
| D2 (green) | 1.4 | D12 (green) | 560mW |
| D3 (green) | 1.8 | D13 (green) | 1.1W |
| D4 (yellow) | 2.3 | D14 (green) | 2.2W |
| D5 (yellow) | 3 | D15 (green) | 4.5W |
| D6 (yellow) | 4 | D16 (green) | 8.9W |
| D7 (red) | 6 | D17 (green) | 18W |
| D8 (red) | 11 | D18 (green) | 35W |
| D9 (red) | >17 | D19 (yellow) | 71W |
| D10 (red) | infinity | D20 (red) | >100W |
A PIC16F872 microcontroller processes the forward voltage sample (V_F_3) and reflected voltage sample (V_R_3) from the rectifier stage and lights up the appropriate wattmeter and SWR meter LEDs. V_F_3 is a function of the forward power from the transmitter to the load. V_R_3 is a function of the reflected power from the load to the transmitter. These input voltages are fed into the microcontroller's internal 10-bit A/D converters, where their voltage levels are quantized in the 0 to 1023 range (about 4.9 mV/unit).
The microcontroller's algorithm uses the quantized value of V_F_3 to determine which (if any) of the wattmeter LEDs (D11 through D20) to light. The table above shows the approximate transmitter power output corresponding to each of the wattmeter LEDs. If the forward transmitted power is less than 200 mW, then none of the wattmeter LEDs are lit. If the forward transmitted power is less than 30 mW, then none of the SWR meter LEDs are lit either.
Assuming a forward transmitted power of at least 30 mW, the microcontroller's algorithm divides the quantized value of V_R_3 by the quantized value of V_F_3. The result determines which of the SWR meter LEDs (D1 through D10) is lit.
My earlier version of the QROP Meter used an LM3914 linear display driver chip to drive the SWR meter display and an LM3915 linear display driver chip to drive the wattmeter display. The SWR display behaved erratically between transmissions and during very low power transmissions. One or more of the SWR indicator LEDs would light up at random because the forward and reflected voltages feeding the LM3914 inputs had similar values.
If the forward power is less than 200mW, then all of the SWR meter LEDs and the wattmeter LEDs will be dark. SWR readings at these extremely low power levels would be less accurate due to the offset voltages from the op amps and the quantization errors in the A/D conversion process.
Port A Pin 4 (RA4) is the open drain output and is configured differently from the other I/O pins. It is connected in series with LED D5, a 330 ohm resistor, and the +5V supply. To keep this LED unlit, set TRISA4 = 1. Setting TRISA4 as an input port gives it a high impedance. This effectively means that no current flows through LED D5, which remains unlit. To light this LED, set TRISA4 = 0 and RA4 = 0. Setting TRISA4 as an output port gives it a low impedance. However, it is also necessary to set RA4 = 0 so that this pin is connected to ground. This allows current to flow from the +5V supply through LED D5, the 330 ohm resistor, and into ground. This lights up LED D5. If RA4 is not specifically set to 0, then this pin floats. Current will not flow through LED D5 if RA4 is connected to the +5V supply instead of ground.
The low voltage programming feature MUST be disabled in the configuration (LVPDIS). This is necessary to allow normal I/O operation of Port B Pin 3, which controls LED D8.
If the compiler finds errors in lines that appear to be correct, check the *.pre file generated in the compiling process. This preprocessed file (NOT the file you directly edit) is what the compiler uses. I once had an invisible error that I could only see in the *.pre file. I had a commented-out line followed by a line in which I started a function declaration. However, the preprocessor failed to see a newline character and treated that critical command as part of the previous line's comments.