Dick Cappels' Project Pages
HOME

Download:
Here is the assembly code

Hex file(RFmeter.hex)

Firmware for Digital RF Field Strength indicator with LED Display using Atmel AT90SA2313


 The firmware is fairly straight-for ward. It merely needs convert the input voltage from the RF detector to a number then display the number on the LED display.

The process of converting the input voltage to a number is done in the manner described in Atmel's AVR400 application note. A capacitor with one end grounded is connected to the I/O pin associated with one comparator input. A resistor connects this capacitor to a power supply. To make the measurement, the capacitor is shorted to ground via the I/O pin (bi-directional I/O sure is great!) then the I/O pin is made back into an input and the processor counts while the resistor charges the capacitor up to the voltage on the other comparator pin (this is the voltage from the RF detector). This doesn't result in a very linear conversion, but its fine for a field strength indicator. This conversion only takes less than a few milliseconds with the resistor and capacitor values shown in the schematic.

The result of the counting while the capacitor charges is roughly proportional to the voltage from the detector. When the field strength indicator is first turned on, the display is dimmed and the circuit is operated. After the circuit operates for a couple hundred milliseconds, the measurement value is used as a zero reference. In subsequent measurements, the reading will be subtracted from this value to remove the initial offset and to make the value increase as field strength increases -the output of the RF detector decreases with increasing field strength.

The interrupts are counted to determine when to zero the count, dim the display (set for 3 minutes) and when to shut the circuit and display off (one minute later at a total of 4 minutes of on time). A non interrupt task sets the flags to zero the count and dim the display -the actual zeroing and dimming occur during interrupt time. A non interrupt task also shuts everything off.

The measurement, keeping track of running time, and multiplexing and dimming of the display are handled during the timer interrupt.

The interrupt executes one of four tasks at each equally spaced interrupt, which occur at about 4 ms intervals. A counter is used to keep track of which task is to be executed during a given interrupt.

The tasks are:

Display Character 1

Display Character 2

Display Character 3

Perform the analog-to-digital conversion

Here is the assembly code

HOME

Use of information presented on this page is for personal, nonprofit educational
and noncommercial use only. This material (including object files) is copyrighted
by Richard Cappels and may not be republished or used directly for commercial
purposes without explicit permission For commercial license,
click HERE.

Please see the liability disclaimer on the HOME page.

Contents ©2002 Richard Cappels All Rights Reserved. http://projects.cappels.org/
Updated 19 August, 2007.