Tải bản đầy đủ (.pdf) (10 trang)

Tài liệu Circuit Cellar P3 doc

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.2 MB, 10 trang )

Buy Online
www.silabs.com
Complete Evaluation
System for $10.99
• Development Tools
• Source Code Examples
• Documentation
• 2K Limited C Compiler
www.silabs.com
Product details: www.silabs.com/ToolStick
MCUs
TIMING POWER BROADCAST WIRELINE WIRELESS
Fully Contained MCU Development System
Not only did Silicon Labs introduce the worlds’ first USB ToolStick evaluation
platform, we continued the evolution with a family of interchangeable
ToolStick modules including base adapters, daughtercards and debug
adapters. Now, software and hardware MCU development is easier than
ever. Using only a PC with a USB port, designers can fully experience the
software development environment in conjunction with the MCU on-chip
debugging hardware that allows full, non-intrusive access to the target CPU,
peripherals and memory. The software development environment consists of
the Integrated Development Environment (IDE), editor, debugger, Flash
programmer and a demonstration version of the Keil compiler.
Description Price
ToolStick Starter Kit (includes C8051F330 Daughter Card) $24.99
ToolStick Evaluation Kit $10.99
ToolStick Base Adapter $17.50
ToolStick C8051F330 Daughter Card $9.90
ToolStick C8051F360 Daughter Card $9.90
ToolStick C8051F530 Daughter Card $9.90
ToolStick Debug Adapter $8.90


17.qxp 3/1/2007 2:51 PM Page 1
20
Issue 202 May 2007
CIRCUIT CELLAR
®
www.circuitcellar.com
needed and should be removed.
INTERFACE TO THE MCB2130
The signal analysis, which results in
a measured magnetic field strength,
was all done by an LPC2138 on an
MCB2130 board. The microprocessor
communicates with the outside world
via a serial RS-232-compatible inter-
face, does the analysis, and controls
the amplifier/polarization circuit. The
MCB2130 board has a breadboarding
area. I built a small circuit to buffer
the 3.3-V logic output of the LPC2138
to the 5-V logic level required by the
optically isolated logic input of the
ATtiny26 on the amplifier/polarization
board. The optically isolated analog
output of the amplifier/polarization
board goes directly to one of the A/D
inputs of the LPC2138 (see Figure 6
).
MAIN PROGRAM
The MCB2130 accepts single-char-
acter commands from the serial port

to run the magnetometer. For exam-
ple, to make a single measurement, it
must turn on the polarization by
bringing the output line to a logic-
high level for a predetermined time,
turn it off, wait for all the transients
to die down, and then take the 512
samples of the analog output of the
low-noise, high-gain, band-pass ampli-
fier. Then, the MCB2130 must find
the phaseslip in the calculated arctan-
gent data. Knowing the sampling fre-
quency, it must determine the preces-
sion frequency, convert it to a magnet-
ic field strength, and send it out the
serial port. There are also commands
to let it set the polarization time and
set the time to wait after polarization
stops and the data sampling begins.
Table 1 is a full listing of the com-
mands and their actions.
The heart of the program is
the routine to take the sample,
calculate the arctangents, and
then find the best value for the
average phaseslip. This is the
measure() procedure. The most
difficult part is determining how
(with the long sequences of data)
to remove all the phase rollovers

when the phase changes from
near 2π to 0. After this has been
done, I think of the phase versus
time as a linear graph and solve
for the least-square best fit to a
straight line. The line’s slope is
the mean phaseslip per cycle. It
can be converted to a mean fre-
quency difference to the base
sampling frequency. The scatter
of the data points is a measure
of the accuracy of the measure-
ment. It can be represented by
the statistical value called the
standard deviation (σ). When the
calculated value of the magnetic
field is sent out the serial port,
the value of σ, converted to
magnetic field strength units,
goes with it. If the input S/N of
the precession signal is better
than about 10, the value of σ is
typically less than about 1 nT,
with the sensor described here.
FIELD INSTRUMENT
A complete instrument con-
sists of a sensor, an
amplifier/switching board, an
MCB2130 board, and a laptop. It
is convenient to mount the sen-

sor on a framework made from
plastic irrigation tubing with the
Figure 4—This portion of the circuit shows the HEXFET switches and the low-noise amplifier. The polarization sequence
that switches the various HEXFETs on and off is controlled by the ATtiny26 microprocessor shown in Figure 5.
2704016Koehler.qxp 4/5/2007 3:18 PM Page 20
www.circuitcellar.com
CIRCUIT CELLAR
®
Issue 202 May 2007
21
Figure 5— This portion of the circuit shows the optically isolated analog output
to the MCB2130 board and the optically isolated digital input from the
MCB2130 board. These two lines connect to the MCB2130 board through JP3.
2704016Koehler.qxp 4/5/2007 3:18 PM Page 21
22
Issue 202 May 2007
CIRCUIT CELLAR
®
www.circuitcellar.com
possible, the capacity of the battery will
determine how long the instrument will
operate in the field. The MCB2130 is
powered from a laptop via the USB
cable. Serial data between the Keil board
and the laptop can be provided by a
simple terminal program on the lapto
p.
IMPROVEMENTS
My magnetometer is as accurate as
amp

lifier/switching board mounted at
least 30 cm away from it. The battery
operating the unit must be nonmagnetic.
This means that it must be a gel cell.
The battery should be located as far
from the sensor as possible. Since the
polarizing current is about 2.3 A and
polarizing current will be flowing for
more than 50% of the time, if the meas-
urements are being made as quickly as
Photo 2—Check out the finished prototype board for the amplifier switching circuit. Surface-mounted components
were used. Some minor changes were made after the initial assembly. The circuit in Figure 4 is correct. The res-
onating capacitor was omitted when using the sensor shown.
Figure 6—The small buffer circuit was built onto the breadboard area of the MCB2130 board. It brings the 3.3-V
logic level output of the LPC2138 microprocessor up to 5-V logic levels.
3URXGO\GLVWULEXWHV
Available in 40 and 44 pin header configuration
Support PIO 0-4 and Ultra DMA 3 mode.
Bootable from Transflash/micro SD.
Low power consumption.
SD-IDE-40/44
IDE Flash Drive Carrier Board with Micro SD Interface
1.800.665.5600
www.tri-m.com
tel: 604.945.9565 fax: 604.945.9566
HEAD OFFICE: VANCOUVER
Intel
®
Pentium
®

M 745 1.8GHz, 2MBL2, ATX
Based on Intel
®
Pentium/Celeron
®
M processor.
Intel 855GME / ICH4 chipset with integrated Intel
®
Extreme Graphics 2 engine 2x32 MB VRAM UMA.
2x DDR-RAM-SODIMM for up to 2GByte.
EPIC/PM
Fanless Intel
®
852GM Celeron
®
M 600 MHz Micro PC
Onboard Intel
®
Celeron
®
M 600 MHz
with 512K L2 Cache CPU.
Intel
®
82852GM Chipset.
Scalable with Evalue EPIC SBC.
One SODIMM up to 1 GB DDR SDRAM.
EES-3723
2704016Koehler.qxp 4/5/2007 3:18 PM Page 22
www.circuitcellar.com

CIRCUIT CELLAR
®
Issue 202 May 2007
23
James Koehler graduated from the
Australian National University with
PROJECT FILES
To download code, go to cuit
cellar.com/pub/Circuit_Cellar/2007/
202.
REFERENCE
[1] R. Green, “Faster Math Functions,”
Sony Computer Entertainment
America, www.research.scea.com/
research/pdfs/RGREENfastermath
_GDC02.pdf.
SOURCES
ATmega32 and ATtiny26 Microcon-
trollers
Atmel Corp.
www.atmel.com
MCB2130 Evaluation board
Keil
www.keil.com
LM394 SuperMatched Pair
National Semiconductor Corp.
www.national.com
LPC213x Series of microprocessors
NXP
www.nxp.com

Command Action
“m” Make a measurement
“d” Set the delay before analysis after polarization in milliseconds (e.g., “d100” sets it to 0.1 s)
“b” Set the estimated local magnetic field in nT (e.g., “b55100” sets it to 55,100 nT)
“t” Set the desired polarization time in milliseconds (e.g., “ t750” sets it to 0.75 s).
Table 1—These commands are used to operate the magnetometer. They are sent to the magnetometer via a serial
RS-232-level interface to an external computer.
any commercial unit, and it can take
measurements very quickly. The data-
sampling period lasts only about 0.25 s.
Data analysis and all of the calcula-
tions take another 0.25 s or less. The
time required to polarize the sensor
depends on the liquid used and the
degree of saturation desired. For
kerosene as the sensing liquid, this
could be as short as 0.75 s. Because
polarizing for the next measurement
can start at the same time as the
analysis of the data for this measure-
ment, it is possible to make about one
measurement per second.
A colleague and I are working on an
improved version of this PPM that is a
stand-alone instrument. It does not
require a computer for operation. An
LCD displays the measurements, and
push button switches are used to oper-
ate it. It features an LPC2148 micro-
processor, which has a USB interface

in addition to the standard features it
shares with the LPC2138.
We use the second RS-232-compati-
ble port to monitor the NMEA output
from a GPS system. As a result, we
can record the exact location of the
sensor at the time of a measurement.
The data is stored internally on an SD
card, which we can remove to transfer
the data to a computer after a day of
using the instrument. The software
has several operating modes so the
PPM can be used as a single magne-
tometer or as one of a pair that operates
as a gradiometer synchronized with
one another by the GPS time signals.
The improved system’s amplifier
and switching board is similar to this
one, except for a few minor differ-
ences. The MCB2130 is replaced by
the LPC2148 with an SD data card and
an LCD-PB switch human interface. I
a Ph.D. in Astronomy in 1966. He
worked as a Professor of Physics and
Engineering Physics at the University
of Saskatchewan and retired in 1996.
His field of research was in Upper
Atmospheric Physics, and he
designed and built several radar sys-
tems for use in the study of ionos-

pheric electric fields. James has writ-
ten more than 60 peer-reviewed scien-
tific papers on this topic and others.
His current hobbies include electron-
ic design (mostly RF), photography,
and model aircraft. He lives with his
wife of 44 years on Vancouver Island,
where he enjoys the beautiful envi-
ronment and relaxed lifestyle.
2704016Koehler.qxp 4/5/2007 3:18 PM Page 23

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×