Programming the ADuC812
Circle #111 on the Reader Service Card.
There is only one jumper on the evaluation board that
I regularly use — the jumper at position LK3. When this
jumper is in, resetting the ADuC812 causes the ADuC812
to wait for instructions to come to its UART. This jumper
must be in when you want to send a new program to the
ADuC812. After you load a program, it is possible to tell
the ADuC812 to start running by sending the appropriate
commands to the UART. This is what clicking on the RUN
Recall that the program memory of ADuC812 is (
nonvolatile) FLASH memory. Even after turning off the processor, the program is still in the FLASH memory. If the
jumper at LK3 is out, then when the ADuC812 is powered-up or reset, it does not wait for instructions to come from
the UART. Rather, it jumps to the start of the program
memory and starts executing the current resident program.
If you have already downloaded the capacitance meter
program and reset the ADuC812 after setting up
Hyperterminal, you will see that upon power-up the
program clears the Hyperterminal screen and sends the
computer the string "Hit 'm' to perform a measurement." (In
fact, the messages that cause this to happen were sent when
the RUN tab was hit the first time the program was run. At
that point, however, there was no program running on the
host computer to "listen" to what the ADuC812 "said.")
Pressing “m” now will cause a measurement to be made.
A Cautionary Note
A word of caution is in order. After the MicroConverter
finishes making a measurement, it resets the voltage on
the D/A to 0 V. This allows the capacitor to discharge. If
you have a fairly large capacitor, you must wait a second
or two for it to drain completely. If you don't, the capacitor
will not have completely discharged and the next measurement will be incorrect (too low). This is because the
capacitor will not take as long to charge as it should — it
started out partially charged.
Adding Bells and Whistles
I have presented a simple capacitance meter. It is relatively easy to extend this meter into a multimeter. Of
course, doing so would increase the complexity of the
meter and would take a fair amount of time. Enjoy! NV
NUTS & VOLTS
Shlomo Engelberg received his B.E.E. in 1988,
his M.E.E. in 1990, his M.S. (in mathematics) in 1991,
and his Ph.D. (in mathematics) in 1994. He teaches
electronics at the Jerusalem College of Technology-
Machon Lev. In his spare time, Shlomo enjoys walking,
reading, and playing with his children.
Circle #128 on the Reader Service Card.