ROBOTICS
O
.R
®
i2
LE
.H
www.circuitcellar.com
CIRCUIT
CELLAR
# 1 2 8 MA R C H 2 0 0 1
iU
R
ROBOTICS
U
M
E
T H E M A G A Z I N E F O R C O M P U T E R A P P L I C AT I O N S
W
.G
Build a Mobile Robot
W
An Organic Robot Project
W
A Mini R/C Receiver
Getting to Know FPSLIC
0 3>
7
25274 75349
9
$4.95 U.S. ($5.95 Canada)
W
W
W
.G
iU
U
M
R
E
LE
.H
i2
.R
O
O
.R
i2
LE
.H
E
U
M
R
iU
Less is more!
.G
Save and win with miniature,
programmable multitasking computers
in your projects and products:
W
W
high speed multitasking
low power (50mA @ full speed)
excellent price/performance ratio
small footprint (1.1" x 1.5")
analog, digital, serial, I/O-Bus
up to 1 MByte FLASH+SRAM
extensive device driver
and function library
W
OEM and Distributor Inquiries welcome! - Prices do not include applicable tax and shipping costs. Prices and packages may be different outside the U.S. TINY Tiger™ and BASIC Tiger™ are Trademarks of Wilke Technology
How much do you want
■
■
■
■
■
■
■
THE BASIC-TIGER ™
to invest in your next project?
USA: Kg Systems Inc., (800) 292-4303, Fax: (973) 515-1033, sales@kgsystems.com • Saelig Company, 1-888-7SAELIG, Fax: (716) 425-3835, saelig@aol.com
CAN: Premier GPS Inc., (403) 295-8879, Fax: (403) 274-3021, tabsha@premier-gps.com
Australia: JED microprocessors, (3) 9762 3588, Hungary: CAIS, (1) 204 0172, India: ICON microcircuits, (44) 432 1857, Italy: Daniele Oboli Engineering, (382) 577
987, Korea: Sample Electronics, (2) 857 4599, Mexico: EXPERTiS Tecnologia, (8) 707 3882, Netherlands: Embedded Technology B.V. (488) 431 855, Portugal:
F.P.-Consultores, (1) 778 9303, Scandinavia: MicroNor, +47 (7021) 7890, Spain: Control Llevant, (968) 162 005, Intnl: Wilke Technology GmbH, Box 1727, 52018
Aachen, Germany, +49 (241) 918-900, Fax: +49 (241) 918-9044, email: sales@wilke-technology.com
http://www.wilke-technology.com
.R
O
Digital Oscilloscopes
DSO-2102S
$525
DSO-2102M
$650
Each includes Oscilloscope,
Probes, Interface Cable, Power
Adapter, and software for
Win95/98, WinNT, Win2000
and DOS.
E
LE
.H
i2
• 2 Channel Digital Oscilloscope
• 100 MSa/s max single shot rate
• 32K samples per channel
• Advanced Triggering
• Only 9 oz and 6.3” x 3.75” x 1.25”
• Small, Lightweight, and Portable
• Parallel Port interface to PC
• Advanced Math options
• FFT Spectrum Analyzer options
W
.G
iU
R
U
M
Logic Analyzers
W
W
• 40 to 160 channels
• up to 500 MSa/s
• Variable Threshold
• 8 External Clocks
• 16 Level Triggering
• up to 512K samples/ch
• Optional Parallel Interface
• Optional 100 MSa/s Pattern Generator
LA4240-32K (200MHz, 40CH)
$1350
LA4280-32K (200MHz, 80CH)
$2000
LA4540-128K (500MHz, 40CH)
$1900
LA4580-128K (500MHz, 80CH)
$2800
LA45160-128K (500MHz, 160CH) $7000
All prices include Pods and Software
• 24 Channel Logic Analyzer
• 100MSa/S max sample rate
• Variable Threshold Voltage
• Large 128k Buffer
• Small, Lightweight and Portable
• Only 4 oz and 4.75” x 2.75” x 1”
• Parallel Port Interface to PC
• Trigger Out
• Windows 95/98 Software
LA2124-128K (100MSa/s, 24CH)
Clips, Wires, Interface Cable, AC
Adapter and Software
$800
www.LinkIns4.com
Link Instruments • 369 Passaic Ave • Suite 100 • Fairfield, NJ 07004 • (973) 808-8990 • Fax (973) 808-8786
26
Fighting Fire with Robots
How to Build a Mobile Robot Base
Mike Dvorsky
40
From the Oil Field to Your Home
The Geo-Mite’s Sensitivity Can’t be Beat
David Penrose
Build a Lightweight R/C Receiver
Ron Jesme
52
Fundamentals of Second-Order Systems
Part 3: Active Systems and Servos
Dave Tweed
84
I
I
E
Mike Baptiste
From the Bench
Getting a Grip on Complex Integration
Looking at FPSLIC
Jeff Bachiochi
U
M
72
Iÿÿ Wire is Passé
Silicon Update
SoC Hop
Tom Cantrell
R
60
LE
.H
46
W
W
W
.G
iU
INS
I
D
ISS E
EMBEDDED PC
65 Nouveau PC
APC Applied PCs
Launching E-Mail
Fred Eady
www.circuitcellar.com
Task Manager
Rob Walker
Aye, Robot
6
New Product News
edited by Harv Weiner
8
Test Your EQ
89
Advertiser’s Index
April Preview
103
Priority Interrupt
Steve Ciarcia
One Man’s Junk
104
12 8
UE
edited by Harv Weiner
66
O
18
Building Organic Robots with Students
A How-To Lesson
Ken Boone
.R
The Phoenix Rises to Victory
John Piccirillo
i2
10
CIRCUIT CELLAR®
Issue 128
March 2001
3
.R
HIGH-TEMPERATURE ELECTRONIC DESIGNS
O
ChipCenter
LE
.H
i2
Part 2: Reducing the Risk
by George Novacek
When you think of high-temperature operation, do you think of melted solder and disintegrated insulation? Sometimes operating in a harsh environment is the only
choice. An elevated temperature usually elevates risk, but this month George offers
some options. High-temperature technology has not been fully explored, but some
applications can benefit your cause, and you don't have to be a semiconductor manufacturer to make it work. February 2001
LINUX LESSONS
E
by George Martin
Practically buying up the store at an outlet hot spot, George only had to shell out
$4.99 each for vintage versions of Linux. Averting the $70 price tag for the updated
version, he felt more at ease to experiment. Linux, which is virtually free and opensourced, is only getting better. To utilize the multitasking nature of Linux, take
a tip from George and take advantage of the closeouts! February 2001
U
M
ASK
US
EMBEDDED MULTITASKING
THE ENGINEERS
TECH-HELP
RESOURCE
.G
PIC A COMPACTFLASH CARD
W
The Ask Us research
staff of engineers has
been assembled to share
expertise with others.
The forum is a place
where engineers can
congregate to get some
tough questions
answered, or just browse
through the archived
Q&As to broaden their
own intelligence base.
★★★★★★★★★★
Test Your EQ
8 Additional Questions
by Mark Samuels
New tech toys are always exciting to any gadget junkie, and Mark's no exception.
Talk about a cool little device, the CompactFlash card has countless possibilities. If
you're looking to create a digital picture frame or an MP3 player, for example, the CF
card can do it. With the wonder of removable memory, you can expect to see this
format around for some time. February 2001
W
W
Let us help keep your
project on track or simplify your design decision.
Put your tough technical
questions to the ASK US
team.
2001
iU
R
The Easy Way
by Charles Kosina
With memories of the old PS/2, Charles, a hardware guy, takes on the software task
of multitasking. He likes to keep things simple and prefers the overall benefits of
assembler language. His top-down state machine approach makes for more structured writing and easier debugging. The technique works mainly with Z180 and 8051
class processors, but you can also try it with your own favorite micro. February
AN S-7800A/PIC16F877 JOURNEY
Part 2: Revving it Up
by Fred Eady
Continuing on his journey, Fred forges a path all the way through to using the S7800A/PIC16F877 Internet Engine as a web server. With an everyday PIC, a C compiler, a tiny firmware protocol stack, and some common components, he shows us
how to put them on the Internet. As Fred says, "(There's) light at the end of
the Internet tunnel!" February 2001
SOFT CELL
Silicon Update Online—by Tom Cantrell
It's the promise of tomorrow. Field-programmable System-on-Chip technology holds
potential for the future, and one middle-of-the-road soft core CPU is helping to pave
the way. Microlor Systems' ProMic comes with a tool suite of the most popular
peripherals, a five-stage pipeline to deliver double-digit clock rates, and portability to
perform across a variety of FPGAs. Time-consuming negotiations are a thing of the
past with ProMic's simple retail pricing model. The silicon penalty is a tradeoff for the greater gain. February 2001
RESOURCES
•Speech Recognition
Bob Paddock
•Thermistors
Rick Prescott
•DDR RAM
Brant Schroeder
W
W
W
.G
iU
U
M
R
E
LE
.H
i2
.R
O
TASK MANAGER
EDITORIAL DIRECTOR/PUBLISHER
Steve Ciarcia
Aye, Robot
ASSOCIATE PUBLISHER
Joyce Keil
MANAGING EDITOR
Rob Walker
CHIEF FINANCIAL OFFICER
Jeannette Ciarcia
TECHNICAL EDITORS
Jennifer Belmonte
Rachel Hill
Jennifer Huber
p
CUSTOMER SERVICE
Elaine Johnston
ART DIRECTOR
KC Prescott
WEST COAST EDITOR
Tom Cantrell
O
LE
.H
PROJECT EDITORS
Steve Bedford
Bob Paddock
James Soussounis
David Tweed
i2
NEW PRODUCTS EDITOR
Harv Weiner
Rick Prescott
.R
CONTRIBUTING EDITORS
Mike Baptiste
Ingo Cyliax
Fred Eady
George Martin
George Novacek
STAFF ENGINEERS
Jeff Bachiochi
John Gorsky
QUIZ COORDINATORS
David Tweed
Michael Smith
EDITORIAL ADVISORY BOARD
Ingo Cyliax
Norman Jackson
David Prutchi
Cover photograph Ron Meadows—Meadows Marketing
PRINTED IN THE UNITED STATES
E
ardon the moment of sentiment, but not too long
ago I was speaking to a group of teenagers and I
described a project of mine as having started out “as
a harmless three-hour tour.” I got a chuckle from the other
adult in the room and eight blank stares from the kids. I asked if anyone
knew what I meant by “a three-hour tour.” No one knew. As it turned out, of
those eight kids, only one of them thought he might have seen an episode
of “Gilligan’s Island” at some point in his life.
The way I see it, unless *NSYNC re-releases the “Gilligan’s Island”
theme song on their next album, the phrase “three-hour tour” is on the
verge of losing its connotation of impending disaster. But, everyone knows
that today’s buzzwords achieve (Archaic) status in dictionaries in a generation or two, so I don’t plan on losing too much sleep over the matter.
Besides, we’ll just add it to the phrase scrap heap along with “sounds like a
broken record,” which has no meaning to a generation that came along after
cassette and compact disc technology.
All of this discussion wouldn’t have made it into my editorial had I not
read the latest issue of TIME and noticed that the Honda Motor Co. ran a
full page ad showing a humanoid robot walking down the sidewalk hand in
hand with a little girl. For the last 50 years, presenting an environment in
which humans and robots interact has been left to Hollywood and the imagination of writers such as Isaac Asimov. However, anyone who has seen the
video clip of Honda’s humanoid robot, Asimo, walking around the stage and
waving to the audience at its introduction last November, will tell you that its
movements were as fluid as any Storm Trooper’s. Honda isn’t the only big
name in what’s being called the “entertainment” robot industry. Sony took
the technology from its Aibo robotic pet dog and introduced the SDR-3X
humanoid robot that can dance and even get up from a prone position.
I think we’re still a long way from a Bicentennial Man scenario, but one
source said that a potential application for humanoid robots such as Asimo
could be in a Honda automobile showroom. So, how impressed is the kid
who got a robotic dog for his 10th birthday going to be when he goes to buy
his first car and is greeted by a humanoid robot wearing a chrome polo
shirt? Just try asking your 10 year old if he or she thinks the quality of
sound from a CD player is exceptionally sharp and clear. You’ll probably get
a dumbfounded look and a “Compared to what?” response.
As for me, the “Wow!” factor is still pretty high when it comes to robots.
That’s one of the reasons why I enjoy putting together the annual Robotics
issue of Circuit Cellar. There are always more great articles than we have
room to print, and this year was no exception. In spite of the fact that we
added an additional eight pages to the magazine for this issue, it looks like
there are still some interesting articles in the wings, so I can almost guarantee that you won’t have to wait until next year’s Robotics issue to read more
robotics-related articles.
Until then, my only hope is that someone is working on a customized
vocabulary for humanoid robots so that someday I can lean over to one of
the robo-editors and say, “Aye, Robot. This project has turned out to be
quite a three-hour tour,” and not be met with a blank stare.
GRAPHIC DESIGNERS
Naomi Hoeger
Mary Turek
ADVERTISING
W
W
W
.G
iU
R
U
M
ADVERTISING SALES MANAGER
Kevin Dows
Fax: (860) 871-0411
(860) 872-3064
E-mail: kevin.dows@circuitcellar.com
rob.walker@circuitcellar.com
6
Issue 128
March 2001
ADVERTISING SALES REPRESENTATIVE
Elyshia Gottier
Fax: (860) 871-0411
(860) 875-2199
E-mail: elyshia.gottier@circuitcellar.com
ADVERTISING COORDINATOR
Valerie Luster
Fax: (860) 871-0411
(860) 875-2199
E-mail: val.luster@circuitcellar.com
ADVERTISING CLERK
Sally Collins
CONTACTING CIRCUIT CELLAR
SUBSCRIPTIONS:
INFORMATION: www.circuitcellar.com or subscribe@circuitcellar.com
To Subscribe: (800) 269-6301, www.circuitcellar.com/subscribe.htm, or
subscribe@circuitcellar.com
PROBLEMS: subscribe@circuitcellar.com
GENERAL INFORMATION:
TELEPHONE: (860) 875-2199
Fax: (860) 871-0411
INTERNET: info@circuitcellar.com, editor@circuitcellar.com, or www.circuitcellar.com
EDITORIAL OFFICES: Editor, Circuit Cellar, 4 Park St., Vernon, CT 06066
NEW PRODUCTS: New Products, Circuit Cellar, 4 Park St., Vernon, CT 06066
newproducts@circuitcellar.com
AUTHOR CONTACT:
E-MAIL: Author addresses (when available) included at the end of each article.
For information on authorized reprints of articles,
contact Jeannette Ciarcia (860) 875-2199 or e-mail jciarcia@circuitcellar.com.
CIRCUIT CELLAR®, THE MAGAZINE FOR COMPUTER APPLICATIONS (ISSN 1528-0608) and Circuit Cellar Online are published
monthly by Circuit Cellar Incorporated, 4 Park Street, Suite 20, Vernon, CT 06066 (860) 875-2751. Periodical rates paid at Vernon, CT
and additional offices. One-year (12 issues) subscription rate USA and possessions $21.95, Canada/Mexico $31.95, all other
countries $49.95. Two-year (24 issues) subscription rate USA and possessions $39.95, Canada/Mexico $55, all other countries
$85. All subscription orders payable in U.S. funds only via VISA, MasterCard, international postal money order, or check drawn on U.S.
bank.
Direct subscription orders and subscription-related questions to Circuit Cellar Subscriptions, P.O. Box 5650, Hanover, NH
03755-5650 or call (800) 269-6301.
Postmaster: Send address changes to Circuit Cellar, Circulation Dept., P.O. Box 5650, Hanover, NH 03755-5650.
Circuit Cellar® makes no warranties and assumes no responsibility or liability of any kind for errors in these programs or schematics or for the consequences of any such errors. Furthermore, because of possible variation in the quality and condition of materials and workmanship of readerassembled projects, Circuit Cellar® disclaims any responsibility for the safe and proper function of reader-assembled projects based upon or from
plans, descriptions, or information published by Circuit Cellar®.
The information provided by Circuit Cellar® is for educational purposes. Circuit Cellar® makes no claims or warrants that readers have a right to
build things based upon these ideas under patent or other relevant intellectual property law in their jurisdiction, or that readers have a right to construct or operate any of the devices described herein under the relevant patent or other intellectual property law of the reader’s jurisdiction. The
reader assumes any risk of infringement liability for constructing or operating such devices.
Entire contents copyright © 2001 by Circuit Cellar Incorporated. All rights reserved. Circuit Cellar and Circuit Cellar INK are registered trademarks of
Circuit Cellar Inc. Reproduction of this publication in whole or in part without written consent from Circuit Cellar Inc. is prohibited.
CIRCUIT CELLAR®
www.circuitcellar.com
Design Logic
2001
CONTEST
$5000
$2000
$1000
1st
2nd
3rd
$3000
$2000
$1000
O
1st
2nd
3rd
15, 2001
.R
Pick a category and
submit your project by June
o
FPSLIC
E
LE
.H
i2
The Atm
el AT94K
System
f
Level Int amily of Field P
e
ro
grated C
combine
ircuits (F grammable
s all the
PS
basic sy
based m
stem bu LIC™ devices)
on
ild block
platform olithic field-pro
s (log
gr
a
for expe llows true syste ammable devic ic, memory, an
e. The F
d
m
nsive NR
PSLIC pro uC) in an SRA
E (non-r -level designs t
Mecurring
o be im
g
rammab
p
enginee
ring) cha lemented witho le SLI
ut the n
rges.
Two runners-up will receive a Handspring Visor™
eed
o
AVR
.G
iU
R
U
M
Atmel id
en
architec tified the need
ture dev
of an
eloped
for the C
s
p
e
la
cia
size ove nguage in orde lly
rhead. T
r
to reduc
he
machine
e
with 32 AVR ® microcont code
g
ro
to 12 tim
e
es faste neral-purpose re ller is a true sin
r than cu
g
rrently u gisters (accumu le-cycle RISC
lators) ru
sed MCU
nning 4
s.
Two runners-up will receive a Handspring Visor™
Atmel’s
AT
high de 40K coprocesso
nsit
rF
logic de y, compute-int PGAs are desig
ensive D
signs. St
ned for
SP and
ru
array m
other fa
ultipliers ctured logic fun
st
ctio
,c
busing r
esources an be impleme ns, including va
nte
—p
riable
power a
nd syste roviding drama d directly in co
re cells w
m cost.
tic impro
ith
vements
in speed out using any
, utilizat
ion,
Two runners-up will receive a Handspring Visor™
W
W
$3000
$2000
$1000
W
1st
2nd
3rd
o
FPGA
www.circuitcellar.com/DL200 1
sponsored
by
R
NEWPRODUCT
PRODUCT NEWS
NEW
Edited by Harv Weiner
LE
.H
i2
.R
O
The 32-KB secondary flash memory array is large enough
to store the boot loader code plus application code, making it
easier to write and debug.
The kit includes a fully populated DK4000 development
board with PSD4135G2 and a FlashLINK JTAG programmer
for 10-s in-system programming, ribbon and “flying-lead”
JTAG cables, a serial UART cable, and power supply. Also
included is a CD-ROM with PSDsoft Express and an application to perform in-application programming from a
PC.
The development kit
sells for $149.
Waferscale Integration
(510) 656-5400
Fax: (510) 657-5916
www.waferscale.com
W
W
.G
iU
R
U
M
The DK4000-C167 Development Kit is designed for
rapid prototyping of in-application programmable (IAP)
embedded systems using the Infineon C167 family of
microcontrollers.
The development board contains either an Infineon
C167 or Philips 80C51XA MCU, Waferscale PSD4135G2
with 512 KB of flash memory, a second 32-KB flash
memory array, 8 KB of SRAM, and a 3000-gate CPLD.
The C167 features a CAN bus
and A/D converter for highspeed, real-time control in
automotive and industrial
applications.
The 544 KB of flash memory allows room for complex
code, real-time operating systems, and the recording of
fault records, data logs, and
completed processed. It also
allows use in networked distributed processing applications with self-diagnosis software.
E
MICROCONTROLLER DEVELOPMENT KIT
New! 3cm-3m
Ultra-sonic
Ranger
W
Handy Board
Palm Pilot Robot Kit
5621 Arapahoe Ave. Suite C • Boulder, CO 80303
www.acroname.com 720.564.0373
8
Issue 128
March 2001
CIRCUIT CELLAR
www.circuitcellar.com
NEW PRODUCT NEWS
monitors the function of the primary photoelectric circuit through the use of additional emitter and receiver
elements. Separate redundant outputs are also included.
STB buttons are designed to immediately detect any
internal component failure and indicate the presence of
the failure by a red fault LED. When the power is on, a
green LED indicator indicates when power is on and off.
When the button output is activated, a steady red LED
shows on and off when the button output is not activated. The red LED flashes when a fault condition is
detected.
All models are supplied with a yellow polypropylene
(TP) field cover to prevent inadvertent switching. STB
buttons are immune to ambient light, EMI and RFI interference. And their high excess gain cuts through heavy
contamination.
List prices begin at $112.
LE
.H
i2
.R
STB self-checking optical touch buttons are
ergonomic touch buttons with a unique internal
microcontroller-based design. The STBs switch when
their light beam is broken by a simple insertion of a
finger, thus eliminating hand, wrist, and arm stresses
associated with repeated switch operation. No physical
pressure is required to operate the buttons.
The STB self-checking circuitry includes a diverseredundant microcontroller circuit that continuously
O
OPTICAL TOUCH BUTTON
U
M
E
Banner Engineering Corp.
888-373-6767
Fax: 763-544-3213
www.bannerengineering.com
W
W
W
.G
iU
R
Serial Graphics Done Right!
Incredible Time Saver – create a GUI in hours/days instead
of weeks/months
HTML-Based GUI – converts from HTML, JPEG, and GIF
into small, quickly-executable Amulet µHTML™ pages
1/4 VGA, 3.8-inch, Monochrome Display – with ultra
bright backlight and fully-integrated analog touch panel
Dedicated GUI Controller – manages the GUI, interacts with
the user, and controls the LCD – Frees up your micro!
Processor Independent – easily interfaces to most micro-
controllers (8/16/32-bit and even DSPs)
Replaces Traditional GUI Library – No library porting,
complex GUI programming, or RTOS required
Standard RS232 Interface – Up to 115.2 Kbps, cable included
The Easy GUI TM Starter kit (STK-GT320) also includes our
µHTMLTM Compiler, sample HTML files, and sample images.
Plus, the onboard flash is factory programmed with µHTML
pages so you can be up and running – right out of the box!
64K-Bytes of Onboard Flash Memory – For storing
hundreds of Amulet µHTML pages that you create
Ready To Integrate Into Your Product
©2001 Easy GUI and µHTML are Trademarks of Amulet Technologies. U.S. and Foreign Patents Pending.
www.circuitcellar.com
CIRCUIT CELLAR
Amulet Technologies
GUI Engines For Embedded Systems
www.AmuletTechnologies.com (408) 244-0363
Issue 128
March 2001
9
FEATURE
ARTICLE
John Piccirillo
achieved in just 13 amazing weeks.
The designs of some of the other
robots in the contest are also briefly
reviewed. The contest was particularly interesting because its structure
gave contestants leeway in design
choices and because two autonomous
robots competed against each other
and the clock in the same arena to
score points.
THE CHALLENGE
R
U
M
E
hirteen proved to
be a lucky number
for electrical and computer engineering students who took the senior design
class at University of Alabama in
Huntsville (UAH) in spring 2000. The
Institute for Electrical and Electronics
Engineers (IEEE) sponsors the annual
Student Hardware Competition for
colleges and universities in the southeast. This year, 13 UAH students won
first place with their class robot,
Phoenix.
In this article, I descibe the robot
the class designed, built, tested, and
sent to the competition. This feat was
O
.R
i2
W
W
W
.G
iU
For the UAH team,
bringing the Phoenix
to life was not a matter of studying a myth,
it took many hours of
hard work fueled by
intense enthusiasm.
The result was an
award-winning design
that used a variety of
techniques to navigate the course and
deposit the goods.
t
LE
.H
The Phoenix Rises to
Victory
The SouthEastCon 2000 contest
was based on a Y2K computer bug
analogy. An octagonal playing field
with no interior walls contained nine
symmetrically placed cylinders, or
receptacles (see Photo 1). Vehicles had
3 min. to place 12 steel balls into the
various receptacles whose Y2K status
and point value were indicated by
flashing LEDs and current-carrying
coils. The goal was to dispense a ball
into a receptacle to score points. A
match lasted 3 min.
The playing field layout and dimensions are shown in Figure 1. The floor
and outer wall are painted flat black
and the cylinders are flat white. The
cylinders have an outside diameter of
11.4 cm, an inside diameter of 9 cm,
and a height of 10 cm. Eight red LEDs
are distributed symmetrically around
the base of each receptacle at a height
of 2 cm above the playing surface.
A current-carrying coil consisting of
20 turns of wire with a radius of 15
cm is located underneath the playing
surface of each receptacle. When the
LEDs are on, each LED is driven by a
2.2-kHz square wave with 20-mA
peak current and a 50% duty cycle.
Photo 1—Look at Phoenix
on a practice playing field.
LEDs can be seen around
the base of the receptacles. Current-carrying coils
centered on each receptacle are beneath the playing field.
10
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
O
nent, and the cylinder sampling time
needed to be even shorter. Phoenix
was able to move from receptacle to
receptacle, dropping balls in high
value receptacles in an average of 4 s.
Thus, under ideal conditions,
Phoenix had time to drop about 15
balls in high-value receptacles, which
gives an approximately 25% safety
margin. In summary, the strategy
involved fast sampling and depositing
balls in high-value receptacles. In
practice, this went well. The speed
and strength of the platform was an
asset when encountering opponents,
even though the rules prohibited
intentionally aggressive behavior.
.R
the best strategy. There were four reasons for this choice. First, detecting
flashing LEDs and the frequency of
the current-carrying coil was easiest
and less error prone at a receptacle.
Second, it was easiest to deposit a ball
in a receptacle when the robot was
adjacent to it. Third, with an appropriately shaped bumper, a robot could
dock with a receptacle and thereby
realign any navigation errors. And,
fourth, moving directly from one
receptacle to another was the shortest
and fastest route.
The overall strategy was one of
moving rapidly from receptacle to
receptacle clockwise around the playing field once, moving to the center
receptacle, then back to an outer
receptacle, and repeating the pattern
(see Figure 2). If the receptacle is broken (100 points) or hidden (200
points), a ball is deposited. The robot
had an average of only 15 s to deposit
a ball (12 balls in 3 min.).
Because only 1/3 of the receptacles
were of high value, the robot’s average
minimum time to visit a high point
value cylinder was 5 s. Add in the
complication of occasional navigation
mistakes and collisions with an oppo-
i2
When the coils are on, each coil is
driven by a 200-mA, peak-to-peak
sine wave. At any time, each receptacle is in one of four states.
When in an inactive state (zero
points), the LEDs are off and there is
zero current in the coil. When compliant (10 points), the LEDs are off
and the coil has a 10-kHz frequency.
When in a broken state (100 points),
the LEDs are on and the coil has a frequency of 10 kHz. And, when hidden
(200 points), the LEDs are off and the
coil has a frequency of 15 kHz.
All receptacles are inactive until
play begins, then all are active. There
are always two broken, one hidden,
and six compliant receptacles. When a
ball is dropped into a broken or hidden receptacle, it instantly becomes
compliant and a randomly selected
compliant receptacle becomes broken
or hidden, respectively. Complete
contest information is available at
www.tnetch.edu/www/life/orgs/ieee/s
econ/rules.html.
PHOENIX EMERGES
W
W
W
.G
˚
45
iU
R
U
M
E
LE
.H
The match rules stated that the
maximum size of a robot was 20 cm ×
25 cm × 30 cm high. In addition, there
had to be a vertical bumper surrounding the robot between 4 and 6 cm
above the playing field and no part of
the robot could extend beyond the
bumper. The final version of Phoenix
comes close to the maximum dimenSTRATEGY
sions and weighs 9 lbs (the maximum
A robust strategy was required not
allowed was 7 kg, or 15 lbs).
only to maximize points dispensing
The 13 students worked in small
balls but also to contend with pergroups to develop the robot
formance errors and the
subsystems. The subsyspresence of a competitor on
tems include a physical
the playing field. After read45 cm
25 cm 25 cm 20 cm
robot, power supply and
ing the rules and pondering
distribution board, motor
the playing field, it was
driver boards, navigation
obvious that the most diffisensors, flashing LED
cult challenge was navigadetector, magnetic field
tion, especially because a
detector, ball dispenser, and
collision with an opponent
m
microcontroller. Let’s
might cause the robot to
c
15
R
examine these subsystems.
lose its position or orientaPhoenix has three main
tion. Several optional navilayers. The bottom layer
gation schemes were consid(see Photo 2) is the most
ered, among these were:
D 11.4 cm
burdened. The motors are
attached to it by a specially
• line following
fabricated bracket that
• wall following
holds the motors rigidly
• dead-reckoning with perialigned to each other and
odic updates
Start position
provides a firm support to
• moving directly from
the base. The battery box is
receptacle to receptacle
Perimeter wall
mounted behind the motor
• moving directly to recep10 cm high
White line
assembly. It carries four
tacles with flashing LEDs
Current-carrying
2 cm wide Receptacle
wire under the floor
9.6-V, 1500-mAh NiMH
batteries. Three of the batThe UAH team decided
teries are wired in series to
that moving directly from
Figure 1—The SouthEastCon 2000 contest playing field had a specific layout and
dimensions.
provide the power for the
receptacle to receptacle was
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
11
call
A
N=1
Go to outer receptacle
call
A
N=N+1
Go to next CW receptacle
call
A
No
N=8
A
Reverse
No
Match encoder presets
E
Yes
Rotate
No
U
M
IR Ranger ≤ preset
Yes
Forward
No
Time limit
Yes
LEDs on
No
10-kHz Signal
No
Yes
Yes
Drop
ball
Return
.G
Wall escape
Yes
iU
15-kHz Signal
No
W
Figure 2—The flowchart shows the sequence of
events performed by Phoenix.
W
W
24-V motors, and the other battery is
used for the electronics. The motor
driver board is mounted on top of the
motor bracket and a Sharp GP2D12
infrared ranging sensor is mounted to
the front of the motor bracket.
The LED detector unit (see Photo 3)
is mounted under the bottom layer, as
are the pick-up coils that sense the
magnetic field. Five-inch diameter
wheels were machined from 1/8²
thick aluminum. A 4 1/2² diameter
O-ring (a Hoover vacuum belt) is
stretched and cemented into a groove
machined into the wheel’s outer
perimeter. And, three ball casters stabilize the robot.
12
Issue 128
March 2001
MOTOR DRIVER BOARDS
Phoenix uses two motor driver
boards, one for the two DC motors
powering the wheels and one for the
stepper motor that powers the ball
dispenser. Although the DC motors
require only about 600 mA steady
state, rapid changes in speed, including frequent motor stalls while docking with a cylinder, kept blowing the
1-A motor driver chips. So, we
switched to an old reliable, National
Semiconductor’s 3-A LMD18200, one
for each DC motor.
The stepper driver uses Allegro
MicroSystem’s UCN5804 unipolar
driver chip, which is more than adequate for voltage and current handling
for the unipolar stepper motor.
Although wasteful of power, a couple
of 10-W power resistors were used to
drop the 30-V battery voltage to the
24 V required by the stepper motor.
The circuits for both motor driver
boards were the minimum required
for chip operation, as shown in
National Semiconductor’s application
note. [1]
LE
.H
Yes
O
Go to center receptacle
R
No
board furnishes separate motor and
electronic supply power, with separate switches and fuses. This helps
isolate motor noise from the electronics and is helpful for testing various
sensor and microprocessor functions
without the robot scurrying about.
The motor supply part of the board
supplies 30 V for the DC motor and
stepper control boards. A 7805 linear
regulator on the electronics side supplies power for the various sensors
and sensor interface electronics. The
BasicX-24 microprocessor onboard
regulator is powered directly from the
9.6-V electronics battery.
.R
Wait loop
10-kHz Signal
No Yes
15-s Time limit
Yes
A black plastic bumper, 2 1/2 cm
high, is mounted around the robot.
The bumper contains no sensors. The
robot is driven against a cylinder and
the bumper aligns the robot so that
the LED detector is looking squarely
at the receptacle LEDs and the ball
dispenser tube is pointed toward the
center of the receptacle. The wheels
are driven long enough for the robot
to seat itself against a receptacle.
Two 24-V Globe motors drive the
robot. When handling a moderate
load, the motors function at 63 rpm,
80 oz-in torque, and draw approximately 0.58 A each. Each motor has
an encoder that produces approximately 140 pulses per output shaft
revolution. These motors are 3 1/2²
long without the output shaft, and
determine the minimum width of the
robot. In practice, the motors were
never run at more than 80% of their
rated voltage.
The middle layer supports the
NetMedia BasicX-24 microprocessor
and power distribution board. The top
layer is the ball dispenser assembly.
Balls are placed in a dial much like
that used in rotary phones. It was
essential to have the ball dispenser up
high so that gravity would give the
dropped balls enough momentum to
shoot from behind the bumper well
into the receptacle. Upon instruction
from the microcontroller, a stepper
motor, driven with a stepper driver
chip, advances the dial so that a ball
falls through a hole, into a tube, and
emerges just above a receptacle. A 24V, unipolar stepper motor with a 1.8°
step angle and 50 oz-in holding torque
was more than sufficient to rotate the
dial carrying the twelve 7/16² diameter steel balls.
i2
Powerup
POWER SUPPLY AND
DISTRIBUTION BOARD
As mentioned previously, four
NiMH batteries power the robot.
When fully charged, these batteries
put out about 10.1 V and wiring three
together supplies more than the 24-V
motors required.
The motor voltage varies, depending on the robot’s desired motion, by
pulse width modulating the motor
control chips. The power distribution
CIRCUIT CELLAR®
NAVIGATION SENSORS
The only sensors used for navigation were one Sharp GP2D12 analog
infrared ranger and the encoders on
both DC motors. The self-centering,
docking bumper allowed for fast, reliable movement among the receptacles. Phoenix circumnavigated the
playing field until all outer eight had
been visited, then moved to the center receptacle before returning to the
outer ring and repeating the pattern.
www.circuitcellar.com
Embedded Systems
Developers. . .
Grab These Guides!
Programming Microcontrollers
in C, Second Edition
by Ted Van Sickle
ISBN 1-878707-57-4
O
“I get a constant stream of queries
for introductory texts to the
embedded systems world. This is
–EDN
the book.”
i2
.R
Completely updated
and packed with
practical info on how
to use C to fully
exploit the power of
today’s microcontrollers. The CDROM contains the
listings of all programs in the book, C
compilers, a full set of Motorola’s
microcontroller documentation in
searchable pdf format, and a Deluxe
eBook version of the text. All for only
$59.95! (Downloadable Deluxe
eBookTM version, only $44.95.)
W
W
W
.G
iU
R
U
M
E
LE
.H
ing frequency. Because
Phoenix docked solidly
against receptacles, the
tone decoder was unnecessary. And, instead of a
phototransistor, a photologic detector senses the
state of the LEDs.
These devices incorporate a phototransistor,
buffer, Schmitt trigger,
and an open collector or
totem pole output stage
all in a package the size
Photo 2—The top of the bottom layer shows the top of the motor assemof a regular phototransisbly (top plate at left), with the motor driver board in the center, the battery
tor for less than $1. Eight
box in the rear, and the wheels on the sides.
of these detectors are
mounted side by side in a black box
While moving from one receptacle
directly below the docking bumper,
to the next, Phoenix backed away a
with the individual detector outputs
fixed distance using the motor
connected to an eight-input OR gate.
encoders, then pivoted slowly around
When docked at a receptacle, the
one wheel while searching with the
detectors span a little more than 1/8
IR ranger for the next cylinder.
of the circumference, ensuring that at
Occasionally, the IR sensor would get
least one detector is saturated with
a false positive reading. To remedy
light from one of the LEDs. The logic
this, the software required a second
level output of the detector is interconfirmation reading with the robot
faced directly with the OR gate, the
stopped before charging the next
output of which goes directly to the
receptacle. Usually this was unnecesmicroprocessor.
sary, but other times two or three
false positives occurred in a row.
MAGNETIC FIELD DETECTOR
After a receptacle was found and
At the beginning of every contest
confirmed, Phoenix accelerated
match, the wire coils under eight of
toward it, reducing speed a few inches
the nine receptacles were energized
per second before colliding. A stepped
with a 10-kHz sinusoidal current, the
acceleration, rather than a full charge,
ninth coil was energized at 15 kHz.
was necessary to prevent the wheels
During the period of play, the pattern
from skidding, altering direction, and
might change but all of the coils
striking the receptacle off center.
remained energized, with only one at
Although the bumper would rectify
the 15-kHz rate.
the alignment, striking a receptacle
Phoenix used these magnetic fields
too far off center results in a robot
for two functions: to detect the hidposition that makes it difficult to
den receptacle (worth 200 points) and
reach the next receptacle. Slowing
navigation errors resulting in a collidown before striking a receptacle
sion with the outer wall. Pick-up coils
helps to keep Phoenix from shaking
consisting of 50 turns of enameled
apart. In the 3-min. time limit of the
magnet wire were used to sense the
contest, Phoenix can circumnavigate
presence of a magnetic field. A dualthe playing field a little over six times
tone decoder board provided a logic
if no opponent or navigation errors
level output for detection of a 10- or
are encountered.
15-kHz field.
Occasionally, Phoenix would detect
FLASHING LED DETECTOR
and charge the opponent robot or
Phoenix used a simple method to
alignment problems would cause the
detect the state of the LEDs around a
robot to either miss the next receptareceptacle’s base. Our first inclination
cle or fail to disengage from the curwas to use phototransistors and a tone
rent receptacle. Any of these situadecoder to identify the 2.2-kHz flashwww.circuitcellar.com
CIRCUIT CELLAR®
For more info on this title and the
author, visit www.a-sync.com
Embedded
Controller
Hardware Design
by Ken Arnold
ISBN 1-878707-52-3
Offers a great
overview of microcontroller architecture, design
analysis, memory technologies,
interrupt handling, hardware
interfacing, designing for reliability,
and much more. The CD-ROM
contains useful design tools and a
Deluxe eBook version of the complete
text. Only $49.95! (Downloadable
Deluxe eBookTM version only $37.50.)
For more info on this title and author,
visit:
www.embeddedcontrollerhardwaredesign.com
To order, call 1-800-247-6553
or visit www.LLH-Publishing.com
Available at
bookstores
everywhere
Issue 128
March 2001
13
The IEEE Southeast Conference
2000 Student Hardware Competition
.G
W
TESTING
W
W
Construction of the robot proceeded
in parallel, with subgroups of students
working and testing different modules: the mobile platform, LED detector, magnet field detector, ball dispenser, and programming. Groups
that finished their assignment either
helped another group or worked on
something else, building the playing
field or testing an alternate sensor or
strategy. For instance, one group that
finished early built and tested a collision detection system with 12 IR
detectors, which wasn’t used in the
final robot, but was ready as a backup
if final testing proved a need for it.
14
Issue 128
March 2001
i2
.R
O
was held in Nashville, TN, on April
8. The UAH team won against teams
from 18 other southeastern colleges
and universities, winning every
round, achieving the highest single
score and the highest cumulative
score. The competition was interesting for the great variety of approaches
taken by different groups to solve the
same problem. There was also a wide
range in the state of readiness of the
competing robots.
As mentioned previously, other
robots used different strategies. The
most popular navigation technique
was line following, using the white
painted lines to find the receptacles.
Some robots followed the lines and
propelled a steel ball into a chosen
receptacle and others departed from
the line to dock with a receptacle
then backed away to regain a line and
proceeded to the next receptacle.
This was done with different
degrees of success. Some line followers were smooth and others did a lot
of wavering. One robot followed the
walls and shot balls into cylinders.
There were several robots that
depended on last minute fixes that
didn’t materialize, and they either
didn’t move or barely moved.
The most unique robot we saw used
a concave bumper section similar to
the one on Phoenix to dock with the
center cylinder and propel itself
LE
.H
E
SOUTHEASTCON 2000
iU
The brain of the robot is a BasicX24 microcontroller by NetMedia. This
is the ideal controller for a project of
this size. Among the advantages are
easy programming, speed (about
65,000 lines of code per second), and
32 KB of memory. BasicX-24 also has
16 I/O lines, including eight with
alternate A/D input (used for the IR
ranger), floating-point arithmetic, and
an internal timer, which allowed dual
PWM control of the DC motors independent of the CPU. Check out the
block diagram of Phoenix in Figure 3.
U
M
MICROCONTROLLER
Testing and more testing was one of
the keys to our success. We tested
everything relentlessly, not only for
nominal performance but also for any
situations that we could imagine
might occur.
Testing was used for two vital functions, to wring out the failure modes
and to get insight into the robot’s
behavior and how to improve it. The
importance of the latter is often unappreciated. For instance, initially the
class thought it would be simpler and
satisfactory to only sample the outer
ring of receptacles, without making
special navigation procedures for
going to and from the center receptacle. While practicing going around the
outer ring, the robot IR ranger missed
a receptacle and continued searching,
found the center receptacle, and
docked with it.
It became clear that this was going
to be easy to implement. Indeed,
Phoenix was one of the few robots
that sampled the center receptacle,
and the only one that did so on an
equal and regular basis. Further testing revealed infrequent failure modes
that otherwise would have been
missed, though inevitably would have
been manifested during the contest.
R
tions would result in Phoenix either
docking at an unintended receptacle,
which still resulted in a valid sample
cycle, or striking the outside wall.
By checking whether or not any
magnetic field was present, Phoenix
distinguished between receptacle and
wall docking. If a wall was encountered, a special section of code was
used to escape and get back into the
regular sampling pattern.
Phoenix deposited one of its 12
steel balls whenever it docked at a
“broken” or “hidden” receptacle.
These were held in a rotary dial with
13 holes, the thirteenth hole is used
for initial alignment. A stepper motor
rotates the dial 27°, 15 steps, to the
next position and a ball falls down a
copper tube and emerges just above a
receptacle with enough speed to project it past the center, striking the
inside far wall. Phoenix never dispensed a ball that missed the target.
Ball
dispenser
Unipolar
motor
Stepper
controller
6
5V
Sharp
GP2D12
30 V
10 V
17
14
BasicX-24
16
15
Microcontroller
5
5V
6
7
27
26
5V
15 kHz
16 A/D
10 kHz
Dual
tone
decoder
8
10
50-Turn
coil
9
LED
Detector
Direction Break
signal signal
5V
Left
motor
Left out
Encoder
PWM PWM
Break Direction
signal
signal
LMD 18200
Dual motor controller
30 V
Wheel
Right out
5V
5V
Encoder
Right
motor
30 V 10 V 5 V
Battery
packs
30 V
15 V
Power
distribution
Figure 3—Phoenix uses NetMedia’s BasicX-24 microcontroller to control operations.
CIRCUIT CELLAR®
www.circuitcellar.com
O
.R
i2
LE
.H
W
W
W
.G
iU
R
U
M
E
Microchip www.microchip.com
ballistic missile defense technologies
for defense contractors, then retired
to devote his energies to behaviorbased mobile robotics. You may
reach him at jpicciri@eb.uah.edu.
SOURCES
O
.R
Motors
Globe Motors
(937) 228-3171
Fax: (937) 229-8531
www.globe-motors.com
Vacuum belt
The Hoover Company
www.hoovercompany.com
W
W
W
.G
iU
R
U
M
E
LE
.H
around in circles. While circling
around, it looked only for the high
value hidden receptacles. When it
found these, it stopped, aligned its
position, and shot a ball into the
receptacle. This robot worked well
and was my choice for winner.
After the first round, Phoenix was
paired with this robot. Phoenix
always charged the center receptacle
first before moving to the outer ring.
While attempting to move to the
outer ring, the robots met and
Phoenix pushed the other robot off
center. Apparently the other team had
not anticipated this and made no provision for re-docking with the center
receptacle and scored no points during
the round.
In the end, I attribute the success of
the class robot to its reliability, speed,
strength, and error recovery programming, but most of all to the long
hours and enthusiasm that the students put into their project. I also
gratefully acknowledge generous
grants from Adtran and the IEEE
Huntsville section. I
i2
Photo 3—Eight photologic transistors are housed in a
black box that’s placed under the front bumper. The
box is curved to match the shape of a receptacle.
UCN5804
Allegro MicroSystems, Inc.
(508) 255-3476
Fax: (508) 853-3353
www.allegromicro.com
Author’s Note: The photographs are
courtesy of Dave Everett. The
Phoenix team students included
Dave Patterson, Steve Pitts, Mike
Clackley, Joe Caldwell, Lee Hicklen,
Jim Saare, Robbie Burrough, Jaime
Woods, Casey Jones, Stephen Hodges,
Tim Lindsey, Richard Marcy, and
William Santosa.
John Piccirillo, Ph.D., is a part-time
instructor in the Electrical and
Computer Engineering Department at
University of Alabama in Huntsville.
After attaining a doctorate in astronomy, John spent 20 years working on
16
Issue 128
March 2001
CIRCUIT CELLAR®
LMD18200
National Semiconductor Corp.
(408) 721-5000
www.national.com
BasicX-24 microcontroller
NetMedia Inc.
(520) 544-4567
Fax: (520) 544-0800
www.netmedia.com
GP2D12
Sharp Electronics Corp.
(201) 529-8200
Fax: (201) 529-8425
www.sharp-usa.com
REFERENCE
[1] National Semiconductor Corp.,
“A DMOS 3 A, 55-V, H-Bridge:
The LMD18200,” AN-694,
December 1999.
RESOURCES
Adtran, Inc.
(800) 923-8726
(256) 963-8000
Fax: (256) 963-8699
www.adtran.com
Institute of Electrical and
Electronics Engineers, Inc.
IEEE Huntsville Section
www.geocities.com/capecanaveral/4199/ieeehsv.htm
www.circuitcellar.com
Mixed-Signal Controllers
MSP430F1101: a 16-bit RISC
Flash MCU for only $0.99
*
■ Ultra-low power consumption –
250-µA active mode, 0.8-µA standby
mode at 2.2 V (typ.)
SMCLK
RAM
128/256 B
Power-On
Reset
Port 1
With IRQ
Capability
.R
FLASH
1/4 kB
■ Integrated analog comparator ideal for
precise mixed-signal measurement
MAB
JTAG/Debug
■ 16-bit RISC architecture enables new
applications at a fraction of the code size
LE
.H
MDB
■ 16-bit PWM timer allows highly flexible
multichannel capture and compare
ACLK
Watchdog
15-bit
Timer_A3
16-bit
Comp_A
Port 2
With IRQ
Capability
SMCLK
Comp_A
■ In-system programmable Flash
permits last-minute code changes and
field upgrades
E
RISC
CPU
16-bit
i2
MCLK
■ The MSP-FET430x110 complete
integrated development environment
available for only $49
6
$0.99 (10Ku)*
$1.74 (10Ku)
U
M
1 kB Flash
4 kB Flash
MSP430 Road Map
Flash
R
MSP430F1101
MSP430F1121
OEM ROM
LCD Driver
Performance
Flash
LCD Driver
1998
2000
2002
W
W
W
.G
iU
Join in the latest revolution: ultra-low-power Flash MCUs at ultra-low prices from
Texas Instruments. The MSP430 is the ultra-low-power solution for mixed-signal processing.
The F1101, a Flash MCU with a modern 16-bit RISC architecture, combines TI’s expertise in
analog and digital signal processing. Its ultra-low power consumption makes the F1101 ideal
for battery-powered applications such as utility metering, intelligent sensing and portable
measurement. On-chip emulation simplifies application development. Best of all, all of the
MSP430 devices, including the F1101, are source code compatible.
F1
10
1
8-MHz
Basic
Clock
O
8
ACLK
Contact us for the
MSP-FET430x110 development
tool for only $49 or a free
www.ti.com/sc/f1101
1-800-477-8924, ask for ext. F1101
MSP430x11x1 data sheet.
The red/black banner is a trademark of Texas Instruments. 39-6800
T
H E
W
O R L D
L
E A D E R
© 2001 TI
I N
DSP
A N D
A
N A L O G
i2
Building Organic Robots
with Students
t
LE
.H
A How-To Lesson
R
U
M
E
he Organic Robot
presentation is a
simple hands-on lesson
that lets students design,
program, and build a simple robot in
the classroom. The presentation can
be performed without tools or expensive robot kits. The Organic Robot
was originally developed for robotics
hobbyists to use to teach gifted elementary school students. Since the
presentation was developed, middle
and high school students, Boy Scouts,
and adults have used it too.
It’s easy to learn how to present the
Organic Robot. The presentation can
be performed in two to three hours or
used as the introduction of an entire
unit on robotics. Only some simple
props and a blackboard are needed.
Instead of using an expensive robot
(that the whole class shares), the presentation lets students brainstorm to
design the robot and develop a programming language.
After the robot is designed and the
programming language is developed,
the children make a flowchart of a
program for the robot. All of the
design, development, and programming are performed on a blackboard.
Then the robot is constructed out of
the children (organic parts).
W
W
W
.G
iU
Getting people interested in robots is not
a hard task, but most
people don’t realize
just how easy it is to
build a robot of their
own. Since the
Organic Robot came
along, students of all
ages have learned
basic robotics techniques and methods.
Now it’s your turn!
18
Issue 128
March 2001
O
Ken Boone
Since 1980, members of the
Triangle Amateur Robotics Club
(TAR) have been giving robotics presentations for the Parents for the
Advancement of Gifted Education
(PAGE) Saturday morning program.
The PAGE program was developed by
a group of Raleigh, NC parents who
wanted their gifted children doing
something better than watching TV
on Saturday mornings. In the early
days, TAR demonstrated robots and
talked about robotics in the classes.
Although they enjoyed demonstrations, it was difficult to keep the students’ attention. We thought the class
would stay more involved if each student could actually build a robot to
take home.
We developed a remote control
device called the TAR Rat. The Rat is
a wooden base with two wheels, a
couple of motors, and a battery pack
that is attached with wires to a box
with two switches (see Photo 1). More
than 100 Rats were built. The students put them through exercises to
simulate robotic tasks. The Rat was
redesigned several times (see Photo 2);
plans for the last design are on my
web site (www.kensrobots.com).
The Rat was good, but it really wasn’t a robot. In addition, PAGE had to
charge extra to pay for the supplies
and it took too much time outside of
class to prepare the parts. This is
when the Organic Robot entered the
picture. We started discussing how we
could design a small, modular, real
robot that students could help assemble and program during class.
Eventually we decided real robots
are impractical. They would be too
expensive to take home. And they
.R
FEATURE
ARTICLE
HISTORY
CIRCUIT CELLAR®
Photo 1—The wire-controlled TAR Rat was used to
teach gifted children. This is the last version.
www.circuitcellar.com
R
U
M
E
LE
.H
i2
.R
O
simplified definition of a true
robot. I like to use, “a robot is a
machine that can be proRange
Light
grammed to do a task. After it’s
sensor
sensor
Radio
programmed, the robot can
Compass
repeat the task and/or be proController Motor
grammed to do another task
Motor
Wheel
Wheel
without redesigning the robot.”
Power source
Next, start taking items out
of the boxes. Start with tiny
wind-up, walking and hopping
Bumper
toys. Take one out, wind it up,
Caster
and let it move across a desk.
Radio
Ask the students if this is a
Computational
robot. Usually, you get both yes
unit
and no answers. Then, define a
machine as “a device that is
Figure 1—As the students call out the robot parts, draw them on
built to only do one thing. It
the blackboard. Remember to draw the computational unit away
cannot do something different
from the robot. Tell the children that the computational unit is too
unless the machine is taken
heavy for the robot to carry.
apart and put back together in
something about each of them. I’m
a different way.”
always looking for new pictures in
Continue taking wind-up toys out
science magazines, amateur robot
and repeatedly ask if they are robots
books, amateur robot magazines, and
or machines. After that, take out a
on the Internet. I list many good locabattery-powered walking toy (if you
tions on my web site.
have one) that looks like a robot and
One of my favorite robots to talk
ask if that’s a robot. Explain again
about is the Raccoon Buster. This is
that this machine cannot change
one of the first amateur robots that
what it does.
did something useful. I discovered
Take out the dog with the fur and
this robot in a 1985 issue of another
plastic body removed, turn it on and
magazine. Mike Rigsby takes credit
start it moving across the desk. Ask
for creating the Raccoon Buster out of
the question again. What is this?
the first true robot toy, Big Trek
While they are guessing, get out the
(Milton Bradley). [1] Big Trek can be
second dog that still has fur and start
programmed to move forward,
it. Show them that the dog is an
reverse, turn right/left, and fire its
ingenuously designed machine that
blaster. After it’s programmed, Big
can bark, sit down, and walk.
Trek will Run the program entered
Now it’s time to bring out a TAR
every time the run button is pressed.
Rat (or any wire or RC control
It is a true robot by my definition.
device), drive it around, and ask if it’s
My overhead transparency shows
a robot or a machine. After listening
the Big Trek with an automatic camto replies, discuss the difference
era attached to it. When focusing on
between a tele-operated or remotesomething, the camera turns its lens.
controlled machines and robots. Often
In the article, Rigsby explains how he
machines operated from a remote
attached a lever to the lens and a
location are inaccurately called a
switch to the camera. The switch is
robot because most of these devices
connected across the Run button on
can do nothing on their own. I call
the Big Trek. When something
them tele-operated machines.
appears in front of the camera, the
However, if the tele-operated device
camera focuses on the object by turncan act independently and the operaing the lens. And then, the lever
tor just gives it directions once in a
attached to the lens closes the switch,
while, it may be a robot.
and the switch makes a connection
At this point, start showing the stuacross the Run button, thus starting
dents overheads or pictures of interBig Trek’s program.
esting or famous robots and mention
W
W
W
.G
iU
would require even more preparation
time than the Rats. It would be difficult to involve all of the students, and
we couldn’t figure out a robot that
they could assemble and program in
just six one-hour classes.
Then I thought of the Organic
Robot. Why not brainstorm with the
students and let them design the
robot, develop the programming language, and build the robot out of their
own bodies? Because the students are
the organic part of the Organic Robot,
they get to take part of the robot
home with them. The best part is that
the Organic Robot presentation takes
little preparation time and you can
complete it in only three one-hour
class sessions.
There are certain required materials. For each group of five to eight students, a paper grocery bag, notepad,
pencils, and three blindfolds are needed. And, if you have them, one of
each of the following is useful: a compass, ultrasonic tape measure, and a
pair of two-way radios. Make sure you
have a bright light and a drop cord for
the classroom.
A handful of other items are not
required but greatly enhance the presentation. A robotic toy that can be
programmed to do different things
would be useful. Several wind-up
walking, hopping, flipping toys (the
tiny ones), and plush, battery-powered, walking toys are useful. The
barking dog that sits works well. If
you have two identical barking dogs,
take the fur off of one of them.
Radio-controlled or wire-controlled
toys and Furbys are good additions.
Also, overheads of actual robots like
MIT’s Cog and Sony’s AIBO robots are
good additions.
THE PRESENTATION: THE FIRST
HOUR
During the first hour of class, develop definitions for a robot and machine
and illustrate the definitions with
mechanized toys and robots. Begin
the presentation with most of the
toys and robots in closed boxes. After
introducing yourself, ask the students
to define a robot. Allow them to
speak up until their answers include a
computer and program. Then, give a
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
19
W
W
W
.G
iU
R
U
M
E
LE
.H
i2
.R
O
The robot was programmed
gested at this point. So, draw
a)
b)
to go forward 2¢, fire its blaster,
two motors and connect them
Turn north
Start
then back up 2¢. Rigsby placed
to the wheels.
the robot in front of his garbage
Then, discuss how it is easier
cans to combat raccoons. When
to move around if you have two
Check
a raccoon heads for the trash
motors and can turn in place.
Forward 2′
range
cans, the camera focuses on the
Grab the controls of the TAR
animal, pressing the switch
Rat to demonstrate the moves
starting the robot’s program.
that a two-wheeled robot can
No
Range
Turn to
Forward 1′
Certainly no self-respecting racmake. It can spin in place with
<2
light
coon would hang around a
the wheels going in opposite
charging robot firing a blaster.
directions, move forward and
Yes
If you have a robot or robotic
reverse, and make sweeping
End
toy, program it to run the same
turns by running just one
program and demonstrate runmotor. You can draw the moves
Figure 2—Here’s how to draw flowcharts on the board. Each example is
ning the program a couple of
if you don’t have a robot.
a simple program that you can demonstrate by pretending you are a
times reenacting the raccoon
Next, ask if the robot has
robot and executing them. (b) shows a program that makes the robot
situation. Then change the proenough
wheels. Will the robot
move forward until it is within 2¢ of a wall.
gram to demonstrate how you
fall if it has only two wheels?
can make a robot do something differSuggest using casters.
Typically students come up with
ent without rebuilding it. I was lucky
When the students suggest either a
the following list of parts: wheels,
a few years ago when I found a Big
camera or light sensor/detector, I
motors, drive trains (gears and axles),
Trek at a yard sale. But, any true
draw two light detectors and mention
batteries, controller/computer, comrobotic toy or amateur robot will
that this is a simple robot. It only can
munications interface, wires, light
work. You can act out this scenario if
tell which light detector is detecting
sensors (suggest two so the robot can
you don’t have access to a robot.
more light.
turn toward the light), camera, comIf the presentation is divided into
The students may miss a couple of
pass, sound sensors, distance sensors,
three one-hour classes, use the rest of
points. If they don’t suggest bumpers,
bumpers (front, back, right, and left),
the first hour to demonstrate addian easy way to remedy the situation
speaker, and frame. They usually
tional robots or show video clips.
is to pretend you’re a robot and bump
include a blaster, flame-thrower, gun,
into something. When someone sugor cannon, too.
gests a controller or computer, draw a
THE SECOND HOUR
Just say this is a peaceful robot.
box on the robot and mark it as the
During the second hour, you and
Mention the “Three Rules of Robots.”
controller and draw a second box
the students will design the Organic
Isaac Asimov proposed the three funaway from the robot and call it a comRobot, develop the operating landamental rules in his book I, Robot
putational unit. Also make sure to
guage, and write the program. The
(you must read it). The rules are proexplain that the computational unit is
first step is a brainstorming session to
grammed into robots in his novel to
too big for the robot to carry and sugdesign the robot. I set ground rules so
keep the robots from hurting humans.
gest wireless communications.
that the event goes smoothly and all
The rules are:
Of course, the only sensors the
of the students feel accomplished. I
“1. A robot must not injure a
robot needs to get out of the room are
make sure they understand that there
human being, or, through inaction on
the bumpers and two light sensors.
are no bad ideas, so students must
its part, allow a human being to come
However, draw any other suggested
respect each other’s contributions.
to harm.
sensors on the robot.
Then the fun begins.
2. A robot must obey the orders
Let the students know what tasks
given it by human beings except
their robot will perform; without
ROBOT CONTROL LANGUAGE
where such orders would conflict
assistance, the robot has to be able to
Now that you have a robot and
with the First Law.
get out of a room with furniture in it.
computational unit, you need a pro3. A robot must protect its own
To help the robot navigate, there will
gramming language. Start the brainexistence as long as such protection
be a bright light in the hall outside
storming session by asking if any of
does not conflict with the First and
the open door of the room.
the students have programmed. Even
Second Laws.” [2]
Now the brainstorming session
with my youngest classes, someone
starts. While brainstorming, everyone
always has programming experience.
DRAWING THE ROBOT
says the first thing that comes to
Discuss programming and explain
When the students first mention
mind. As the students call out the
that the robot’s programming lanwheels, quickly draw the two large
parts of the robot, draw the items on
guage already has the usual basic
wheels. Then ask them something
the board. I usually end up drawing
commands. They get to add additional
like, “Is this all it takes to make it
the same robot (see Figure 1).
robot commands.
move?” Usually you hear motors sug-
20
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
O
.R
i2
W
W
W
.G
iU
R
U
M
E
LE
.H
Until Interrupt commands, the computStart
er stops the robot
when a bumper is
Turn
pressed, then returns
toward
light
to the program to
execute the next
command.
Check
This provides a
bumpers
good segue to the
Forward and Reverse
Yes
Front
Reverse 1′
Reverse 1′
bumper
x¢ commands.
No
Mention that the
computer stops the
Yes
Turn
Turn
Right
robot and returns to
counterclockwise
clockwise
bumper
45°
90°
No
the program to execute the next comYes
Left
bumper
mand after completForward 1′
Forward 2′
No
ing the commanded
distance or when a
Forward 4′
bumper is pressed.
The Turn command also needs an
amount to turn or
Figure 3—Elementary school students can write a simple “get out of the room”
flowchart program with guidance from the presenter.
the robot will not be
able to stop turning.
If you have to, become the human
Give an example and then ask the
robot again. After they give you the
students to call out high-level control
command to turn, don’t stop until
commands. Write the robot comthey tell you to stop. You may have to
mands on the board as the students
teach the students what clockwise
announce them. The usual list
and counterclockwise mean.
includes: start, stop, forward until
Also note that the robot can’t turn
interrupted, reverse until interrupted,
if one of its bumpers is touching
forward x¢, reverse x¢, turn clockwise
something. When the robot finishes
x°, turn counterclockwise x°, turn
the turn or stops because a bumper is
toward light, turn north, check
pressed, the computer returns to the
bumpers, check range, boogie, and
program to execute the next highend (power off).
level command.
Now, let’s examine the operation of
When discussing the light sensors,
each high-level command. If you’re
mention that vision systems are
working with elementary school stuexpensive and require powerful comdents, keep the definitions simple.
puters to interpret the video signals.
The Start command is placed in the
Because this is a simple robot, it uses
computer program to indicate where
only two simple light brightness senthe computer should start executing
sors. Each sensor is attached to the
high-level commands.
robot’s computer and the computer
When forward is suggested, ask if
determines which sensor is receiving
anything else is needed with the
the most light.
Forward command. If they don’t sugWhen it’s activating the Turn
gest a Stop command, use yourself to
Toward Light command, the computdemonstrate again. What happens
er turns the robot toward the sensor
when the robot continues forward
receiving the most light. However,
indefinitely? Inform them of computwhen both sensors receive the same
er interrupts. When the computer
light or a bumper is pressed, the comreceives an interrupt, it stops and
puter stops the robot and returns to
determines what it should do next.
the program to execute the next highWhen the computer is executing the
level command.
Forward Until Interrupt or Reverse
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
21
i2
.R
O
er flowchart of the “get out of the
room” program. If the students want
to use a decision box, remind them
that you have to read the sensor just
before the decision box. Continue
building the flowchart on the blackboard. As the program expands, start
asking how it would handle situations
that have not been covered by the students’ program.
It’s difficult to keep a large class
focused on making the program flowchart. When the flowchart is half
completed, I recommend that the
class be divided into groups of five to
eight students with advisors who
understand the commands and how to
make flowcharts.
When creating the flowchart with
older students or adults, divide them
into groups of four, with each advisor
covering two groups. Brainstorm the
first five or so boxes and then have
each group finish its own program.
With the older classes, the advisors
just answer questions and check the
flowcharts for programming errors.
Figure 3 is a program example written
by some of my younger students.
W
W
W
.G
iU
R
U
M
E
LE
.H
computer executes the next
high-level command in the
program.
The computer stores the
distance sensor’s reading in
the range variable when the
Organic robot
Check Range command is
executed. Then again, the
computer returns to the program to execute the next
command. The distance senProgram
sor measures the distance
from the robot to an object
Computational unit
directly in front of the robot.
The Boogie command can
be used to celebrate the
Figure 4—Four volunteer students form the moving part of the
robot’s completion of a task.
robot. Notice that the computational unit is separate.
When the computer executes
the Boogie command, the robot
If students propose a compass as a
makes noises and turns back and
sensor, tell them the robot is simple
forth for 4 s before returning to exeand its compass only can determine if
cute the next command.
the robot is facing north. The comThe End command logically ends
puter turns the robot until it faces
the computer program. The computer
north or the bumper hits something
will stop executing commands and
when the Turn North command is
beeps briefly every 10 s to indicate
executed. Then, again the computer
that the robot power is still on.
returns to the program to execute the
next high-level command.
FLOWCHART PROGRAM
You should explain to the students
When you and the students finish
how the bumpers operate. When the
the commands, it’s time to start procomputer is executing any command
gramming. Explain how program
that requires turning or moving forflowcharts are used to visually repreward/reverse, the computer stops the
sent the paths taken in a program as
robot when a bumper is pressed.
the program executes. The flowchart
When the robot stops, the computer
is made up of process boxes, decision
exits the command it was executing
diamonds, and lines with arrows to
and returns to the program to execute
indicate the direction of program
the next high-level command.
flow. I included the flowcharts in
When a new program command
Figure 2a and b as examples of how to
requiring motion is executed, the
draw the charts on the blackboard.
computer checks if a bumper is
The process boxes represent actions
touched before moving. The computer
taken by the program. My flowchart
will move the robot while a bumper
process boxes contain high-level comis touching something only during the
mands from the robot programming
following situations:
language. Figure 2a shows a flowchart
of the robot turning north, moving
• Move forward if the back bumper is
forward 2¢, then turning toward the
touching.
light. The program starts at the top
• Move reverse if the front, right, or
box and continues down following the
left bumpers are touching.
lines and arrows. The decision diamonds are used when the program
Note that if none of the bumpers
flow needs to take different paths
are pressed, the Check Bumpers combased on variable or sensor data.
mand then sets the front, rear, right,
If you are presenting to a small
and left bumper variables value to 0.
class of elementary school students
And, bumper variables are changed to
(16 students or less), start another
1 if the bumper is pressed. Again,
brainstorming session to make anothafter the bumper variables are set, the
22
Issue 128
March 2001
CIRCUIT CELLAR®
THE THIRD HOUR
During the third hour of the presentation, the robot is constructed and
the students use the flowchart programs to control it. The robot is constructed in two parts. Four students
work together to form the mobile section and one to four students act as
the computational unit to interpret
the groups’ flowchart.
Ask four volunteers to come to the
front of the classroom to help assemble a robot. Arrange the volunteers
into the Organic Robot configuration
shown in Figure 4. Place one student
(front student) facing the class. It
helps to make this front person the
tallest student in the group. Instruct
the second student to stand behind
the first and place both hands on the
first student’s waist. The second student’s arms must remain straight.
The third student (right student)
stands on the right side of the robot,
facing the class. The left arm of the
right student goes over the extended
right arm of the back student. The
right student gently locks his left arm
www.circuitcellar.com
W
W
W
.G
O
.R
i2
LE
.H
iU
R
U
M
around the extended arm and stands
as close as possible to the center of
the robot. The fourth student (left
student) stands on the left side of the
robot and locks on to the left arm of
the back student.
Now, it’s time to explain the function of each volunteer. The students
represent the power source, wheels,
and corresponding bumper.
The front student’s head is covered
with a paper bag so he can look only
straight down to read the range sensor
and determine which direction is
brighter. The front student also acts
E
Photo 2—There were several versions of the TAR Rat,
including the one on the bottom right, which solves
mazes.
as the local controller and directs the
robot as it executes each high-level
command sent from the computational unit.
The right, left, and rear students
wear blindfolds. Either the right or
left student can operate the communications device. Have the class voice
commands to the robot to demonstrate how it operates.
After demonstrating the volunteer
robot, have each younger group divide Photo 3—The Organic Robot simulator has its cover on
in this shot.
into two parts. The robot parts are
made up of four students and the
place a bright light in the doorway.
remaining students represent the
Locate the computational units and
computational units. Pair the older
their programs in the hall where they
students into groups of four; one
can’t see into the classroom. Then,
group will be the robot and the other
move the robots (children in formagroup will be the computational unit.
tion) around in the room so the robots
After completing the first simulation,
don’t know how they are oriented,
the groups swap jobs.
and move some of the classroom furniture around.
SET UP THE SIMULATION
If you have two-way, hand-held
Now that the robots are assembled
radios, place one in the hall with the
in the classroom, it’s time to set up
computational units and one with the
the simulation. Draw the classroom
robots. If you don’t have radios, just
on the blackboard to plot how the
stand in the doorway and pass the
robots move around the room, and
commands and replies.
What do the leading silicon
vendors know about BIOS?
T
hey know the right
BIOS is key to the
success of embedded
designs—and configurability
is key to the right BIOS.
That’s why AMD, Intel,
and STMicro ship General
Software’s Embedded BIOS
pre-installed on their
embedded platform evaluation boards.
With over 400 configuration options, Embedded
BIOS offers the advanced
configurability you need to
run your custom target
environment without editing
the core BIOS source code.
Contact us today for
detailed information and a
free sample BIOS binary for
your standard
reference
design.
Embedded BIOS™
ADAPTATION KIT:
Full source code automatically
configured with over 400 parameters using BIOStart™ expert
system
CORE BIOS FEATURES:
ROM/RAM/Flash disks, Setup
system, console re-direction,
manufacturing mode, WinCE
loader, configurable PCI, integrated debugger, modular callouts
to chipset, board, and CPU-level
modules
CHIPSETS:
ALI—Aladdin V, Finali
AMD—186, SC300, SC400, SC520
INTEL—386EX, 430HX/TX,
440BX, 810, 840
NSC—Geode GXm, GXlv
ServerWorks—ServerSet III HE/LE
STMicroelectronics—STPC family
IDEAL FOR:
Windows 95/98/CE/NT
Embedded, Linux, DOS, and all
x86-based operating systems
www.gensw.com •sales@gensw.com • 800-850-5755 • 425-454-5755
© 2000 General Software, Inc. All rights reserved.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
23
from raw materials by making their
own copy of the ORS. After the robots
are complete, the students are divided
into teams and spend the rest of the
time designing an international fire
fighting robot. The fire fighting robots
compete with each other at the end of
the class. Hopefully I’ll have a construction article for the ORS for next
year’s robotics issue. I
R
U
M
E
O
.R
LE
.H
Each computational unit takes
turns sending one command and waiting for a reply from its robot. To start,
the first computational unit sends the
first command of its program to its
robot. The robot then executes the
command and responds with “ready”
if it completed the command successfully, the value of the sensor variable
requested, or “interrupt” if a bumper
stopped the robot’s motion. Plot the
path of the robot on the blackboard,
then prompt the second computational unit to send a command.
Continue until one of the robots
makes it to the door or both robots
become trapped. Review the paths the
robots took and discuss what changes
would improve the operation of the
robots and programs.
Ken Boone is an information systems
specialist with the telecommunications group at Lord Corp. Since 1963,
Ken has been building amateur
robots; his fire-fighting robots placed
8th and 13th, respectively, in the last
two Trinity College contests. He has
been teaching robotics to gifted students for 20 years. Information about
his robots can be found at www.kensrobots.com. He earned a B.S. in
Industrial Arts Education at North
Carolina State University. He holds a
control theory patent. He may be
reached at kensrobots@aol.com.
i2
Photo 4—Check out the internals of the Organic
Robot Simulator.
W
W
W
.G
iU
LESSONS LEARNED
The Organic Robot presentation
gives students a chance to experience
the limitations of today’s robots. They
see how robots sense their surroundings and how programs control robots.
Most importantly, the students have a
great time. If you have any suggestions to improve the Organic Robot
presentation or some good stories,
please e-mail them to me.
After all of the Organic Robots have
completed their runs, I transfer the
most successful flowchart program to
my Organic Robot Simulator (ORS).
This electronic version (see Photos 3
and 4) has the same high-level commands as the Organic Robot. I
designed the ORS for a robotics class I
developed and teach to gifted high
school students.
The class runs seven hours a day for
18 days. During the first week, the
students learn how to build robots
CIRCUIT CELLAR®
REFERENCES
[1] M. Rigsby, “Raccoon Buster,”
Robotics Age, October 1985.
[2] I. Asimov, I, Robot, Gnome
Press, New York, NY, 1950;
Bantam Books, New York, NY,
July 1994.
SOURCES
Robots
Cog
Massachusetts Institute of
Technology Artificial Intelligence
Laboratory
(617) 253-3699
www.ai.mit.edu/projects/huma
noid-robotics-group
AIBO
Sony Electronics Inc.
(800) 222-7669
(941) 768-7669
Fax: (941) 768-7790
www.jp.aibo.comC
RESOURCE
Trinity College Fire Fighting
Home Robot Contest,
Trinity College
www.trincoll.edu/events/robot.
www.circuitcellar.com
All great endeavors
begin
with a
19”CDRW
itor &
Mon
Expert
Add
$1579
$1599
$1679
$1699
Microsoft Office
Professional
for only
$299
800EB PIII ITEM #3058
866EB PIII ITEM #3059
933EB PIII ITEM #3060
1GHz PIII ITEM #3066
$1259
$1279
$1349
$1399
• Authentic Intel Pentium III Processor
• 256MB 133MHz SDRAM
• 40GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• 50X CD-ROM
• 1 Parallel, 2 Serial, 2 USB ports
• 17" .27 1280x1024 Monitor
• ATI Xpert 2000 32MB AGP Video Adapter
• ATX Professional Tower Chassis
• Yamaha Sound System & 120WATT Speakers
• Windows 2000, Logitech PS/2 Mouse & Keyboard
• Netgear 10/100 PCI Ethernet Card
$1049
O
$1259
$1579
2000
WITH WINDOWS 2000 PROFESSIONAL, THIS
EXPERT CONFIGURATION DELIVERS STATE OF
THE ART POWER TO ANY DESKTOP. COMPLETE
WITH 17” MONITOR, 40GB HD & 256MB RAM.
with
000
NEoW
ws 2 or
Wind” Monit
& 17
• Authentic Intel Pentium III Processor
• 256MB 133MHz SDRAM
• 30GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• Hewlett Packard 32x CDRW
• 1 Parallel, 2 Serial, 2 USB ports
• 19"KDS .26 V195 Monitor
• ATI Xpert 2000 32MB AGP Video Adapter
• ATX Professional Tower Chassis
• Yamaha Sound System & 120WATT Speakers
• Windows ME, Logitech PS/2 Mouse & Keyboard
• Netgear 10/100 PCI Ethernet Card
• Authentic Intel Pentium III Processor
• 256MB 133MHz SDRAM
• 40GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• DVD CD-ROM
• Hewlett Packard 32x CDRW
• 1 Parallel, 2 Serial, 2 USB ports
• 19"KDS .26 V195 Monitor
• ASUS GeForce II 32MB DDR Video Adapter
• ATX Professional Tower Chassis
• SoundBlaster Live value & 520 WATT Speakers
• Windows ME, Microsoft Intellimouse & Keyboard
• 56K v.90 Lucent PCI Modem w/Fax & Voicemail
800EB PIII ITEM #3079
866EB PIII ITEM #3080
933EB PIII ITEM #3081
1GHz PIII ITEM #3082
Dream Creator
NETWORK-READY WITH WINDOWS ME &
NETWORK ADAPTER. 19” MONITOR, CDRW,
30GB HD, & 256MB RAM MAKE THIS EVERY
PROFESSIONAL’S DREAM COME TRUE!
.R
19” MONITOR, DVD CD-ROM, 40GB HD, 32MB
GEFORCE II, SOUNDBLASTER LIVE & 520 WATT
SPEAKERS WITH SUBWOOFER MAKE THIS THE
ULTIMATE ENTERTAINMENT SYSTEM!
i2
Dream MediaPro
LE
.H
19” DVD
itor &
Mon
Dream
800EB PIII ITEM #3126
866EB PIII ITEM #3127
933EB PIII ITEM #3128
1GHz PIII ITEM #3129
$1049
$1069
$1149
$1199
3YR WARRANTY on select products
-Buy
st tion
Berk
sta
Wo monitor
”
w/17
Dream VXi98
Dream XSRW
CREATE AUDIO & DATA CDs WITH EASE!
CREATIVE LABS CDRW & 30GB HD DELIVERS
HIGH PERFORMANCE ON A BUDGET.
E
THIS POPULAR CONFIGURATION IS PROVEN
RELIABLE & VERSATILE! NOW WITH 20GB HD,
32MB SVGA, 17” MONITOR & MORE !
• Authentic Intel Pentium III Processor
• 128MB 133MHz SDRAM
• 30GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• Creative Labs CD-RW
• ATX Professional Tower Chassis
• 1 Parallel, 2 Serial, 2 USB ports
• ATI Xpert 2000 32MB AGP Video Adapter
• Yamaha Sound System & 120 WATT Spkrs
• Windows '98, Logitech PS/2 Mouse & Keyboard
• 56K v.90 Lucent PCI Modem w/Fax & Voicemail
U
M
• Authentic Intel Pentium III Processor
• 128MB 133MHz SDRAM
• 20GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• 50X CD-ROM
• ATX Professional Tower Chassis
• 1 Parallel, 2 Serial, 2 USB ports
• 17" .27 1280x1024 Monitor
• ATI Xpert 2000 32MB AGP Video Adapter
• Yamaha Sound System & 120 WATT Spkrs
• Windows '98, Logitech PS/2 Mouse & Keyboard
• 56K v.90 Lucent PCI Modem w/Fax & Voicemail
iU
$ 899
$ 929
$ 999
$1049
.G
800EB PIII ITEM #2967
866EB PIII ITEM #2968
933EB PIII ITEM #3010
1GHz PIII ITEM #3067
W
DesignerDreams
800EB PIII ITEM #3108
866EB PIII ITEM #3109
933EB PIII ITEM #3110
1GHz PIII ITEM #3111
733EB PIII ITEM #2880
800EB PIII ITEM #2941
866EB PIII ITEM #2942
933EB PIII ITEM #3044
1GHz PIII ITEM #3072
$339
$379
$399
$479
$519
$839
$859
$919
$969
S ta rt
at
in g
$249
Call for a quote
on your
Dream Computer
• Intel Celeron Processor
• Configurable Flash BIOS & APM
• 128K Cache
• Supports RAM up to 512MB
• 1.44MB 3.5" Floppy Disk Drive
• UDMA 4HD & 2FD controller
• 3 32-bit PCI slots
• 2 Serial, 1 Parallel, 2 USB & PS/2 port
• Professional ATX Tower Case
• 250 WATT ATX Power Supply
• 104-Key PS/2 keyboard
• Integrated Audio & Video
600MHz PIICi ITEM #3020
667MHz PIICi ITEM #3021
700MHz PIICi ITEM #3071
733MHz PIICi ITEM #3124
766MHz PIICi ITEM #3125
Dream Advantage
r
RELIABLE, POWERFUL WORKSTATION AT
AN UNBELIEVABLY LOW PRICE. WITH 20GB
HD & 17” MONITOR.
• Authentic Intel Celeron® Processor
• 64MB SDRAM
• 20GB UDMA Hard Drive
• 3.5" 1.44MB Floppy Drive
• 50X CD-ROM
• 1 Parallel, 2 Serial, USB & PS/2 Port
• 17" Monitor & Integrated Graphics
• Sound System & 120 WATT Speakers
• Windows '98, Logitech PS/2 Mouse & Keyboard
• 56K v.90 Lucent PCI Modem w/Fax & Voicemail
• ATX Professional Tower Chassis
$679
Add an HP DeskJet 840C
color printer
for only $149
WITH CASE, POWER SUPPLY, MAIN BOARD, CPU, FLOPPY DRIVE &
KEYBOARD. A SOLID FOUNDATION FOR YOUR DREAM COMPUTER.
W
W
• Intel Pentium III Processor
• Configurable Flash BIOS & APM
• 256K L2 Cache
• Supports RAM up to 1GB
• 1.44MB 3.5" Floppy Disk Drive
• UDMA 100 4HD & 2FD controller
• 5 32-bit PCI, 1 ISA, & 1 4X AGP slot
• 2 Serial, 1 Parallel, 2 USB & PS/2 port
• Professional ATX Tower Case
• 250 WATT ATX Power Supply
• 104-Key PS/2 keyboard
• Integrated Audio
$839
R
$899
ito
mon
1 7 " 0GB H D
&2
667MHz PIICi ITEM #3097
700MHz PIICi ITEM #3098
733MHz PIICi ITEM #3099
766MHz PIICi ITEM #3130
PowerDesigner
DESIGNER DREAM WITH 128MB RAM,
20GB HARD DRIVE, & 16MB VGA.
A POWERFUL SYSTEM WITHOUT
UNNECESSARY EXTRAS. PERFECT FOR
TODAYS DEMANDING APPLICATIONS.
• Authentic Intel PIII Processor
• 128MB 133MHz SDRAM
• 20GB UDMA Hard Drive
Add WIndows ‘98,
• 3.5" 1.44MB Floppy Drive
mouse, speakers,
• 50X CD-ROM
& modem for
$149.
• ATX Professional Tower Chassis
• 1 Parallel, 2 Serial, 2 USB ports
• 16MB AGP Video Adapter
• Yamaha Sound System
$249
$259
$269
$289
$339
733EB PIII ITEM #2823
800EB PIII ITEM #2937
866EB PIII ITEM #2938
933EB PIII ITEM #3038
1GHz PIII ITEM #3131
40950 Encyclopedia Circle
Fremont, California 94538
© March 2001
DreamTech
To order,
call toll free:
OR FAX (510) 353-0990
1-800-A DREAMER
1-800-237-3263
SINCE 1983
www.dreamtech.com
$579
$609
$629
$719
$759
(510) 353-1800
Experience your Dream Computer
(
$679
$689
$719
$759
e-mail sales@dreamtech.com
M-F 10AM to 6PM PST
FEATURE
ARTICLE
closed-loop control. The motor controller accepts commands from a
main control processor and moves the
wheels at a specified velocity and
acceleration (ramp rate).
MOTORS AND ENCODERS
R
U
M
E
he annual Fire
Fighting Home
Robot Contest held at
Trinity College has long
fascinated me. After years of thinking
about building a robot to compete, I
finally decided to enter in 2001. The
main impetus for this is the decision
of the Central Illinois Robotics Club,
of which I am a member, to sponsor a
regional qualifying competition in
March 2001.
For me, the most difficult part of
creating a robot is the mechanical
design, so I tackle that aspect first.
After I have a working platform,
adding the electronics and software is
the fun part. I built a round base for
my fire-fighting robot, Chipper, with
two motors centrally mounted for differential steering. The motors are surplus 24-VDC Globe gearhead motors
with integral single-channel optical
encoders.
Although I don’t plan to use dead
reckoning to travel through the hallways of the simulated house used in
the contest, I would like to take
advantage of the encoders to allow
some dead reckoning while navigating
within the rooms. In this article, I
will describe a motor control subsystem that places the motors in a
W
W
W
.G
iU
Putting together a
fire-fighting robot
requires a fine blend
of knowledge on a
variety of topics ranging from motor control
to navigation software
to sensor capabilities.
All that and longstanding interest in
building such a robot
went into Mike’s firefighting robot, Chipper.
t
LE
.H
i2
How to Build a Mobile Robot Base
O
Fighting Fire with Robots
The critical characteristics of the
gear motors are given in Table 1.
Motor torque and speed should be
adequate for the task. I plan to use 3²
diameter wheels, resulting in a total
force of 6.7 lbs and speed of 9.9²/s at
nominal load. Three-inch wheels have
a 1.5² radius, so the force per motor is
3.33 lbs. Double that for two motors.
The encoders output 120 pulses per
revolution (ppr) of the output shaft,
which results in a pulse frequency of
170 Hz at the rated speed of 85 rpm.
With only one channel, it’s impossible to determine the direction of rotation from the encoder inputs alone.
Based on knowledge of the application, I was able to make assumptions
that allowed me to deduce the direction from other information, as I’ll
explain later.
The resolution of 120 ppr amounts
to about 0.08² per pulse with 3² diameter wheels. This might not be good
enough to navigate the entire course
using dead reckoning, but it’s adequate to travel in a straight line for 3¢
or make a 90° turn into a room.
.R
Mike Dvorsky
26
Issue 128
March 2001
CIRCUIT CELLAR®
PROJECT GOALS
Motor control is just one of many
subsystems in Chipper. One of my
goals is to fit all of the code into a
single-chip microprocessor with 8 KB
of program storage. Note that I allotted 20% of the code space, or 1.6 KB,
for motor control.
Although the processor I chose has
an orderly architecture that makes it
straightforward to program in assembly language, it’s still faster and easier
to program in a high-level language
like C. I usually use assembly only for
speed-critical sections or in other
areas where C is not capable. For this
project, my goal is to have a maximum of 20% assembly code, with the
rest in C.
I decided the motor control must be
modular and able to accept motion
commands specifying both the velociwww.circuitcellar.com
The AVR instruction set
power-up reset for the microprocessor,
was designed from the
and more importantly, holds the
ground up to support C comprocessor in reset whenever the power
pilers. The same features that
supply is below specification.
help the compiler generate
Remember, the ’8515 lacks internal
good code also help an
brownout protection.
assembly language programThe motor power is controlled by
mer
write
good,
maintainable
U2,
an Allegro UDN2998W dual HEncoder resolution
code. Among those features
bridge. With a continuous current ratEncoder voltage
are a large register set and
ing of 2 A (3 A peak), it’s more than
linear address space.
capable of supplying the 500 mA the
For
motor
control,
hardmotors draw at rated load. This chip
Table 1—Even without the optical encoder, the Globe 415A374
gear motor would be well-suited for powering small robotics platware support of PWM outis easy to use, needing only the batforms because of its high torque, medium speed, and low current
puts is important. Because
tery supply, return, PWM, and direcconsumption.
there are two motors to contion inputs for each motor. The logic
trol, at least two PWM chaninputs are TTL-compatible. The ’2998
nels are needed. This led to the choice
contains internal diodes to absorb the
ty and ramp rate for each wheel.
of the AT90S8515 (see Figure 1). It has
inductive kick of the motor when it is
Given these values, the module must
plenty of I/O, including the needed
switched off. But, an RC snubber was
compute the desired position of each
PWM output channels. Peripherals
added at the output to soften the
wheel at any instant. And it also
include two serial interfaces (synchroedges and reduce radiated noise.
must execute a closed-loop control to
nous and asynchronous), three timers,
maintain both the desired position
and an analog comparator.
SOFTWARE OVERVIEW
and velocity.
The ’8515, a 40-pin device, has 34
Before getting into the software
The closed-loop control will be a
pins available for I/O. The two exterdesign, I want to mention the develstandard PID control, which requires
nal interrupt pins are used for the left
opment tools. Users of the AVR
three gain values, KP, KI, and KD.
and right wheel encoder inputs.
processors are fortunate to have AVR
These values should be stored in EEPAlthough Chipper’s motors have only
Studio and a C compiler available for
ROM so they can be changed without
single-channel encoders, two addifree. AVR Studio allows you to debug
modifying the code.
tional pins are allocated as the right
software at the source level, viewing
Along with the velocity and ramp
and left encoder channel B so that
code, memory, registers, and I/O. It’s
rate, a command should have a set
quadrature encoders can be supported
useful for checking the software
duration, and it should be possible to
in the future. Table 3 shows the pin
before moving to the target hardware.
queue the motion commands so that
assignments for motor control.
The real gem, however, is the GCC
when one command is completed, the
Chipper’s power supply is provided
compiler for AVR. Because the GNU
next can begin immediately. For
by three 9.6-V, 600-mAH, NiCd battools are normally supplied in source
example, the commands in Table 2
tery packs connected in series, for a
format and must be compiled, they
will cause the robot to accelerate at a
total of 28.8 V. U1, a PT5101A intecan be daunting. Fortunately, a comrate of 10²/s2 to a final velocity of
grated switching regulator made by
piled Windows port can be down5²/s, maintain that velocity for 10 s,
Power Trends, steps the battery voltloaded. The compiler, assembler, and
decelerate at a rate of 10²/s2, then
age down to 5.0 V for the electronics
linker are reliable and produce highfinally stop.
(see Figure 2). A linear regulator such
quality code.
The total distance traveled will be
as the common 7805 would have
Finally, the download software I use
52.5². These commands should be
wasted too much power.
to transfer a program to the microqueued so there is no discontinuity in
Another device worth mentioning
processor is AVR ISP. Although this
movement between commands.
is U4, a Microchip MCP130 reset conprogram is rough around the edges,
troller. This device provides the
it’s functional.
HARDWARE DESIGN
All of my recent microcontroller projects have
been based on the Atmel
Command number
Right wheel command
Left wheel command
Command duration
AVR family of controllers.
1
Initial velocity = 0²/s
Initial velocity = 0²/s
0.5 s
The two things that origiRamp rate = 10²/s2
Ramp rate = 10²/s2
nally drew me to the AVRs
2
Initial velocity = 5²/s
Initial velocity = 5²/s
10 s
were the well-designed
Ramp rate = 0²/s2
Ramp rate = 0²/s2
processor architecture and
3
Initial velocity = 5²/s
Initial velocity = 5²/s
0.5 s
Ramp rate = –10²/s2
Ramp rate = –10²/s2
the fact that all members
of the family are flash
Table 2—These commands make Chipper ramp to a velocity of 5²/s, travel 50² in 10 s, and ramp to a stop.
memory-based.
24 VDC
85 rpm
150 mA
80 oz-in.
63 rpm
500 mA
Single channel optical,
open collector output
120 pulses per output
shaft revolution
5 to 24 VDC
W
W
W
.G
iU
R
U
M
E
LE
.H
i2
.R
O
Nominal voltage
No load speed
No load current
Torque at nominal load
Speed at nominal load
Current at nominal load
Encoder type
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
27
PA0-PA7
PC0-PC7
Port A drivers
Port C drivers
When using the motor control routines in Chipper, you
have to convert between scaled
integer values and ordinary real
numbers. To convert from a
real number to a scaled integer,
multiply by 2N and round to the
nearest integer. To convert
back, divide by 2N.
VCC
Data register
Port A
GND
Data direction
register Port A
Data register
Port C
Data direction
register Port C
XTAL1
8-bit data bus
Internal
oscillator
Oscillator
MAIN CONTROL LOOP
XTAL2
Timer0 (8-bit counter) is
clocked by the 7.3728-MHz
clock that’s pre-scaled by 1024,
MCU control
Program
SRAM
ALE
register
flash memory
which results in an increment
every 139 µs. The counter overTimer
Instruction
General–
counters
register
flows and generates an interpurpose
registers
rupt every 35.6 ms. And, the
X
Interrupt
Instruction
Y
ICP
interrupt service routine increunit
X
decoder
ments global variable
Control
EEPROM
tmr0_ovf_ctr, which is used as
ALU
lines
a time base for the tasking sysStatus
tem. In addition, the combinaregister
tion of Timer0 and the overflow
Programming
UART
SPI
count is used as a 16-bit numlogic
ber to measure the period of the
encoder pulses, which deterData direction
Data register
Data register
Data direction
mines the velocity of each
register Port D
Port D
Port B
register Port B
+
wheel.
Chipper uses a simple cooperPort D drivers
Port B drivers
ative tasking system. Listing 1
shows the main control loop.
The periodic section is run
PB0-PB7
PD0-PD7
every 71.1 ms, corresponding to
Figure 1—The ’8515 has 8 KB of flash memory, 512 bytes of RAM, and 512 bytes of EEPROM. Pin PD5 is the right motor
every second Timer0 overflow
PWM output. The left motor PWM output is the OC1B (not shown).
interrupt. Most of the tasks are
periodic because they either
need a time base or are coupled to
Figure 3 shows the data flow for
The data dictionary, which docutasks that need a time base.
Chipper’s motor control. You can see
ments the data in the data stores (see
A period of 71.1 ms for executing
the different processes that interact to
Table 4), is an essential companion to
the PID loop may seem slow, but
process motor control commands.
Figure 3. The data type names begin
with the low-resolution encoders used
Circles represent individual processes,
with “int” or “uint” for signed or
in Chipper, 12 encoder pulses maxieach of which performs a specific
unsigned integers, followed by the
mum will be received during a loop.
task. The symbols consisting of two
number of bits—8, 16, or 32. Each
In the future, as I gain more experiparallel lines with text between them
ends with “_t”. For example, uint16_t
ence with the robot, I may reduce the
are data stores, which represent global
is an unsigned, 16-bit integer.
loop time.
data shared between the processes.
The scale column needs more
Motion control is performed in the
And, the curved lines connecting
explanation. Chipper uses fixed-point
periodic section. Functions that are
processes and data stores are the data
integer arithmetic for all calculations.
specific to a given wheel are called
flow lines, representing the variables
Each entry in the data dictionary has
twice, once per wheel, and they take a
used by each process.
a scale factor appropriate for the item,
pointer to the wheel data structure as
When looking at Figure 3, don’t
represented in the form “M.N.” M is
an argument. In this way, the left and
interpret the lines as control flow or
the number of bits to the left of the
right wheels can be processed using
function calls. Instead, picture all of
binary point in the number, and N is
the same code, saving several hundred
the processes executing simultaneousthe number of bits to the right. The
bytes of code space.
ly. The data flow lines indicate the
largest unsigned number that can be
When the main loop isn’t running
patterns of data exchanged between
represented is approximately 2M and
periodic tasks, it executes the backthe processes.
the smallest is 2–N.
Stack
pointer
Watchdog
timer
Timing and
control
*Reset
E
W
W
W
.G
iU
R
U
M
Analog
comparator
–
LE
.H
i2
.R
O
Program
counter
28
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
O
.R
i2
LE
.H
E
iU
Motor commands and status are
passed through global variables. Every
single wheel has command variables
for initial velocity and ramp rate (see
Table 4). The variables to start the
command and set the duration apply
to both wheels simultaneously.
Now, here’s the tricky part. Motion
commands are expressed in terms of
encoder pulses and loop times.
Furthermore, there are scale factors
that must be taken into account. The
equations in Figure 4 give the necessary conversions. Although velocity,
ramp rate, and wheel diameter are
specified in inches, the equations
work for any unit of length, as long as
they are consistent.
Let’s work through the example
from Table 2. First, command 1 has T
= 0.5 s, V = 0.0²/s, and R = 10.0²/s2.
Plugging these into the equations
results in N = 7.03 (rounded to 7), VC
= 0, and RC = 659.3 (rounded to 659).
Similarly, command 2 results in N =
141, VC = 4636, and RC = 0, and command 3 results in N = 7, VC = 4636,
and RC = –659.
In order to cause the motion control
system to execute the command, the
main routine must store the computed values of VC and RC in the
right_wheel_data and left_wheel_data
structures, store the computed value
of N in num_loops_command, and
then set the desired motion_command
value. The possible motion commands are MOT_CMD_NO_CMD = 0,
MOT_CMD_PROCESSING_CMD = 1,
U
M
MOTION COMMAND
PROCESSING TASK
MOT_CMD_GO_NOW = 2, and
MOT_CMD_QUEUE = 3. (These are defined
in header file motion_cmd.h.)
When the motion command processing task executes, it looks at the
value of global variable motion_command. If this variable is MOT_CMD_
GO_NOW, then the task moves the commanded velocity, ramp rate, and number of loops to working variables,
causing the command to take effect
immediately. If motion_command is
MOT_CMD_QUEUE, then the task does the
same thing, but only after the currently executing command (if it’s executing at the moment) completes.
When a command is accepted for
processing, the value of motion_command is set equal to MOT_CMD_PROCESSING_CMD, and when all commands
have completed, it is set equal to
MOT_CMD_NO_CMD. If motion_command is
equal to either of these values, the
motion command system is ready to
receive another queued command.
Listing 2 implements the example
in Table 2. It is a state sequencer,
intended to run periodically. In each
state, it waits for the previous motion
command to be accepted (as indicated
by the value of motion_command), then
queues the next motion command. A
quick check for readiness to queue a
new command is:
R
ground tasks while looping on
tmr0_ovf_ctr. The only background
task in Chipper is the EEPROM management task.
.G
motion_command <= MOT_CMD_PROCESSING_CMD
W
W
W
This takes advantage of the specific
values used for the motion commands, which is not a good programming practice. In a future version of
the system, I plan to add a macro to
perform this test.
The sharp-eyed among you might
have noticed that a ramp rate of 659
for seven loops
Pin number
Pin name
Function
comes to a final
velocity of 4613
1
PB0
Right wheel DIR
rather than the
2
PB1
Left wheel DIR
4636. This is
12
PD2/INT0
Right wheel encoder channel A
13
PD3/INT1
Left wheel encoder channel A
because seven
15
PD5/OC1A
Right wheel PWM
loops isn’t exactly
27
PC6
Left wheel encoder channel B
0.5 s. This won’t
28
PC7
Right wheel encoder channel B
cause a problem
29
OC1B
Left wheel PWM
when ramping up,
Table 3—Only eight of the 34 I/O pins are used for motor control. Chipper doesn’t
but when ramping
use the encoder channel B pins, which are available for future use with a quadradown
to 0, it may
ture encoder.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
29
W
W
W
.G
iU
R
U
M
E
O
LE
.H
The EEPROM task
maintains a mirror of a
region of RAM in EEPROM. Any element of
the eeprom_vars structure (see Table 4) is mirrored in EEPROM.
During initialization, the
eeprom_vars structure is
Figure 2—Chipper’s CPU and motor control are shown here.
initialized to the value in
EEPROM. After initialization, the
Listing 3. That’s all there is to it!
EEPROM task operates as a backGlobal variable num_loops_remaining
ground task, checking for any eepis used as a flag indicating whether or
rom_vars element that has changed
not a command is being processed.
and writing changed values to EEPThe desired_position element is a
ROM.
32-bit signed quantity with a scaling
Because the EEPROM tolerates only
of 210 = 1024. This gives it a resolua finite number of writes, only infretion of 1/1024 pulses (2 microns with
quently changing values (such as the
Chipper’s 3² wheels) and a range of 221
PID gains) can be mirrored this way.
pulses (more than 2.5 miles). That’s
Also, this method requires one byte of
adequate for my purposes. Even if
RAM for each byte of EEPROM. If it
Chipper travels farther than 2.5 miles,
were necessary to store a large
there shouldn’t be a problem, because
amount of data in EEPROM, this
the rollover is handled correctly in
technique wouldn’t work because of
the PID algorithm described later.
the amount of RAM it would require.
EEPROM in the AVR processors
WHEEL TASK
isn’t part of the normal data memory
The wheel task is more complex
map, but is accessed through I/O regthan the trajectory task. It determines
isters. The gccavr library includes
the position and velocity of both
routines to read and write EEPROM,
wheels at any instant by counting
hiding the details and making this
encoder interrupts and measuring the
task simple. The EEPROM task is not
period between them. One of the
specific to the motion control subsysmore challenging functions it pertem. Any variable defined in the eepforms is determining the direction of
rom_vars structure will be mirrored
wheel rotation.
in the same way, so this facility can
Let’s look at direction first. If you
be used elsewhere in the system.
knew nothing about the environment
the robot would operate in, you
TRAJECTORY TASK
couldn’t determine the wheel direcThe trajectory task computes the
tion without additional sensory input.
desired velocity and position of each
The key piece of information for the
wheel by updating the desired_velocifire-fighting robot is that it will never
ty and desired_position elements of
be pushed (i.e., it won’t have to hold
the wheel data structures. This task is
its position against an external force).
called periodically, once for each
If the robot is moving, it is because its
wheel, and is passed to the wheel data
motors are (or were) turning.
structure. Every loop time, the trajecThere are a few cases to consider. In
tory task performs the logic stated in
case 1, the robot starts moving from a
.R
EEPROM TASK
stationary position.
When the velocity
increases, you
deduce that the
direction of rotation
is the same as the
desired velocity.
In case 2, the
robot is cruising in
a particular direction. Without an
external force, it
will continue moving in the direction
the motors are
pushing.
In case 3, the
robot accelerates or
decelerates but does
not change direction. Like in case 2, it
continues moving in the direction the
motors are pushing.
Finally, in case 4, the robot decelerates to change direction. The magnitude of the velocity decreases first,
and then increases as the wheels start
turning in the opposite direction.
During the period of decreasing velocity, you deduce that the wheels are
turning in the same direction as they
were previously, even though the
motors may be pushing in the opposite direction. When the velocity
increases, you know that the wheels
have changed direction and are turning in the same direction the motors
are pushing.
From these four cases, a simple rule
can be extracted. If the velocity
increases from one loop to the next,
the direction of rotation is the same
as the direction of the desired velocity. Otherwise the direction of rotation
is unchanging. This is used to determine wheel direction in Chipper.
The next question is how to determine the magnitude of the velocity. If
the encoder pulses were arriving more
frequently, you could count pulses
between task loops. With a maximum
of 12 pulses per loop, however, this
method gives unacceptable resolution.
So instead, Chipper measures the
pulse period.
The falling edge of each encoder
pulse causes one interrupt per wheel.
The ISR does two things. It increments a count of encoder pulses
i2
cause a residual velocity.
The solution is either to
issue a final command
with a velocity of 0 or
start the ramp down with
a velocity of 4613. I used
the latter approach.
30
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
W
W
W
.G
iU
U
M
R
E
LE
.H
Zilog
i2
.R
O
right_wheel_data (structure)
desired_velocity_cmd
int16_t
ramp_rate_command
int16_t
desired_velocity
int16_t
ramp_rate
int16_t
desired_position
int32_t
encoder_count
uint8_t
latest_T0
uint16_t
old_T0
uint16_t
wheel_position
int16_t
prev_velocity_magnitude uint16_t
wheel_velocity
int16_t
integral_term
int16_t
motor_command
int8_t
eeprom_vars (structure)
KP
int16_t
KI
int16_t
KD
int16_t
tmr0_ovf_ctr
uint8_t
num_loops_command
uint16_t
motion_command
uint8_t
Scale
Description
6.10
6.10
6.10
6.10
22.10
8.0
16.0
16.0
16.0
6.10
6.10
8.8
8.0
Command received over data link
Command received over data link
Used to compute trajectory
Used to compute trajectory
Current desired position along trajectory
Count of encoder pulses received
Timer0 count at latest encoder pulse
Timer0 count at previous encoder pulse
Current wheel position, determined by wheel task
Magnitude of velocity in the previous loop
Current wheel velocity, determined by wheel task
Saved integral term, used in PID task for anti-windup
Desired duty cycle output of PID, –127 to 127
8.8
1.15
8.8
8.0
16.0
8.0
Proportional gain for PID
Integral gain for PID
Derivative gain for PID
Counter of Timer0 overflow interrupts
Number of loops motion command is in effect
Motion command (NO_CMD, PROCESSING_CMD,
GO_NOW, or QUEUE)
Number of loops remaining in motion command
It will be compared with
the desired velocity in
the PID algorithm, so it
must have the same
units and scaling.
The units of desired
velocity are pulses per
loop, and the scaling is
210 = 1024. There are 512
Timer0 ticks per main
loop, so the scaled
velocity is:
O
Type
.R
Name
U
M
E
LE
.H
i2
What if the wheel is
stopped? Or worse yet,
what if the period is 0,
resulting in a division
error? These cases are
num_loops_remaining
uint16_t 16.0
handled specially. Each
time the wheel task is
Table 4—The data dictionary states the global variables in Chipper. Indented items are structure elements. Type definitions are found
run, it compares the curin app_globals.h. left_wheel_data has the same elements as right_wheel_data.
rent Timer0 value to the
stored
value
for
the last edge. If it has
received and it stores the Timer0
culated by subtracting these values.
been more than 1 s since the last
count (including the overflow count
When the period is known, it’s simpulse or if the computed period is 0,
in tmr0_ovf_ctr). In fact, the ISR
ple to calculate the velocity from the
then the period is forced to the largest
maintains the Timer0 count for the
period. Well, maybe not simple. What
possible value (65535). This results in
previous two edges. The period is calis the purpose of the wheel velocity?
W
W
W
.G
iU
R
More powerful than a...
MotorMind B
DC Motor Control Module
Adjust Speed and/or Direction
Easy Serial Interface
Solutions 3
Tachometer/Counter Input
Solutions Cubed (530) • 891-8045 phone • www.solutions-cubed.com
32
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
W
W
W
.G
iU
U
M
R
E
LE
.H
i2
.R
O
W
W
W
.G
iU
U
M
R
E
LE
.H
i2
.R
O
W
W
W
.G
iU
R
U
M
E
LE
.H
i2
.R
O
coded in assembly language for efficiency. The
R/L motor
arguments are two 16-bit
R/L
encoders
R/L encoder
encoder
signed integers and the
interrupts
R/L
ISR
binary point adjustment
wheel
R/L
task
that must be performed on
R/L encoder_count
trajectory
R/L latest_T0_count
task
Time0
the product. This adjustR/L old_T0_count
ISR
ment is the number of bit
R/L desired_velocity
R/L wheel_position
R/L desired _ramp_rate
positions to right shift the
R/L wheel _velocity
R/L PID
R/L desired_position
task
result, and is equal to BMP
tmr0_ovf_ctr
tmr0_ovf_ctr
R/L desired_velocity
+ BMC – BPR (these are the
R/L desired _position
binary point positions of
R/L
Velocity
Timer0
R/L encoder_count
R/L wheel
R/L Position
KP
count
R/L latest_T0_count
data
the multiplier, multipliKI
R/L old_T0_count
R/L motor_command
cand, and product).
KD
tmr0_ovf_ctr
The integral term is
R/L desired_velocity
R/L desired _ramp_rate
PID gains
EEPROM
computed after the proporMain loop
R/L motor_command
tional term. This term is
KP
KP
KI
based on the integral of
KI
KD
R/L velocity_command
KD
the error multiplied by an
R/L desired _ramp_rate
Motor task
integral gain, KI. One
R/L velocity_command
R/L desired _ramp_rate
EEPROM
problem with the integral
task
term is that if the motors
Motion
Motion
are slow to respond, the
command
command
data
task
integral of the error can
R/L PWM
R/L direction
num_loops_command
grow large, causing overmotion_command
num_loops_command num_loops_remaining
shoot and oscillation. This
Main control
motion_command
is called integral windup
process
num_loops_remaining
Motor
and techniques to prevent
driver
it are called “antiwindup.”
Some controls handle
Figure 3—Take a look at the data flow diagram of the motor control. For a larger system, the process bubbles would be further
decomposed into lower-level processes, but in this design there is only one level.
windup by resetting, or
zeroing, the integral when
far is the actual position from the
a velocity of nearly zero.
the error is greater than some threshdesired position, which is calculated
The final piece of the puzzle is
old. I chose a different approach for
as error = (desired_position >> 10) –
wheel position. The wheel position is
Chipper. The integral term is limited
wheel_position. The shift is a result
calculated simply by adding or subso that it can contribute no more than
of the scaling of the desired position,
tracting the encoder pulses since the
50% of the maximum motor comwhich is a 22.10 number
last loop to or from the wheel_posi(binary point at bit 10). Note
tion element of the wheel data structhat the error is not scaled.
ture. The addition or subtraction
Desired quantities:
V = desired velocity in inches/seconds
KP is an 8.8 number. To
operation is chosen based on the
R = desired ramp rate in inches/seconds2
compute the proportional
direction of wheel rotation.
T = desired number of seconds for command
Constant values:
term, multiply the error by
L = loop time in ms/loop (71.1111)
B = position of the binary point for velocity and ramp rate (10)
KP and adjust for scaling to
PID CONTROL TASK
D = wheel diameter in inches (3.0)
produce an output that isn’t
The PID control is a simple algoP = encoder pulses per revolution (120)
Motion command variables, computed from desired quantities and
scaled. Repeat a similar operarithm complicated by two things,
constant values:
N = number of loops for command
tion for the integral and derivscaling and integral windup. The
VC = velocity command in pulses/loop, properly scaled
ative terms.
inputs are the desired and actual posiRC = ramp rate command in pulses/loop2, properly scaled
Because this multiply and
tion and the desired and actual velociR×L ×P×2
N = 1000 × T V = V × L × P × 2
R = 1,000,000 × × D
L
1000 × × D
scale process is done several
ty. The output is a motor command
times, I wrote a special multiin the range of –127 to 127. A PID
Figure 4—These are equations for motion command variables.
plication routine that handles
control has three parts, proportional,
The inputs are velocity (V), ramp rate (R), and command duration
the multiplication and scalintegral, and derivative.
(T). The outputs are number of loops (N), velocity command (VC ),
ing, prevents overflow during
The proportional term is computed
and ramp rate command (RC ). Velocity, ramp rate, and wheel
calculation, and rounds the
by multiplying the error by gain facdiameter can be any consistent unit of length. Results should be
result. This routine I wrote,
tor KP. The error in this project refers
rounded to the nearest integer. The value for B is obtained from
called mul_16x16_scaled(), is
to the error in wheel position: How
the data dictionary’s scale column.
2
B
C
www.circuitcellar.com
CIRCUIT CELLAR®
B
C
Issue 128
March 2001
35
Listing 1—Chipper’s main loop is divided into two sections, periodic and background tasks. After initialization, the code enters an infinite loop executing periodic and background tasks.
simplify the software. In this mode,
the PWM frequency is:
#define TASK_TICKS 2
// Perform initialization of I/O and task data structures
eemgr_init ();
// Copy EEPROM to RAM variables
tmr0_init ();
// Initialize Timer0 for interrupts every 35.6 ms
motor_init ();
// Initialize PWM output channels
enc_isr_init (); // Initialize INT0/INT1 channels, encoder pulse counters
sei();
// Enable global interrupts
O
// Enter infinite loop, executing the tasks
while (TRUE)
{
int next_task_time;
i2
.R
/******** Periodic tasks start here ******/
// Process the right wheel.
trajectory_task ( &right_wheel_data );
wheel_task ( &right_wheel_data );
pid_task ( &right_wheel_data );
LE
.H
// Process the left wheel.
trajectory_task ( &left_wheel_data );
wheel_task ( &left_wheel_data );
pid_task ( &left_wheel_data );
// Process motion commands.
motion_cmd_task ();
.G
iU
R
U
M
/******
** Spin until next timer tick ******/
next_task_time = tmr0_ovf_ctr + TASK_TICKS;
while (tmr0_ovf_ctr != next_task_time)
{
/******** Cooperative background tasks go here ******/
eemgr_task ();
// Update EEPROM.
}
E
TESTING
// Output motor PWM and direction
motor_task ();
}
W
W
W
mand output (i.e., because the motor
command has a range of ±127, the
integral term is limited to ±63).
The final term is the derivative.
The derivative of the error normally
would be determined by subtracting
the previous error from the current
error, but because of the low resolution of the encoders, this would result
in unacceptably low resolution in the
error derivative. How can you work
around this?
The derivative of position is velocity, therefore it follows that the derivative of the error in position must be
the error in velocity. Well, both the
desired and actual velocity are available, courtesy of the trajectory and
wheel tasks, so the velocity error can
be calculated directly.
36
Issue 128
March 2001
where CK is the crystal frequency and
PRE is the pre-scale value, which can
be 1, 8, 64, 256, or 1024. With a
7.3728-MHz crystal, the PWM frequencies are 14.1 Hz, 56.5 Hz, 226
Hz, 1807 Hz, or 14.5 kHz. Chipper
seems to work well together with a
226-Hz PWM.
The PWM frequency and other
setups occur in the initialization for
the motor task. The main loop processing for each wheel is simple.
Output a 1 or 0 to the direction output pin based on the sign of the motor
command. Then write the absolute
value of the motor command to the
PWM output register.
The proportional, integral, and
derivative terms are added to produce
the overall motor command. This calculation is done using 16-bit signed
math to prevent overflow. The result
is limited to ±127 and forms the input
to the motor task.
MOTOR TASK
I mentioned earlier that the ’8515
microcontroller has two hardware
PWM channels. The motor task converts the motor command output by
the PID task for each wheel into the
appropriate PWM duty cycle and
drives the direction output pins to the
correct state for each motor.
The ’8515 doesn’t offer much frequency selection for the PWM outputs. I wanted to use the 8-bit mode to
CIRCUIT CELLAR®
I did the initial testing using the
Atmel AVR Studio simulator. Starting
the simulator is easy. The avrgcc tools
output a file that allows limited
source-level debugging in C. The program code is displayed in C, and single-stepping and breakpoints operate
at the C level (note that pure assembly debug is possible). Unfortunately
you cannot use the watch window to
watch C variables; you must look in
the listing to determine the address of
variables of interest and then use the
memory window.
The first step of the process was to
put a breakpoint in the main loop and
verify that the loop was executing
every 71.11 ms. OK, it works, but
that was the easy part.
Next I wrote a special test file,
unit_test.c, that exercises each of the
processes and validates the outputs to
replace the normal chipper.c file. To
compile the unit test file, un-comment the # TRG = unit_test line in
the make file by deleting the “#”
symbol in the first column. This line
sets the target to unit test instead of
the normal Chipper main file.
Unit testing should be performed in
Simulation mode. Each function is
tested with a number of test cases. If
the test case does not give the correct
result, function fail() is called. If all
www.circuitcellar.com
Listing 2—This code implements the commands in Table 2. The state sequencer waits until the previous
command has been accepted and then queues a new command.
#define
#define
#define
#define
ST_RAMP_UP
ST_CRUISE
ST_RAMP_DOWN
ST_NEXT_STATE
0
1
2
3
W
.R
i2
W
W
.G
iU
R
U
M
E
LE
.H
switch ( state )
{
case ST_RAMP_UP:
// Ramp to velocity of 5 in/sec over a period of 0.5 second,
// at a ramp rate of 10 in/sec^2
right_wheel_data.desired_velocity_command = 0;
right_wheel_data.ramp_rate_command = 659;
left_wheel_data.desired_velocity_command = 0;
left_wheel_data.ramp_rate_command = 659;
num_loops_command = 7;
motion_command = MOT_CMD_QUEUE;
state = ST_CRUISE;
break;
case ST_CRUISE:
if ( motion_command <= MOT_CMD_PROCESSING_CMD )
{
// Cruise at a velocity of 5 in/sec for 10 seconds
right_wheel_data.desired_velocity_command = 4636;
right_wheel_data.ramp_rate_command = 0;
left_wheel_data.desired_velocity_command = 4636;
left_wheel_data.ramp_rate_command = 0;
num_loops_command = 141;
motion_command = MOT_CMD_QUEUE;
state = ST_RAMP_DOWN;
}
break;
case ST_RAMP_DOWN:
if (motion_command <= MOT_CMD_PROCESSING_CMD )
{
// Ramp down to velocity of 0 in/sec over a period of 0.5
// second, at a ramp rate of 10 in/sec^2
right_wheel_data.desired_velocity_command = 4613;
right_wheel_data.ramp_rate_command = -659;
left_wheel_data.desired_velocity_command = 4613;
left_wheel_data.ramp_rate_command = -659;
num_loops_command = 7;
motion_command = MOT_CMD_QUEUE;
state = ST_NEXT_STATE;
}
break;
}
O
static uint8_t state = ST_RAMP_UP;
of the test cases give the correct
result, function ut_complete() is
called. To run the unit test, I set a
breakpoint in each of these functions
and start the simulator.
If it breaks in fail(), then I debug
the problem using the facilities of the
simulator. It’s a sign that all of the
functions have passed unit testing if it
breaks in ut_complete (). The unit
test routines are long and include
many test cases.
www.circuitcellar.com
Of course, the real test is loading
the code in the robot and running it. I
wrote a simple routine to make the
robot move in an approximately 5¢
square, making smooth turns at each
corner rather than stopping to spin in
place. After some tweaking, it is off
by less than 1² after making one complete circuit, traveling approximately
20¢, and making four integrated turns.
A significant part of the remaining
error is caused by the 1.5² wide rubCIRCUIT CELLAR®
Issue 128
March 2001
37
184
166
126
64
262
70
304
134
~50
1360
GOALS
Mike Dvorsky has been involved
with hardware and software design
for 16 years, from his first job as a
VLSI designer to his current position
as an embedded software engineer at
Caterpillar Inc. in Peoria, IL. He has
a passion for amateur robotics and
algorithms for embedded microcontrollers. You may reach Mike at
kdvorsky@umtec.com.
SOFTWARE
The source code is available on the
Circuit Cellar web site. You can
download AVR-GCC for Windows
from 8bit.at.avr/.
W
W
W
.G
iU
R
U
M
E
LE
.H
Let’s review and determine if
the project’s goals were met.
Table 5 shows the number of
bytes required by each of the
motor control functions. I didn’t
include things that are not speTable 5—Only routines that are specific to motor control are
cific to motor control but did
included. The divide function from the avrgcc library is includinclude the main() code to inied because it’s linked into the final executable because of the
tialize and periodically call the
wheel task.
motor control functions. I also
included the code for the integer
ber wheels. I plan to replace them
divide from the avrgcc library,
with narrower wheels and tires to
because it’s used in the wheel task.
make the turns more repeatable. On
The total motor control code takes
the Circuit Cellar web site, the test
1360 bytes, or 16.6% of the 8192-byte
code to move in a square pattern can
code space on the ’8515 processor.
be found in chipper.c, function
This is below the 20% goal, but only
test_seq(), which is in dvorsky.zip.
by 278 bytes. Enhancing the module
During testing, it became clear that
interface will push the motor control
the interface for motion commands is
subsystem to more than 20%, but the
not user-friendly. You want to give
benefits outweigh this cost.
commands like “go forward 36² at a
The only routine I had to write in
maximum speed of 8²/s and maxiassembly language was the scaled
mum acceleration of 20²/s2.” With
multiplication function. At 64 bytes,
Chipper, the calling routine is forced
this represents 4.7% of the 1360 bytes
to break this into separate commands
used for motor control, well under the
to ramp up to speed, cruise, and ramp
goal of 20% assembly maximum.
down. Furthermore, the units are
Overall I rate Chipper’s motor conencoder pulses rather than inches, and
trol subsystem a success, with the
loops rather than seconds.
major flaw being a difficult interface
This is not good! My original conto the module. So, how am I doing
cept was a distributed architecture
with the main goal of Chipper finding
with a dedicated motor control
and extinguishing a candle? The
processor based on another AVR, the
motor control subsystem is a major
AT90S2313. The ’2313 has limited
part, but I’m still working on the
resources—just 1 PWM channel, 2 KB
remaining tasks of navigating the
of flash memory, and 128 bytes of
model house, finding the room with
RAM. I didn’t have the code or RAM
the candle, finding the candle within
space to implement complex comthe room, avoiding furniture, and
mand processing, so I made the main
extinguishing the candle.
processor do the work. The concept
I hope to follow up with an article
evolved into an integrated design with
detailing the design of a successful
the ’8515 doing everything, but I did-
(winning?) fire-fighting robot in the
2001 contest. As a well-known
“robot” once said, “I’ll be back….” I
O
Encoder ISR
Motion command task
Motor task
Multiply 16 × 16 scaled
PID control task
Trajectory task
Wheel task
Library divide
Main loop
Total
n’t update the interface to the
motor control subsystem. I plan
to do that soon.
.R
Number of bytes
i2
Module name
Listing 3—The trajectory task performs this logic for each wheel.
if ( num_loops_remaining != 0 )
{
desired_position = desired_position + desired_velocity;
desired_velocity = desired_velocity + ramp_rate;
}
38
Issue 128
March 2001
CIRCUIT CELLAR®
SOURCES
UDN2998W Dual H-bridge
Allegro MicroSystems, Inc.
(508) 211-3476
Fax: (508) 853-3353
www.allegromicro.com
AT90S8515 datasheet, AVR Studio,
AVR ISP
Atmel Corp.
(408) 441-0311
Fax: (408) 441-0732
www.atmel.com
Gearhead motors
Globe Motors
(937) 228-3171
Fax: (937) 229-8531
www.globe-motors.com
MCP130-475D Microcontroller
supervisory circuit
Microchip Technology Inc.
(602) 786-7200
Fax: (602) 786-7277
www.microchip.com
PT5101A Integrated switching regulator
Power Trends, Inc.
(800) 531-5782
(630) 393-6901
www.powertrends.com
Trinity College Fire Fighting Home
Robot Contest
Trinity College
Fax: (860) 232-0435
www.trincoll.edu/events/robot
www.circuitcellar.com
High-Performance Fuel Gauge Integrates
Li-Ion Protection Circuit and Sense Resistor
.R
O
The revolutionary DS2760 from
Dallas Semiconductor is the first fully-featured fuel
gauge IC that integrates two critical components 
a sense resistor and Li-Ion protector  on a 3.25
mm x 2.74 mm die-sized package. The DS2760
includes high-precision data acquisition and fuel
gauging with no external sense resistor, an integrated Li-Ion protector, and sufficient memory to store
the personality of the battery pack. All this functionality comes in a small footprint at very low cost.
We can get you
started with an evaluation kit for the
DS2760, which includes a miniscule 5 mm x 45 mm rigid PCB complete with the DS2760, IRF6150 power-FETs, and demonstration software. If you want all this power at minimal cost, check out the
DS2760 at www.dalsemi.com/DS2760.
.G
Store with Confidence
iU
R
U
M
The DS2760 continuously measures and stores the battery's voltage, current, and temperature with plenty of resolution and
dynamic range for even the most demanding applications.
The high-precision current measurements are integrated over
an internally-generated timebase to facilitate fuel gauging. The
current measurement/fuel gauge is made even more accurate
through real-time continuous and automatic offset corrections.
Because a sense resistor is paired with each DS2760, even
resistance variations from processing and temperature are
trimmed out.
LE
.H
Precision Performance
Ignite
Your Design
E
The integrated DS2760 protector continuously
monitors the cell for overvoltage, undervoltage and overcurrent
(charging and discharging). The protector controls external FETs,
which terminate charging and/or discharging, depending upon the
safety violation.
i2
Safeguard Your Cell and PCB Area
W
W
The DS2760 comes fully loaded with 64 bits of unique and
unalterable ROM in the form of a 1-Wire® net address. 32 bytes
of lockable EEPROM store critical static data that cannot be lost
in the presence of a pack short circuit or ESD event, such as cell
capacity, charging/discharging efficiency, and cycle count. 16
bytes of SRAM allow for frequently changing data.
W
Simplified Communication: Just One Pin
All DS2760 data is transferred between the battery pack and host
via a single wire, multi-node, digital communication interface.
The 1-Wire interface minimizes battery contacts, reducing
overall pack cost. The DS2760 is also the first Li-Ion protector
that allows the host processor to electronically monitor/override
the on-state of the safety FETs. You can even use this feature to
cycle power of the portable product or to swap between packs in
multi-pack applications.
Features
Single-cell Li-Ion protector for over/under-voltage, overcurrent
(charge/discharge), short circuit
Optional integrated 25 mΩ sense resistor, individually trimmed
on each DS2760
High precision data acquisition
♦ 13-bit current measurement
♦ 11-bit temperature measurement
♦ 10-bit voltage measurement
♦ 16-bit current integrator (fuel gauge)
Real-time automatic and continuous current ADC offset correction
Unique and unalterable 64-bit ROM
32 bytes of lockable EEPROM
16 bytes of user SRAM
1-Wire, multi-node digital communication interface
Multi-pack power management support and system power
control using protection FETs
Only 2 µA (max) in sleep mode and 80 µA (max) in
active mode
3.25 mm x 2.74 mm die-sized package
or 16-lead TSSOP package, both with
or without optional 25 mΩ sense
resistor
Evaluation kit available
www.dalsemi.com/DS2760
4401 South Beltwood Parkway, Dallas, Texas 75244-3292 ™ Phone: 972-371-4448 ™ FAX: 972-371-3715
R
U
M
E
t’s the middle of
the night and the
urge to raid the refrigerator has struck. Not
wanting to disturb your spouse, you
quietly sneak out of bed, carefully
feeling your way out of the bedroom.
And then you trip over the sleeping
dog and fall against the hall table,
destroying that expensive vase.
Take two. It’s the middle of the
night and the urge to eat has struck.
Now, you’ve planned ahead and put
an X10 switch on the hall light. You
carefully reach for the controller and
begin hitting buttons in the dark
without luck. But, you turned on the
X10 controlled coffeepot and fed the
dog his entire week’s kibble supply
from the X10 controlled dog feeder.
Your spouse mumbles
about getting your
lazy body out of bed
and turning on the
light if you want it on.
Take 3. You step out
of bed and begin walking toward the hall.
The hall light comes
on instantly. How did
that happen? Thank
Photo 1—The Geo-Mite processor is in the black case, the sensor is in the
the Geo-Mite and
cylinder. The LED display and push button that changes sensitivity are on the
enjoy your snack.
front of the case.
W
W
W
.G
iU
Here’s a project that
picked up some good
vibrations from our
Design2K judges. The
Geo-Mite won’t bring
you any of the oil
industry’s money, but
its potential as an
alarm device can bring
you a barrel of security (which is probably
worth more than a
barrel of oil anyway).
i
LE
.H
The Geo-Mite’s Sensitivity Can’t be
Beat
40
Issue 128
March 2001
O
From the Oil Field to
Your Home
.R
David Penrose
i2
FEATURE
ARTICLE
The Geo-Mite combines a sensitive
vibration sensor (produced by
Geosource for oil field seismic exploration, hence “Geo”-Mite), an
87LPC764 microprocessor, a TW523
(or PL513) X10 interface, and an RS232 interface to provide a portable
alarm system that can detect footsteps or vehicle motion (see Photo 1).
It can sound an alarm or send an X10
code to turn on a device. Figure 1
shows an overview of the hardware.
The unit can be operated standalone or be programmed through the
RS-232 interface. In the stand-alone
mode, a push-button switch adjusts
the device’s sensitivity. The X10 code
sent for an alarm is a default
house/unit code programmed into the
software. By connecting the Geo-Mite
to a PC, you can change the sensitivity and X10 code and turn off the audible alert via the PC. The device can
then be disconnected from the PC and
operated in a stand-alone mode.
A 10-element LED indicates any
vibration the unit is sensing and also
shows the trigger level for the alarm
when you’re using the push button to
change sensitivity. When operating,
the LED bars rise and fall with the
vibration in the local area. If the bars
climb to the trigger level you selected,
a tone alarm will sound and the X10
code will be transmitted.
When you push the button on the
front of the unit, the multiple bar display will change to a single bar at the
level selected for the alarm. Pushing
the button again will raise the level
one bar at a time until it exceeds 10
and wraps back to zero. If the unit is
left at zero, the alarm won’t sound
but the vibration levels will still be
displayed on the front of the unit. The
CIRCUIT CELLAR®
www.circuitcellar.com
.G
HARDWARE
W
W
W
The geosensor is a magnet suspended in a coil. The coil is attached to
two terminals on the top of the sealed
case. I implemented a dual op-amp
amplifier to take the output of the
coil and produce a square wave. One
of the op-amps in the package acts as
an amplifier with a gain of 100. The
second amp functions as a comparator
and essentially takes any output from
the first amplifier and drives itself
into saturation.
The analog values produced by the
coil didn’t interest me, but rather the
number of vibrations produced per
second. This two-stage amplifier does
this job nicely. Photos 2 and 3 show
the construction of the sensor unit.
An 87LPC764 microprocessor
processes the square wave from the
sensor to drive the display and trigger
www.circuitcellar.com
O
.R
i2
Photo 3—The sensor and circuit board fit into a section of 1² PVC tubing with two end caps sealing the
top and bottom.
The software counts the vibration
inputs, so the bar graph begins with
one LED lit and proceeds to light
more during a 1-s period. There would
be only a brief instant at the end of
this 1-s period that all 10 LEDs would
be illuminated and contributing to
any heating problem in the processor.
To be on the safe side, I used 330-W
resistors on each LED, and the unit
appears to work reliably.
The X10 interface (TW523/PL513)
provides two lines that are used to
send X10 commands. The first is a
zero-crossing line and is an input signal to the processor. This signal is a
square wave that follows the 60-Hz
line signal. Note that command transmission must occur within 1 ms of
the zero crossing.
I connected this input to *INT0 to
allow the falling edge of this line to
trigger an interrupt. I use a timer in
the processor to then time 8 ms from
this interrupt to simulate the rising
edge. This zero-crossing signal is
pulled up to the 5-V line by a 5-KW
resistor. If I had followed the TW523
recommendation, I also would have
included an isolation resistor and
diodes to 5 V and ground to guard
against voltage spikes. But the risk
was low in this application, so I left
them out.
The X10 transmit input line is an
output from the processor on port pin
P1.7, which carries the ones and zeros
that make up the data of the X10
transmission. I again deviated from
LE
.H
E
U
M
iU
mode will change from the alarm set
to the vibration display/alarm mode if
you don’t push the button for 2 s.
The Geo-Mite is sensitive. It can
detect footsteps on the first floor of
my house while sitting on a desk in
an upstairs bedroom. It’s been fun to
design and implement. Philips’ 87LPC
family of processors made implementation easy. Packaging was the challenging part. I eventually succeeded in
putting all of the electronics and a
battery supply inside a small case
that’s effective and easy to operate.
R
Photo 2—The Geophone sensor is the metal cylinder.
The PC board has a dual op-amp, some resistors, and
decoupling capacitors. In this prototype version, a transistor is added to provide additional drive on the output
from the op-amp and an RJ-45 connector is used.
the X10 alarms. The 87LPC764 uses
10 pins to drive the LED bar display.
The P1.5 port pin is tied to the vibration sensor. The processor monitors
this line for changes and counts the
number of square wave transitions
that occur each second. The TxD and
RxD pins on the processor are converted to RS-232 levels by a Maxim
MAX232 chip.
A 6-V flat package alkaline battery
provides the power supply. A diode
gives a small voltage drop just in case
the Maxim chip doesn’t appreciate the
full 6-V-plus of a fresh battery. The
microprocessor is more tolerant and
could have used the battery voltage
directly. Port pin P1.4 (*INT1)
is tied to a switch that pulls the line
to ground when pressed. I put the
piezo sounder on this pin also and
tied it to the positive supply. So, the
processor can sound the alarm by
grounding the line and every time you
press the switch, there is the audible
feedback of the buzzer.
I configured the 87LPC764 to ignore
the reset line to free one more line,
which is used for the vibration sensor
input. I elected to use a crystal,
although the internal oscillator could
have been used if the serial interface
had been deleted. The accuracy of the
external crystal is required to generate a stable, predicable data rate.
The LED bar display produces a
bright glow without driving it near
the 20 mA normally required. This
made me feel better about driving 10
LEDs from the processor. Each processor pin can adequately sink 20 mA to
ground, but if all 10 are on simultaneously it may exceed the power dissipation capabilities of the device. One
mitigating factor is that if all 10 light,
it will be for only a brief instant.
Photo 4—The lower portion of the case contains the
battery. The upper portion has the processor, push-button switch, and connectors for the X10 and serial lines.
The sensor is hardwired to the circuit board.
CIRCUIT CELLAR®
Issue 128
March 2001
41
W
W
W
.G
O
.R
i2
LE
.H
iU
The software uses a polling loop
and the interrupts from the X10 zero
crossing and 8-ms timer. The polling
loop is constantly looking for input
from the RS-232 line or checking a
counter to determine if 1 s has
elapsed. When it detects an incoming
character, it branches to a processing
routine to take the appropriate action.
If 1 s has elapsed, it will clear the
count that may have accumulated
during that second and clear the LED
bar display.
This main loop is also accumulating a count that should be reset by
the X10 interrupt. This is a watchdog
counter that detects if the X10 line is
not in use and initiates a switch over
to the timer to ensure that the vibration input is examined every 8 ms.
The timer interrupt detects and
counts changes in the vibration sensor line, counts down the 1-s counter
for the main loop, and sends the X10
commands. Each time the interrupt
occurs, the timer compares the current state of the vibration line against
the previous state. If a change has
occurred, it will record the new state
and then display the count on the
LED bar display.
E
SOFTWARE
U
M
the recommendation and used a 1-KW
resistor instead of a transistor to pull
up the signal line.
The drawback is that more current
is consumed because the processor is
holding the line low unless there is a
1 bit to send. But, to my advantage, I
didn’t have to include a transistor. If
low power becomes important, I will
change to the transistor approach.
Figure 2 shows the schematic diagram
of the complete hardware.
R
Photo 5—The back of the case has two 8-pin, RJ-45
jacks for connecting the X10 TW-523 interface and PC
serial interface.
The logic divides the count input
by two prior to displaying to account
for each impulse to the sensor, generating two transitions (either a
high/low/high or a low/high/low). If
this count exceeds the alarm level
that has been set, then the logic will
queue an X10 command to send.
The interrupt logic also updates the
Photo 6—Every time you press the button, the sensitivity level is raised one count and displayed on the
LED bar display with each change of
LEDs. After 2 s, the display reverts back to the
the counts. The alarm level setting
Vibration Display mode.
logic complicates the display logic. If
you press the push button, the display
X10 actions. This command allows
of the alarms is inhibited until the
you to select a house code, unit code,
alarm level logic is complete. The disand on duration for the alarm. The
play logic addresses each bit individucurrent settings can be interrogated
ally to give you the flexibility to
without changing their settings.
check out on a second platform and
The B command turns on and off
also to allow the alarm level display
the alarm tone. The alarm tone
to illuminate one LED at a time.
changes every time the B command is
The X10 transmission logic interroexecuted.
gates cell X10_NUM_TO_SEND to
The E command allows the on-chip
determine if an X10 command needs
memory to be examined. This logic
to be transmitted. This cell also is
requests an address from you and disused to inhibit changes to the X10
plays the contents of this address.
command until all bits have been
This address is saved so you can
sent. The command is stored as 28
examine successive addresses by just
bits and a word. The bit pointer steps
pressing the Enter key.
through these bits with each 8-ms
There also is the F command,
interrupt (either from the timer or
which initiates a fresh start and resets
X10 zero crossing).
the values to the default values.
The 28 bits constitute the true and
The H command is the help comcomplement values that are to be sent
mand. This command produces a disfor each command. After the 28 bits
play of how to use the serial interface
have been sent, X10 protocol requires
to configure the Geo-Mite.
that the logic reset send the pattern
The next command, S, changes the
again. After the second transmission,
sensitivity of the sensor. This is
the logic resets to allow another comessentially the same action as the
mand to be queued.
push button. The difference is that
The construction of the 28-bit patthe level can be set from zero to 254
tern for the X10 command has been
and the push button allows for only
generalized so that it can be changed
zero to 10. The added range from the
by an operator interface. The interface
translates the house code and
unit/action codes into the bit
pattern for transmission. A
complete command consists of
two transmissions, the X10 on
and off commands. The off
command is spaced 30 s after
the on command unless the
operator has modified this
using the A command from the
PC interface.
There are eight operator
actions performed through the
Photo 7—As the unit detects vibration, it counts the number of
serial interface. First, there is the events on the LED display. The display is cleared each second
A command, which changes the and the counting begins again.
42
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
U
M
E
LE
.H
i2
.R
O
operator input is useful
either side of the display.
when diagnosing the unit’s
The resistors connecting the
Push-button
Ten-element
switch
performance.
display to the processor and
LED
And, the T command togthe X10 inputs to the procesgles between a standard PC
sor were then added.
Geophone
interface with a VT100
Next I fitted the other half
87LPC764
PC
vibration sensor
Microprocessor
connection
emulation to a special handof the clamshell case with a J
held terminal interface that
alkaline, 6-V, flat-pack batuses a 4 × 20 character distery. A case was made for
X10 Interface
Alarm
play. I used this special
this battery with two contact
TW523
buzzer
hand-held device to check
pins for the plus and minus
out the unit, hence the need
outputs. A small slide switch
Figure 1—The 87LPC764 integrates a vibration sensor, switch, buzzer, LED disfor this command.
was put into this side of the
play, and X10 interface into a sensitive alarm system.
Finally, the W command
case to turn off power to the
allows on-chip memory to
unit when it’s not in use.
be written. First, you are prompted for
The
battery’s
power is fed through the
RJ connectors were then fitted to the
an address, then the contents of that
switch
and
then
a small diode before
back of the case for the PC and X10
cell are displayed, and you are asked
being
made
available
for Vcc on the
interfaces (see Photo 4).
to enter the new contents. This comprocessor
board.
Photo
5 shows the
I used 8-pin connectors because it
mand, like the E command, will
inside
of
the
case
of
the
Geo-Mite.
was easy to get a pair of them in one
repeat with successive addresses if
The
sensor
is
housed
separately
in a
unit. A section of prototyping board
you enter just a carriage return rather
section
of
1²
PVC
tubing
capped
at
was then cut to fit the case and
than a character command.
both ends. A small section of protomounted to the LED display. I cut off
typing board was cut into a circle
a piece of this board for the push-butslightly less than 1² in diameter. The
CONSTRUCTION
ton switch and 8-pin connectors.
op-amp, resistors, and capacitors were
The challenge was to put this projAll that was left to handle was the
soldered to this board. And, some
ect inside a 3.5² × 2.25² box. I started
real estate for mounting all the comflexible leads connected the vibration
by cutting a hole on the front of the
ponents. The sockets for the ’LPC764
sensor to this board.
case to mount the display. Two 8-pin
and MAX232 chip were spaced on
W
W
W
.G
iU
R
RS232/RS422/RS485 Converters
RS232 TO RS485
2 wire
• Makes your RS232 port an
RS485 port
• Supports up to 40 RS485
devices
• Automatically determines
data direction.
• Signal powered version
available
ADA485 (requires 9VDC) $79.00
ADA485-1 for 110VAC
89.00
ADA485L signal powered 84.00
CMC’s low cost converters adapt any
RS232 port for RS422 or RS485
operation. These converters provide your
RS232 device with all the advantages of
RS422 or RS485 including reliable high
speed operation (up to 200 kbaud) and
data transmission distances up to 5000
feet. Two AD422s can be used to extend
any RS232 link up to 5000 feet.
Completely transparent to the system;
RS232 TO RS485
no software changes of any type are
4 wire
necessary.
• Converts an RS232 port for
use with RS422 or RS485
RS232 TO RS422
devices
• Supports up to 40 RS485 or
• Converts bi-directionally
RS422 multidrop devices
between RS232 and RS422
• Adds multidrop capability to
• Use as a short haul modem
RS232 devices
• Plug in and go. No software
• Automatically determines
changes required
data direction.
AD422 (Requires 9VDC) $79.00
AD422-1 for 110VAC
89.00 ADA425 (requires 9VDC) $89.00
99.00
AD422L signal powered 84.00 ADA425-1 for 110VAC
Mention this ad when you order and deduct 5%
Use Visa, Mastercard or company purchase order
code
CC83
Connecticut microComputer, Inc.
PO BOX 186, Brookfield,CT 06804
WWW.2CMC.COM
www.circuitcellar.com
CIRCUIT CELLAR
®
(203)740-9890
Fax:(203)775-4595
Issue 128
March 2001
43
adhesive keeps the unit together
securely while still allowing it to be
removed for servicing or adjustment.
OPERATION
LE
.H
i2
.R
O
Setting up the unit is simple. The
sensor is placed in an out-of-the-way
location where it will be close to the
traffic that it is supposed to sense.
The processor box is then placed in a
location where the wires to the X10
interface can be run safely. After that,
the X10 interface is plugged in and
the Geo-Mite’s power switch is
turned on.
Next, a test is executed while
observing the LEDs. The push button
is used to increase or decrease the
alarm level to the point where it will
send an alarm at the appropriate level
while ignoring inputs less than the set
level (see Photo 6).
Use HyperTerminal, supplied with
Windows, to program the unit via a
PC. The communication should be
set up as 9600 bps, 8 bits, 1 stop bit,
no parity. The VT100 emulation
should be selected and the option to
add line feeds should be enabled.
Figure 2—All port pins are used on the 87LPC764 processor. The push-button switch will read low to the processor when it’s pressed. It also sounds the buzzer. The processor can sound the buzzer by writing 0 to this line.
U
M
E
pass through the power and signal
wires. The tubing is attached to the
pipe with flexible adhesive. This
W
W
W
.G
iU
R
One end of the PVC has the cap
permanently attached with PVC glue.
A hole is drilled into the other end to
44
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
Geo-Mite
Geosource, Inc.
(703) 478-6893
(703) 777-9830
www.geosource.com
MAX232 chip
Maxim Integrated Products, Inc.
(408) 737-7600
(800) 998-8800
Fax: (408) 737-7194
www.maxim-ic.com
O
David Penrose is a management and
engineering consultant in Bedford,
New Hampshire. He has a Master’s in
Computer Science and holds an Extra
Class Amateur radio license
(AA5QL). His experience includes
more than 30 years with a major
aerospace corporation and more
recently as vice president of systems
87LPC764
Royal Philips Electronics
(212) 536-0500
Fax: (212) 536-0559
www.philips.com
E
U
M
X10
X10, Ltd.
852 2334 6848
Fax: 852 2764 2437
www.x10.com
W
W
W
.G
iU
R
This prototype does most things
well. In the future, one improvement
I may make is enable a low-power
mode so that programming is not lost
when power is turned off. The
87LPC764 supports this already, but I
would need to modify the software to
put the power-down command in the
SOURCES
.R
NEXT STEPS
and technology for a high-tech startup company. You may reach him at
penrose@mediaone.net.
i2
main loop after the processor loops to
the top of the action loop.
Interrupts for the serial input, X10
zero crossing, 8-ms timer, and the
push button can then wake the unit.
The MAX232 chip needs to be traded
for a unit that can shut down to
reduce power. The current one draws
about 5 mA. The X10 transmit line
could then do double duty to disable
this chip when not required. It wouldn’t be clean, but it would work.
This project was fun and a great
learning experience about the 87LPC
processors. I didn’t use the fancy features, but did use just about all of the
pins. Future projects are going to push
the envelope on this chip to explore
what it really can do. I
LE
.H
The Geo-Mite doesn’t use flow control because the communication going
both directions is terse. After this
communication is defined, the GeoMite should be turned on. A screen
prompt will show either “S-” or “H-”.
For a PC, the “S-” prompt must be
used. The T command will toggle
between the H and S modes.
Now you can proceed to set sensitivities, or X10 codes, based on the
configuration desired. These codes
revert to the factory defaults when
the Geo-Mite’s power is turned off.
After programming, the serial cable
can be disconnected and the unit is
ready to operate. Photo 7 shows the
unit displaying a vibration event with
five bars illuminated on the LED.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
45
R
U
M
E
needed a
remote-controlled
(R/C) receiver for an
electric, indoor aircraft I
was building. The receiver needed to
be as lightweight as possible so that
my airplane can fly slowly. I was able
to build a receiver that is as light as
any commercial product for less
money. Although this delayed completion, it turned out to be interesting
and rewarding.
The details presented here will
enable you to build your own lightweight R/C receiver. Furthermore,
information about the R/C communication protocols and circuit components will enable you to modify this
design to meet your requirements.
The requirements for my design
were weight, size, functions, operating voltage, and operating range. It
needed to be as lightweight as possible (about 2 grams) and small. For
functions, it needed to have at least
three, including throttle, rudder, and
elevator. The operating voltage goal
was 5 VDC ±0.5 V and the objective
range was at least 100¢ (after all, it’s
for indoor use).
To keep the receiver light, I selected
the smallest components I could handle. The bare circuit board and com-
W
W
W
.G
iU
Building an R/C
receiver for a lightweight aircraft was a
new experience for
Ron, but it certainly
wasn’t a painful one.
The best part about
this project was the
fact that it not only met
the design requirements, but it also cost
less than the commercial alternatives.
i
46
Issue 128
March 2001
O
R/C SERVO SIGNALS
Next, I had to understand how the
information for several servos is
encoded into the RF signal sent by the
R/C transmitter and how the receiver
should decode and distribute the control signals to the appropriate servos.
Having used R/C servos for other
projects, I observed that the position
of a single servo was controlled by the
pulse width of a signal that repeats at
about a 40-Hz rate.
This control pulse could be any
width between about 1 to 2 ms. A 1.5ms pulse width commands the servo
to go to the center. A 1-ms pulse
width commands it to rotate to a
position about 30° counterclockwise
from the center position. And a ~2-ms
pulse width commands the servo to
rotate to a position about 30° clockwise from the center position.
While researching, I concluded that
the pulses of a multi-servo system are
back-to-back (see Figure 1a). I also
learned that some R/C transmitters
use positive shift and others use negative shift frequency modulation.
First, I built the FM receiver using
the TDA7021 so that I could observe
the encoded control signal. When the
RF portion was operational, its output
signal looked like the trace shown in
Figure 1b. I used a five-function positive shift FM transmitter. The output
signal from the FM receiver was a
pulse train consisting of six tiny pulses that repeated at about a 40-Hz rate.
By fiddling with the control sticks
on the R/C transmitter, I learned that
the pulse widths did not change, but
LE
.H
Building Your Own
Lightweight R/C Receiver
.R
Ron Jesme
i2
FEATURE
ARTICLE
ponents each accounted for about half
of the receiver’s weight. I didn’t use
connectors, but rather, made the R/C
servo and power wires hardwired to
the receiver.
I started by researching frequency
modulated (FM) radio receiver integrated circuits (IC). The TDA7021
was the best choice because it
required few additional components.
Also, it could be used with a lightweight LC oscillator and still have
adequate frequency stability. Another
important attribute of the TDA7021
is its lightweight, small outline, surface-mount package.
CIRCUIT CELLAR®
www.circuitcellar.com
a)
LE
.H
i2
.R
O
b)
directly onto the copper clad board.
Instead of using standard plotter
pens, I used an ultrafine point Sharpie
permanent marker, because the ink is
nearly etch resistant. I plotted the circuit pattern onto a small scrap of
material to make the flex circuit. I
used the lightest circuit board material I could find to make a flexible
board. However, because of the small
size of the circuit, it’s stiff.
Because I wanted a double-sided
circuit board, I made two small circuit boards and glued them back-toback. I used double-sided material for
the RF circuitry so that it would have
a continuous internal ground plane.
The circuit design uses a minimal
number of interconnections between
the top and bottom PWBs. The interconnections are hardwired with short
jumper wires. To keep the layout
compact, I eliminated a few long
winding traces by adding a few short
jumper wires. All of the jumpers are
shown as bold lines in Figure 2.
U
M
E
Photo 1a—The digital decoder is shown here. b—On
the front and back sides of the micro R/C receiver, the
blue wires are short jumpers used to eliminate long
winding traces. The purple wires are jumpers to interconnect the two sides of the receiver. The back side of
the digital decoder’s traces can be seen through the
thin circuit board material.
CIRCUIT DETAILS
R
for assembling the surface-mount
The receiver needs to receive the
components. I wouldn’t spend money
radio signals sent by my R/C transhaving a PWB made, and typical PWB
mitter on channel 24. Channel 24
materials weigh a lot. So, I had to
R/C transmitters use a center frerevive and refine a method of making
quency in the 72-MHz radio band.
my own PWBs that I had experimentThe frequency of any of the R/C
ed with years ago.
channels in the 72-MHz band can be
I ended up making PWBs by drawcalculated by:
ing etch resist onto
a)
a copper clad
board, then etching
Servo 1
off the unwanted
Servo 2
copper. I couldn’t
Servo 3
draw the circuit
pattern by hand
Servo 4
because of the
Servo 5
detail needed to
create a compact
b)
circuit using
Receiver
miniature surfacepulse train
mount compoPositive shift
nents. I laid out
modulation
the circuit with a
c)
CAD software
package that could
Receiver
pulse train
output the circuit
Negative shift
pattern to a plotter.
modulation
This way, I could
precisely plot the
Figure 1—Here, you see the relationship between the servo control pulses and
the radio signal modulation.
etch resist pattern
W
W
.G
iU
the positions did. I reasoned that the
relationship between the pulses in
Figures 1a and b could be correlated.
Although my R/C transmitter uses
positive shift modulation, I suspected
that a transmitter that uses negative
shift modulation would result in a
signal as shown in Figure 1c.
If it wouldn’t add much weight, I
wanted to make my receiver capable
of working with both positive and
negative shift transmitters. I also realized that if I had an eight-function
transmitter, still there would be about
a 9-ms pause between the pulse trains
even if all eight functions were using
a full 2-ms pulse.
I used this pause to synchronize the
receiver with the transmitter. The
logic circuitry could use the pause to
determine which is the first pulse and
route the first output pulse following
the pause to the first servo output
connection. The next output pulse
would be routed to the second servo
output connection, and so forth.
I was tempted to use a small microcontroller for the pulse decoding and
distribution, but its internal clock
may generate enough RF interference
to render the RF receiver useless.
Therefore, I implemented the digital
decoding process with a few discrete
logic chips. Now, I can observe the
intermediate waveforms and verify
that the design is working rather than
wonder if there is a firmware error in
a microcontroller or if noise from the
microcontroller is jamming the RF
circuitry. I built a breadboard of the
decoder circuitry to be sure that it
would work when miniaturized.
MINIATURIZATION
W
I used small components because of
their weight. I used resistors and
capacitors of the 0603 package size
because of the large selection of components and because they’re as small
as I care to handle. The TDA7021
comes in only a fine pitch, surfacemount package. Unfortunately, it’s
not available in a DIP package, which
would have made building a quick
prototype possible.
Nothing other than a printed wiring
board (PWB) seemed like it would be a
reliable and compact enough method
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
47
[4]
.R
O
These components also can perform
an impedance matching function,
matching the output impedance of
the antenna to the input impedance of
U1 at pin 12. The input impedance of
pin 12 is about 700 W, but the resistance of a thin antenna wire probably
would be less than 700 W. The impedance transform of this resonant circuit is approximated by:
N=
R input
= C12 + 1
R antenna C11
2
[5]
where Rantenna is the antenna impedance, Rinput is the input impedance,
and N is the impedance ratio of pin
12. [1] Without knowing what antenna length I would use or what its
Figure 2—Check out the details. The bold
lines represent jumper wires.
W
W
W
.G
iU
R
U
M
where fRF is the transmitter center frequency, fLO is the local oscillator frequency, and fIF is the intermediate frequency. To generate the required LO
frequency, I had to select an inductor
(L1) and capacitors (C4 and C5) that
where L is the inductance L1 and C is
the total capacitance of C4 + C5 (see
Figure 2).
A inductor value of 56 nH was
used, because it results in a reasonable value for C4 and C5 at the LO
frequency. Only a small portion of the
total capacitance is variable, so it’s
easier to tune and the LO is more stable. I selected the variable capacitor
and inductor because of their temperature stability, weight, and small size.
Because the receiver has a bandwidth of ±75 kHz and the signal it
needs to receive is only ±10 kHz, the
signal still would be received even if
the LO frequency varies by ±65 kHz
from its intended 72.194 MHz. This
allows for some mistuning and thermal drifting of the LO frequency.
L2, C11, and C12 also form a circuit that resonates at 72 MHz. The
circuit filters unwanted RF signals.
LE
.H
[2]
[3]
E
where x is any R/C channel number
from 11 to 60 and f is the center frequency. Equation 1 shows that the
channels are separated by 20 kHz.
This amount indicates that each
channel has a band of ±10 kHz over
which it can modulate the center frequency. The receiver IC has a ±75kHz bandwidth and an intermediate
frequency (IF) of 76 kHz.
In order to get the 72.27-MHz RF
signal of channel 24 down to the IF
frequency of 76 kHz, it must be
mixed with a local oscillator (LO) frequency of 72.194 MHz:
The resonant frequency of this circuit
also can be calculated using Equation
3, but Cequivalent must be substituted for
C. Cequivalent can be calculated as:
i2
would resonate at 72.194 MHz:
[1]
48
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
.R
O
The signal from U3a pin 1 is amplified sufficiently to be detected as a
logic 0 or 1, but has slow rise and fall
times and is offset by VBIAS. The circuitry around U7a is designed to
accurately detect and classify the signal as a logic high or low. U3a’s signal
is passed to U7a pin 3 through a lowpass filter created by R25 and C26.
This filter further minimizes any
noise on this signal. The maximum
frequency allowed to pass is 10.6 kHz.
Again, a large R25 was chosen to
minimize the current required by
U3a, and C26 was selected to pass the
required signal frequencies. U2, C24,
C25, R26, R27, and C30 generate a
LE
.H
This bias voltage is applied to R22
and R24 to properly bias U3a. The circuit configuration around U3a is
designed to amplify the signal coming
from U1 pin 14, without amplifying
any of the DC bias voltages. The voltage gain, AV, of U3a is determined by:
[11]
i2
[9]
was chosen so that the current
required by U3a would be minimized.
R23 works with C23 and U1 to limit
the bandwidth to which this amplification is applied, minimizing noise
from unwanted signals. The maximum signal frequency, fMAX, passed by
this configuration is 10.6 kHz:
E
[10]
yielding a gain of 100. A large R23
[7]
W
W
.G
iU
R3 prohibits a static charge from
building up on the antenna. R3 was
selected to be a low enough resistance
to drain static charge from the antenna to ground, while also being large
enough to prevent attenuation of the
RF signals on the antenna. The other
components around U1 are described
in the TDA7021 datasheet. [2] These
provide the coupling, biasing, and
bandwidths for proper operation of
this integrated circuit.
R21 and C21 were included in the
schematic and layout to be used if
additional signal filtering was needed.
The circuit worked well without the
additional filtering, so I used a 10-W
resistor as a jumper for R21, and C21
wasn’t used. The signal output of U1
is on pin 14. This signal is small, and
rides on a DC bias provided by U1.
Because this DC bias isn’t stable, it
must be replaced with a more stable
bias. C22 blocks out the unstable DC
bias while passing the signal of interest. C22 and R22 determine the lowest frequency that will get passed
unattenuated to U3a:
This source resistance must be
smaller than the resistance of R22 or
R23. The values of R40 and R41 were
selected to produce a bias voltage of
2.45 V, which is about midway
between ground and U3a’s operating
voltage of 5 V. The resultant bias voltage, VBIAS, is calculated using:
U
M
[6]
[8]
R
impedance would be, I let C12 equal
C11. C13 was selected to approximate
a short circuit at RF frequencies,
keeping pin 13 of U1 at RF ground
while not disturbing the IC’s internal
DC biasing at pin 13. The impedance,
ZC, of C13 at 72 MHz is 0.7 W:
W
Based on the knowledge that servo
pulses are on the order of 1 ms, I suspected that much of the signal energy
would be in the 1-kHz frequency
band. But to allow for fast rise times, I
let frequencies as high as 10 kHz pass
through the filters. To find a lower
frequency limit, I used the fact that
servo signals repeat at about a 40-Hz
rate, thus the design allows frequencies at least this low to pass through
the filters. R40, R41, and U4 generate
a stable, low-impedance bias voltage.
The source resistance is 1.3 kW, as
determined by Equation 8:
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
49
W
W
W
.G
iU
U
M
R
E
LE
.H
i2
.R
O
.G
W
W
W
[12]
R29 is 82,000 W and C32 is 0.1 µF.
When U6a pin 13 goes low, it causes U6b to output a 100-µs reset pulse
to U5. The duration is determined by
R30 and C33 using Equation 12.
Following the reset pulse, the series of
quick signal pulses from U7a prevent
U6 from generating a reset pulse to
U5 and clock U5. This causes U5 to
increment through the outputs until
another pause causes U6 to send a
reset pulse to U5, and the cycle
repeats. Standard values for C32 and
www.circuitcellar.com
O
I made an inexpensive R/C receiver
that works well and weighs only 2
grams! Front and back images of it are
shown in Photo 1. I was fortunate to
have first pass success, but certainly
this project can be optimized. I
R
U
M
E
LE
.H
Thus, if the host supplies 5 V and
the receiver draws 20 mA, the voltage
drop across R34 will be 0.2 V and the
receiver IC will operate at 4.8 V. I didn’t know if I would need to use U7b,
so I left it unconnected in the layout.
After I determined that it wasn’t
needed, I jumpered pin 5 to ground
and pins 6 and 7 together, ensuring
that the component wouldn’t oscillate. If it oscillates, it will draw additional current and generate unwanted
noise. A parts list of additional component details is available online.
THE FINAL PRODUCT
.R
[13]
When I finally had the receiver
tuned to my transmitter, and turning
off the transmitter caused the RSSI
voltage to rise, I hooked a servo to the
receiver at U5 pin 2. I verified that
the servo worked properly and it
could be controlled by the joysticks
on the transmitter. A test revealed
that the receiver has a range of about
1000¢! I was able to get it working
with only a DVM and an oscilloscope!
i2
C33 were chosen to result in high
resistance values for R29 and R30,
reducing the current required by U6.
U4 is a 3.3-V regulator used to
power U1 and derive a stable bias
voltage. C29 ensures a stable 3.3-V
supply. R34 and C28 form a low-pass
filter and ensure that any noise on the
host 5-V power supply does not disturb operation of the receiver. R34 is
set at 10 W so that it will result in a
small voltage drop based on the current required by the receiver. The
voltage drop caused by this resistor is:
TUNING
First, I checked pin 5 of U1 with an
oscilloscope to check the frequency.
Next, I added about a 3¢, thin, insulated wire for an antenna. I connected a
digital voltmeter (DVM) to pin 9 of
U1, the received signal strength indicator (RSSI). The lower the voltage at
this pin, the better the receiver is
tuned to a transmitter.
Next, I turned on my R/C transmitter and placed it about 3¢ away. I
slowly adjusted C5 in one direction
until the DVM indicated a voltage dip
and then began rising. I shut off the
transmitter to see if the receiver was
tuned to it or some other RF source,
such as a radio or television station.
If the receiver was tuned to the
transmitter, then the RSSI voltage
would rise when the R/C transmitter
was turned off. If the receiver was
tuned to some other source of RF,
turning my transmitter would have
had little effect on the RSSI voltage.
iU
reference voltage used by comparator
U7a to convert the input signal to a
logic output at pin 3. This voltage is
about midway between the minimum
and maximum voltage swings of the
signal coming from U3a.
Diode U2a allows C24 to charge up
to the maximum signal voltage, and
U2b allows C25 to charge to the minimum signal voltage. R26 and R27
form a voltage divider, producing a
reference voltage midway between the
minimum and maximum signal voltages. C27 helps reduce the ripple on
this reference voltage.
The values of C24, C25, C30, R26,
and R27 are large in order to produce
a long time constant, so that the reference voltage cannot vary quickly.
This makes it stable. This midway
voltage provides a good reference
against which to compare the signal
and yields a consistent and stable
stream of logic pulses.
I included R28 and C31 in the
schematic and layout to filter any
glitches on the clock line. However,
no filtering was required, so I used a
10-W resistor as a jumper for R28 and
C31 wasn’t used.
Now that a clean stream of pulses
has been recovered from the RF signal, it needs to be processed into individual servo control signals by U6 and
U5. U6 resets U5 at the proper time.
A reset pulse from U6 causes output
Q0 of U5 to go high and clears all
other U5 outputs. U6a is configured
such that pin 13 will go low if U7a is
inactive for more than 8.2 ms. The
time delay is given by:
CIRCUIT CELLAR®
Ron Jesme is a corporate research
engineer for 3M Co. His technical
interests include developing products
that involve optics, magnetic, RF, and
analog and digital signal processing.
He holds an M.S. in Electrical
Engineering and is a licensed professional engineer. You can reach him at
ri59@aol.com.
SOFTWARE
An HPGL plot file (micorx.hpg) and
parts list are on the Circuit Cellar
web site. More information is
available at www.tcrobots.org.
SOURCE
TDA7021
Philips Semiconductors
(212) 536-0500
Fax: (212) 536-0559
www.semiconductorsphilips.com
REFERENCES
[1] H.L. Krauss et al, Solid State
Radio Engineering, John Wiley &
Sons, Inc., New York, NY, 1980.
[2] Philips Semiconductors, “FM
Radio Circuits for MTS,” May
1992.
RESOURCES
Philips Semiconductors, “A
Complete FM Radio on a Chip,”
AN192, December 1991.
———, “TDA7000 for Narrowband
FM Reception,” AN193,
December 1991.
Issue 128
March 2001
51
R
U
M
E
ere we are at the
third and final part
of my series about
second-order systems. In
the first part, I introduced the basic
structure of both mechanical and
electrical systems and showed how to
simulate them numerically. In Part 2,
I went through some of the math that
gets you to closed-form solutions,
which allow you to describe the system at higher levels of abstraction.
In Part 3, I’m going to move on to
two additional topics: active implementations and servomechanisms.
Active implementations add gain
using either a transistor or op-amp,
and this frees designers from some of
the constraints of purely passive systems. Servos show up in all kinds of
engineering applications, from phaselocked loops to robotic positioners.
This month, I’ll show how the addition of feedback changes the system
model and how to simulate it numerically. I’ll also talk about some of the
nonideal characteristics of real-world
systems and how to deal with them.
W
W
W
.G
iU
There are plenty of
practical applications
for the information in
the final part of this
MicroSeries on second-order systems, so
pay attention as Dave
jumps into the last
two aspects that he’s
going to cover for
now—servomechanisms and active
implementations.
h
LE
.H
Part 3: Active Systems and Servos
ACTIVE IMPLEMENTATIONS
So far, I’ve only covered passive
mechanical and electrical systems.
The next step is to consider what hap-
52
Issue 128
March 2001
O
Fundamentals of
Second-Order Systems
.R
Dave Tweed
i2
FEATURE
ARTICLE
pens when active circuits (amplifiers)
are added. This allows two things:
First of all, the losses associated with
the resistor can be compensated for,
and secondly, there are techniques
that allow you to dispense with the
sometimes bulky and expensive coil.
One thing I discussed in this series
about second-order systems is that
there’s an integral term and derivative
term of some quantity involved. In
the electrical circuit, that quantity
was current; the capacitor integrated
the current to develop a voltage, and
the inductor produced a voltage proportional to the derivative (rate of
change) of the current.
Integrators and differentiators can
be built out of resistors and capacitors
as well. And, an op-amp can be used
to compensate for the resistive losses
and make such circuits perform in an
ideal way. Figure 1 shows the basic
idea. In each case, the op-amp holds
the center node at virtual ground,
forcing the current in the two components to be the same. In the differentiator, the current in the capacitor is
proportional to the rate of change
(derivative) of VIN. Because VOUT is
proportional to this same current
(because of the resistor in the feedback loop), VOUT is the derivative of
VIN. If VIN is held constant, there is no
current through the capacitor and
therefore VOUT is zero.
In the integrator, the input current
is proportional to VIN, and this current
is made to flow in the capacitor as
well. The only way this can happen is
if the capacitor voltage is the integral
CIRCUIT CELLAR®
a)
VIN
VOUT
–
+
b)
VIN
VOUT
–
+
Figure 1a—A differentiator’s output voltage is proportional to its input current as determined by the capacitor. b—The integrator’s output voltage represents the
integral of the input voltage over time.
www.circuitcellar.com
of the current. Therefore, for a constant VIN, VOUT will rise and fall at a
constant rate.
Figure 2 shows the equivalent of
the original RLC circuit done with opamps. If the input voltage represents
the current in the passive circuit,
then the output of the integrator represents the capacitor voltage, the output of the straight amplifier represents the resistor voltage, and the output of the differentiator represents the
coil voltage. Summing these three
values gives you the total voltage
across all three components.
Note that this circuit has three
intermediate outputs. One is proportional to the input, and the other two
are the integral and derivative of it.
This is where the acronym PID comes
from, Proportional-IntegralDerivative. The circuit can be completely characterized by the three gain
values associated with these terms.
b)
5V
Error Second-order system
signal
Motor 5 V
VERR
VSET
+
–
Error
amplifier
Actual
position
VOUT
–5 V
O
Figure 2—This is a complete analog of the RLC circuit, or mechanical system, done with op-amps. Of
course, a real circuit would use just one.
–5 V
VIN
–5 to 5 V
Figure 3a—A basic electromechanical second-order
system converts a force or acceleration into a physical
position. b—Putting an error feedback mechanism
around this system turns it into a servomechanism.
.R
Differentiator
VOUT
–5 to 5 V
Gear
reduction
i2
Sum
Amplifier
Coil or mass
Motor
This can be solved also to see the
error response relative to the input:
LE
.H
Total voltage
or force
Robot arm
Potentiometer
Assuming that G(w) is a low-pass
sytem, you can sketch a Bode diagram not only of G(w), but also
1/G(w), E(w), and H(w), as shown in
Figure 4. As long as G(w) is larger
than one, E(w) is essentially 1/G(w).
VOUT = G(w) × VERR
Where
G(w) is less than one, E(w)
VOUT = G(w) × (VSET × VOUT)
becomes unity.
The physical interpretation of this
Solve this to get the overall response
is
that below the cutoff frequency, the
of the closed-loop system:
error is small, which means that the
output position follows the control
signal faithfully. However, above the
cutoff frequency, the error is almost
equal to the input signal,
which means that the output
isn’t following the input at
log(gain)
all. The plot of H(w) verifies
Gω
this interpretation; the system transfer function is unity
up to the cutoff point, and
falls off with G(w) thereafter.
1
Hω =
log (frequency)
1
A phase-locked loop (PLL)
1+
Gω
1
is
another type of servomechSystem
Gω
bandwidth
anism, but in this case the
input and output quantities
1
Eω =
1+ 1
are frequencies and the transG ω
fer function H(w) for the PLL
is carefully controlled to get
particular effects. A basic PLL
Figure 4—Given the open-loop response, G(w ), and its inverse, 1/G(w ), it’s
consists of a voltage-coneasy to estimate the closed-loop response, H(w ), and the error function, E(w ).
U
M
Integrator
Resistor or dashpot
a)
W
SERVOMECHANISMS
.G
iU
R
Current or
velocity
depending on the friction in the system and the amount of load on the
end of the arm. Therefore, the motor
is geared down and a potentiometer is
used to measure the actual angle of
the joint.
The motor-gear-pot combination is
a kind of second-order system; the
output voltage of the pot is proportional to position, which is the second
integral of the input voltage, which in
turn is proportional to force (acceleration). It also has friction (resistance)
and inertia (capacitance).
If you compare the output voltage
(actual position) with the control voltage (desired position) by subtracting
them, you get a signal that represents
the difference or error value. If this
error signal is applied to the motor
(with suitable amplification), then the
motor will develop a force that
reduces the error (see Figure 3b).
The transfer function of the openloop system can be described in the
frequency domain as a function of frequency, G(w). There are three voltages
involved, the control voltage (VSET)
output voltage (VOUT) and their difference (VERR). The input to the openloop part is VERR, so write:
E
Capacitor or spring
W
W
A servomechanism is a
device that causes one physical quantity to vary in proportion to another. Feedback
reduces the proportionality
error to acceptable levels.
One example is a joint on a
robotic arm (see Figure 3a),
where the angle of the joint is
supposed to be proportional
to a control voltage. An electric motor is a device whose
mechanical output force is
proportional to the voltage
applied to it. However, it’s
going to need varying
amounts of force (voltage),
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
53
Kfb = 1 V
Ka = 3
O
NONLINEAR FUNCTIONS
There are many kinds of nonlinear
functions in a servomechanism, but
I’ll focus on the most common,
including limits, deadbands, and
LE
.H
The change in speed of the system
in one time-step is the net torque
divided by the moment of inertia.
Take a look at Equation a to see this
as an expression.
The feedback potentiometer generates a voltage that’s proportional to
the output position (in radians), and
an amplifier is used to amplify the
error signal:
.R
Kmom = 0.001 kg × m2
The simulation updates the velocity
and position of the system based on
the previous values and the value of
the drive signal (see Equation b).
Figure 6 shows the results. The
drive signal consists of a step function
followed by a ramp function, followed
by a sine wave of increasing frequency. The system response follows the
drive signal faithfully except for a
small amount of overshoot on the
step function.
i2
Finally, the mass of the system (primarily the motor armature, because it
turns fastest) creates a moment of
inertia that resists acceleration:
R
b)
U
M
E
a)
iU
trolled oscillator, a phase comparator
to compare the oscillator’s output to
an input reference signal, and a lowpass filter that turns the output of the
phase comparator into a voltage that
adjusts the oscillator frequency (see
Figure 5a).
For example, to demodulate an FM
broadcast signal as shown in Figure
5b, the PLL is made to be wideband—
wide enough to pass the audio signals.
This way, the output frequency closely tracks the input frequency, and the
VCO control voltage is a nearly exact
copy of the original audio modulation
applied at the transmitter.
On the other hand, the stereo
decoder uses a narrowband PLL to
regenerate the 38-kHz sub-carrier for
the L – R difference signal from the
19-kHz pilot tone. A narrow bandwidth makes this PLL more immune
to the nearby audio sidebands, both
below (L + R signal) and above (L – R
signal). Even a tiny amount of phase
error (as little as 3°) in the output of
this PLL can drastically reduce stereo
separation (to only 20 dB or so).
Narrowband PLLs also are used to
recover timing signals from AES/EBU
or S/PDIF signals in digital audio
equipment. You should keep in mind,
any frequency error or noise in the
recovered clock signal directly affects
the quality of the audio in a D/A converter. For example, a timing error of
just 5 ns in a clock edge can produce
as much noise as a 1-LSB error in a
16-bit, 1-kHz tone.
Simulating the servomechanism in
the time domain is not difficult, and
the robot mechanism in Figure 3 is a
good example to use. The motor and
gear train have several key characteristics you need to take into account.
Let’s review them. First, there is a
scaling constant that represents how
much raw torque is developed for a
given input voltage:
d)
W
W
W
.G
c)
e)
Next, there is a certain amount of
counter torque generated by frictional
losses; this is proportional to the
velocity (revolutions per minute):
54
Issue 128
March 2001
Equations a through e—Take a look at these simulation equations.
CIRCUIT CELLAR®
www.circuitcellar.com
0
7
8
9
10
W
0
6
W
–1.0
1.0
5
W
1
2
3
4
Time (seconds)
.G
iU
R
U
M
E
LE
.H
i2
.R
O
quantizers. Limits, deadA deadband is, in a sense,
a)
bands, and quantizers can be
the
opposite of a limit (see
Phase
Amplifier and
comparator
loop filter
VCO
characterized by how they
Figure 8a). There’s a section
look on a graph (see Figures
in the middle in which the
fOUT
fIN
7a, 8a, and 9a). Figure 7a
output quantity on the vertishows a limit condition,
cal axis does not change for a
which has a linear portion in
certain range of the input
b)
the center. However, as the
quantity. Outside this range,
Low-pass filter
PLL #1
0–15 kHz
input variable exceeds cerboth quantities change
L+R
Sum
tain values to the left and
together as expected.
IFIN
Left
right, the output variable
A variation of this is an
Band-pass filter Balanced
modulator
stops changing. The gain of
output
quantity that doesn’t
23–53 kHz
Composite
stereo signal
this section effectively
change
for a bit whenever the
Right
becomes zero, which can
input
changes
direction. This
L–R
Difference
Band-pass filter
38 kHz
have drastic effects on the
is
known
as
hysteresis
or
19 kHz
overall operation or stability
backlash and is indicated by
of the system.
the dotted lines in Figure 8a.
PLL #2
Keep in mind that limits
Note that pre-loading the gear
come in many forms. They
train with springs sometimes
Figure 5a—The PLL is a servomechanism that controls one frequency with
may be limits of the robot
can eliminate backlash in
respect to another. b—An FM stereo receiver uses two PLLs, one to do the
joint’s physical range, limits
gear systems.
basic demodulation and another to decode the two stereo channels.
of the voltage available to
A deadband is modeled
control the VCO in a PLL, or more
using a similar technique; the paramThe easiest way to model nonlinear
subtle limits such as a maximum
eter, wid, is half the width of the
functions is to approximate them
velocity of a motor drive.
deadband region and ctr is its central
with linear segments; all this requires
In most cases, limits are inherent in
value:
is the ability to write expressions that
the system’s design, and it is difficult
have different values for different
or impossible to remove them. The
deadband (x, ctr, wid) = [x > ctr + wid,
ranges of a control variable. In
trick is to learn to live within the
x – wid, if (x <ctr – wid, x + wid, ctr)]
Mathcad and most spreadsheets, this
limits, which is most easily done by
is accomplished using a function that
modeling the limits accurately and
looks like:
then verifying that the system simua)
Output
lation remains stable under all conif (boolean, value1, value2)
ceivable conditions.
The result is value1 if the boolean is
true, or value2 otherwise. Two of
Input
these are used to create a limit func1.0
tion:
–1.0
1.0
0
–1.0
Figure 6—The response of a linear system follows the
control input faithfully. The top trace shows the original
control signal, the middle trace shows the resulting
output position, and the bottom trace shows the difference between the first two, or the error signal.
www.circuitcellar.com
limit (x, low, high) = if[x < low, low,
if(x > high, high, x)]
b)1.0
The simulation can be updated to
incorporate a velocity limit as shown
in Equation c.
Figure 7b shows a simulation of
this system. You can see that it has
trouble following fast-changing
inputs; the output position becomes a
ramp when pushed too hard.
There isn’t too much you can do to
fix limit conditions, they are usually
inherent in the basic system design.
Therefore, it’s mainly important to be
aware of their overall effects on the
system and to adjust the system
parameters to avoid hitting the limits
whenever possible.
CIRCUIT CELLAR®
0
1
2
3
4
Time (seconds)
5
6
7
8
9
10
–1.0
1.0
0
–1.0
Figure 7a—A limit transfer function can't go below or
above certain values. b—The response of a system
containing a velocity limit becomes a ramp when
pushed too hard. The top trace shows the original control signal (dotted line) and the system response (solid
line) superimposed, and the bottom trace shows the
error signal.
Issue 128
March 2001
55
Dynamic Allocation Program Memory
A 16K x 16 (32K x 8) block of 20ns SRAM
is provided for program instruction storage.
If not all 32K is required, it may be partitioned
during design development into 4K x 8 blocks
to provide additional data memory.
AVR ® 8-Bit RISC Microcontroller
runs at up to 40 MHz with throughput
approaching 1MIPS/MHz. With this kind
of performance, the AVR processor core
provides the flexibility you need to optimize
power consumption versus processing speed.
8 x 8 Hardware
R
Built-in Peripherals
Two external user ports
• 16-bit timer counter
• Two 8-bit timer counters
• Watchdog timer
• Two UARTs
• Interrupt controller
• Serial 2-wire interface
• Internal clock oscillators
U
M
E
LE
.H
i2
.R
O
Multiplication Accelerator
Enables AVR microcontroller
to perform complex DSP
operations quickly and
efficiently.
W
W
.G
iU
•
W
AT40K FPGA with FreeRAM
• 10K-40K programmable gates for custom
logic and programmable peripherals
• Flexible architecture for efficient DSP
and HDL based designs
• Discrete 32 x 4 dual port SRAM blocks
located throughout the AT40K array
• Dynamically reconfigurable in-system
from the AVR microcontroller
Discrete FreeRAM™
10ns single/dual port SRAM blocks are located at the
corners of each 4 x 4 cell sector. Placing these SRAM
blocks throughout the array puts memory where it’s
needed, resulting in minimal impact on bus resources.
FreeRAM, System Designer and the Atmel name and logo are trademarks of Atmel Corporation in the USA and other countries.
Other terms and product names in this document may be trademarks of others. Co-verification powered by Mentor Graphics ®
© Atmel Corporation 2000.
Atmel’s System Designer
FPGA IDS
™
C O -VER I F I C A T I O N
HDL Entry
HDLPlanner
AVR Studio™
Code Entry
Functional
Co-Verification
HDL Synthesis
Waveform
Viewer
Debugger
Technology
Mapping
Back-Annotated
Co-Verification
Place & Route
Waveform
Viewer
Bitstream
Dedicated 4K x 8 Data Memory Blocks
may be increased by adding partitions
from program memory.
AVR
Programming
Code
.R
BITSTREAM
GENERATION
O
F P S L IC
PROGRAMMING
U T IL IT IE S
R
U
M
E
LE
.H
i2
Atmel’s new System Designer ™ software is the tool that really
puts SOC design on your PC. It manages the interface
between design entry, synthesis, APR, compiler simulation
and bitstream generation, plus provides a co-verification
backplane on which the HDL hardware simulator and AVR
software debugger can interact. What’s more, it’s fast,
intuitive and easy to learn.
W
.G
iU
It’s Here! It’s Now!
It’s FPSLIC !
™
W
W
It’s the World’s First RISC-based
Field Programmable System
Level Integrated Circuit.
Not just a mere promise, it’s a reality. Atmel’s new
FPSLIC gives you the flexibility you need for compact, high
speed, low power designs, plus gets you to market faster
than discretes. And Atmel’s powerful System Designer ™
software lets you simultaneously develop both the system
hardware and software for even faster time-to-market.
Go to www.atmel.com/ad/fpslic01.html for more about the
world’s first FPSLIC.
www.atmel.com
e-mail: literature@atmel.com
FAX-ON-DEMAND:
(800) 292-8635 (North America)
(408) 441-0732 (International)
CORPORATE HEADQUARTERS:
TEL: (408) 441-0311
FAX: (408) 487-2600
O
.R
i2
W
W
W
.G
iU
R
U
M
E
LE
.H
Interactive Image www.electronicsworkbench.com
a)
.G
W
Input
W
b)
0
W
1.0
1
2
3
4
Time (seconds)
–1.0
5
6
7
8
9
10
1.0
0
–1.0
Figure 9a—A quantizer creates a stair-step transfer
function, which is similar to having a whole sequence
of deadbands. b—A system that uses a coarse quantizer to drive the motor with discrete voltages has trouble following the control signal accurately.
www.circuitcellar.com
Output
Input
b)
O
1.0
0
5
6
7
8
9
10
.R
1
2
3
4
Time (seconds)
–1.0
1.0
LE
.H
0
U
M
E
The step size step can be any value.
For example, when modeling an 8-bit
DAC that runs from 0 to 5 V, you use
Suppose the motor in the robot
arm is driven by a digital driver that
has coarse steps. The simulation
would be modified as shown in
Equation e.
Figure 9b shows the results of this
simulation. The output position has
trouble following the control input
closely. You can compensate the
effects of quantization by adding a
dither signal whose peak-to-peak
amplitude is equal to the quantizer
step size to the value being quantized.
The dither signal can be random or
periodic (sawtooth or triangle wave),
as long as its frequency components
lie outside the bandwidth of the system.
iU
Output
a)
i2
quantization in the voltage or current
domain. Another type of quantization
in the time domain is introduced
whenever a counter is used to divide a
frequency. If the counter’s output frequency is outside the system’s bandwidth, the quantization effects usually can be ignored and the whole thing
can be treated linearly. But, if the
counter’s output frequency falls within the system bandwidth, it may need
to be considered in terms of the error
it introduces into the system and
what it may do to system stability.
Quantization effects are modeled
using the int() or floor() function:
R
A hysteresis function is similar,
except that now the central value
moves with the output. This requires
a state variable, because now the output value is a function of both its own
history as well as the current input
value. The same basic deadband function is used, but the simulation equations must save the output value of
the function and pass it back in as the
ctr value for the next iteration.
If the robot joint has backlash in its
gear train, you need to keep track of
the input and output positions independently. The simulation equations
will look like Equation d.
Figure 8b shows the simulation of
this system. Note the extra glitch that
occurs every time the motor changes
direction. You can compensate for a
deadband by using a PID controller,
which takes into account the integral
and derivative of the error signal as
well as the error. A delay compensation constant is added to or subtracted
from the derivative term.
The final type of nonlinear function
that crops up, particularly in digital
systems, is quantization. An A/D or
D/A converter generates one type of
KEEP GOING
Whew! That’s a lot of material, and
we’ve only just begun to see some of
the complexities that lie beneath the
surface of second-order systems.
There are several topics that I’ve
brushed against without going into
detail. These include the effects of
gain in the system and what that
means for stability, what a PID conCIRCUIT CELLAR®
–1.0
Figure 8a—A deadband creates a flat spot in the
transfer function, which can move up and down in
some cases. b—A system containing hysteresis in the
form of gear backlash experiences glitches whenever
the motor reverses direction.
troller is and how to configure it optimally, and the effects of time delays
in the processing.
I encourage you to download the
Mathcad simulations and experiment
with these extensively. For real fun,
try combinations of different nonlinear functions in the same simulation.
If I get enough positive feedback from
you readers (pun intended!), I’ll delve
into these topics at a later date. I
Dave Tweed is an independent consultant. He has been developing hardware and real-time software for
microprocessors for many years. His
system design experience includes
computer design from supercomputers to workstations, digital telecommunications systems, and the application of embedded microcomputers
and DSPs. You may reach him at
dtweed@acm.org.
SOURCE
Mathcad
Mathsoft, Inc.
(617) 577-1017
Fax: (617) 577-8829
www.mathsoft.com
Issue 128
March 2001
59
EMBEDDED
LIVING
Mike Baptiste
I may have an extreme setup, but
my home’s LAN is essential. We currently have six computers and a laser
printer, plus a completely separate
network connected to my remote
business LAN—two PCs for the children, my Athlon-based desktop, a laptop, an NT backup/print server, and a
Linux file/web server. Using central
file servers has been wonderful
because it makes it easier to back up
the data. I won’t bother getting into
why I have backups done on a server
that isn’t my file server.
This is all connected to a 100-Mbps,
eight-port switch. Network equipment prices are still falling dramatically. Today you can get an eight-port,
100BaseT switch for under $150! A
switch is better than a hub because it
creates virtual connections directly
between two connected devices,
avoiding most packet collisions with
other network traffic. In the past, they
cost hundreds of dollars.
In November, I bought a new laptop
because I need it for trade shows.
And, I also like the added bonus of
sitting on the couch by the fire to
write my Circuit Cellar column.
But, running Ethernet to my couch
seemed ridiculous. Besides, what if I
wanted to write my colum in bed? In
late 1999, I oversaw the deployment
of a wireless LAN in a large R&D lab
and knew I needed one. Wireless
LANs are great. You can plug a simple
PCMCIA card into your laptop (or
some PDAs) and access your LAN
from hundreds of feet away. Now that
I have a laptop, a wireless LAN would
be a dream come true.
The biggest problem for a home
user back then was cost. Access
points, the radios that actually connect to your LAN and talk with
remote wireless cards, cost well over
$1000. The wireless cards were at
least $250, well out of reach for the
average home user.
What a difference a year makes!
Access points can now be found for
less than $250 and wireless cards are
less than $100. Wireless equipment is
quickly approaching commodity status. With prices this low, in-home
wireless LANs make sense.
R
U
M
E
here was a time
when the term
“home automation”
meant just that: automating various systems in your home to
make life easier. Over time, the term
has moved from focusing on automating systems, to connecting almost
everything in your home.
This shift has been made clear by
recent events. For instance, home
automation trade shows seem to have
more networking and cable system
booths than vendors for actual home
automation systems. Moreover, the
Home Automation Association (HAA)
is now called the Home Automation
and Networking Association (HANA).
This is not a bad thing. If you
believe some folks, HA will require
the use of an at-home LAN because
all automation functions will live in
your DSL or cable modem home gateway. Even if HA doesn’t need such a
requirement, having a LAN in your
house makes things much easier if
you have more than one computer.
And now, I’m going to step outside
of the HA control arena and concentrate on a subject related to home networking. Don’t worry, I’m not going
to explain how to wire an Ethernet
jack or anything along those lines!
W
W
W
.G
iU
Home automation has
evolved to include a
lot more than just
lighting control, but
that’s only because
home-control technology has evolved to
require more interaction and networking
among devices. This
month, Mike shows
us how to wire it all
up, minus the wire.
t
LE
.H
i2
.R
O
Wire is Passé
WIRES? WHAT WIRES?
60
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
U
M
E
.G
W
W
W
www.circuitcellar.com
O
LE
.H
Wireless LANs operate in the 2.4GHz band, the same band used by
gigaphones, wireless video senders,
cameras, and Bluetooth. (I’m saving
this for later.) Most access points and
cards auto-hop around 14 frequencies
to find the one with the best integrity.
Wireless LANs can reach hundreds
of feet. The location of the access
point makes a big difference. But an
access point should be able to cover
most moderate-sized homes and even
some larger homes.
Each access point creates a “cloud”
where devices can access the LAN.
Multiple access points can be used to
make a bigger cloud. As you move
from one AP’s cloud to another, a network card negotiates with a new AP
and switches to it without dropping
existing network connections.
As you get farther away from the
AP cloud or if there is outside interference, the signal integrity deteriorates. When this happens, 802.11b
units downshift to a slower data rate
to improve signal integrity. The steps
down are 11, 5.5, 2, and 1 Mbps.
Normally, this change in speed is
done transparently, but if you experience problems at 11 Mbps, you can
configure the radios to stay in a slower range (1 to 5.5 Mbps).
To your PC, the wireless card looks
like a regular NIC card configured in
the same way. If you need to frequently remove the wireless PCMCIA card,
I recommend moving to Windows
2000 because it can handle this on the
fly. Windows 9x doesn’t like to see
network devices go away, especially if
you have drives mounted!
Most access points look like they
have rabbit ears because they have
two antennas. These are called diversity antennas and can be aligned in
various ways to improve reception
from different areas. Some vendors
also sell specialized (expensive) antennas, which can extend the range of an
access point by a few kilometers!
There are no wires, so installation
should be a snap, right? Not so fast.
First, the AP needs power. Although
some of the more expensive units
carry power over the Ethernet cable
and allow the power pack to be located far away from the AP, most require
AC power within 6¢ of the AP.
Obviously, you will need LAN access
for the AP as well.
Locating your AP is an acquired art.
Most vendors recommend mounting
them on a ceiling to avoid floor
obstructions, but mounting them near
the ceiling is fine. Locate the AP near
the center of the rooms that are likely
to need wireless access.
For the average two-floor home,
mounting it near or on the ceiling of
the first floor in the middle of the
floor plan is best. Closets work, but
the closet walls will affect your first
floor access. Often, a hallway ceiling
or wall is better. The trick is getting
LAN and the power there.
This is where software becomes an
issue. Make sure your PCMCIA card
vendor provides signal strength tools.
Then, temporarily mount your AP in
various spots and walk around your
house with a laptop to measure signal
strength. This is tedious, but it’s the
only way to find the best location.
Also, if you plan to use a PCI-based
wireless NIC, remember that it will
use the same tiny antenna and that
antenna will probably be located
under your desk, facing the wall,
behind your computer, wedged
between a box of old TRS-80 floppies
and your UPS. You may need to sacrifice access in the guest bedroom to
get your upstairs desktop online.
Installing the wireless NIC cards is
like installing a regular NIC card. Just
download the latest drivers and install
them. Configure the card like a NIC,
using the same settings for DHCP,
gateways, DNS servers, and so forth.
.R
BUT, HOW DO THEY WORK?
INSTALLING THE EQUIPMENT
i2
less PCI card. Today, most manufacturers simply sell you a PCI card with
a PCMCIA slot in back along with a
regular PCMCIA wireless card. Smart
manufacturing!
iU
Your basic wireless LAN requires
one or more access points (APs) connected to a wired LAN. Remote
devices use wireless cards or hubs to
communicate with the access points
and, thus, the wired LAN.
Most wireless LAN equipment sold
today is rated at 11 Mbps, which really means that they have a data
throughput of about 5 or 6 Mbps. The
majority use Lucent or Intersil
chipsets, which adhere to the 802.11b
standard. 802.11b requires 11 Mbps at
a distance of up to 100 meters.
Many vendors get the boards directly from these vendors, so cards of different prices may use the same hardware! Some APs priced at $1000 will
get you a higher throughput and more
simultaneous connections than $250
APs, but for home use the difference
doesn’t justify the extra cost.
The other difference, which may or
may not justify the price variation, is
usually in the software drivers. Some
companies only support Windows and
others support Linux, handhelds, and
more. Some vendors also have drivers
with tools that allow you to monitor
signal strength, integrity, and so on.
Some APs require you to use a serial port to configure them and others
have built-in web servers. So, before
choosing a system, be sure to investigate what you’ll be getting for your
money. There’s also a certification
program to ensure that equipment
from multiple vendors can communicate. Right now, I’m using a 3Com
PCMCIA card to talk with a Cisco
and Linksys AP. Equipment that is
tested to ensure interoperability will
be WiFi-certified.
If you plan to buy from different
vendors, poke around Usenet to see if
anyone has complained about vendor
A working with vendor B. In theory,
all 802.11b WiFi-certified equipment
should be interoperable. Currently,
I’m using equipment from Cisco,
3Com, and Linksys and they work
well together.
Wireless LANs are not just for laptops and handhelds. Running new
wire through some houses is difficult.
If you can’t get CAT 5 cable to your
desktop upstairs, you can get a wire-
R
THE BASICS
CIRCUIT CELLAR®
CONFIGURATION
Most wireless APs have tons of configuration options, too many to cover
in detail here. Read the manual thoroughly to make sure you understand
the options, because one change in
setting can drastically reduce the
Issue 128
March 2001
61
.G
W
W
W
62
Issue 128
March 2001
THE FUTURE
i2
.R
O
Companies are currently working
on next-generation wireless gear,
which will operate at 5 GHz.
Although this equipment will provide
higher bandwidth, it will be more
expensive, have a shorter range, and
use more power.
The beauty of wireless is that it can
easily grow with you. As you can see,
wireless networking can have a wonderful effect on how you use your
computer at home. With prices like
these, how can you afford not to
install wireless? It opens up the possibilities. Enjoy! I
Mike Baptists earned a B.S. in
Computer Systems Engineering from
Rensselaer in 1992. After a seven-year
hiatus working for a large telecomunications company, he returned to his
roots working with embedded processors in home automation. He can be
reached at baptiste@cc-concepts.com.
E
LE
.H
One drawback of 802.11b networking is that is uses the 2.4-GHz band,
which anyone or anything can use. If
you have any of those wireless cameras from X10, you’ll probably notice
white lines scrolling through the
image when your turn on an AP.
Panasonic and Siemens gigaphones
use 2.4 GHz and can cause degraded
802.11b data rates. As more 2.4-GHz
devices come out, interference will
probably get worse. However, future
firmware releases and next-generation
hardware should take that into
account.
There has been a lot of excitement
(and hype) surrounding Bluetooth.
This technology is viewed as shortrange wireless technology for everything from PDAs and computer
peripherals to appliances. The problem is that it uses 2.4 GHz as well.
A recent article written by Andy
Dornon in another publication reported that data rates can drop to 1 Mbps
at only 20 meters when Bluetooth
devices are in use. [1] Many companies with 802.11b networks have
already banned Bluetooth devices
from their premises. This is interesting because Bluetooth devices are not
yet readily available.
This problem could kill Bluetooth,
but companies are working on solutions to combine Bluetooth and
802.11b processors in a single chip.
This will allow transmissions for the
different networks to be coordinated
to prevent interference.
iU
Wireless networks by default are
insecure. It’s trivial to sniff the packets sent between the AP and the wireless cards. APs can transmit over
1000¢, which means your data is available quite a distance away. The distance issue becomes a problem if your
neighbors get a wireless LAN.
How do you keep your data separate?
The first line of defense is the SSID.
This ID is like a password to your
network. You set the SSID in the AP
configuration. Any wireless card that
needs to access an AP must have a
matching SSID configured. However,
the SSID does not prevent someone
from sniffing your wireless packets (or
the SSID, for that matter).
To combat this, 802.11b units use a
technology called Wired Equivalent
Privacy (WEP). WEP will encrypt all
data moving between APs and remote
wireless cards to protect your data
from being sniffed. If you have neighbors nearby, I recommend enabling
WEP. You don’t want your neighbor’s
teenager intercepting data from your
Money or Quicken data file!
First, make sure the equipment you
buy supports WEP. Most new equipment does, but some older cards and
APs do not and will require a
THE BAD NEWS
U
M
SECURITY
firmware upgrade. Second, be ready to
accept slower speeds. WEP adds overhead to the data being sent and also
places a higher load on the AP and
wireless card processors. When you
enable WEP, your data rate will automatically drop to 2 Mbps. For most
people, this shouldn’t be a big deal.
Getting WEP up and running is fairly simple. You select a hex key and
store it on the AP and then configure
each wireless card to use that hex
key. Newer equipment and firmware
releases are making WEP configuration easier, but for now you must
manually configure each node with
the hex key.
R
throughput or, even worse, bring
down your whole wireless network.
Use the auto frequency setting
unless you know there is interference
on a certain part of the band. Enable
the diversity antennas if you have
them. Disable vendor-specific extensions if you use equipment from multiple vendors. I recommend using
CCK modulation and RFC1042 encapsulation for compatibility.
You can use DHCP through wireless access points. However, one thing
to consider is the lease time. If the
wireless link drops and you lose your
lease, you’ll need to manually renew
the DHCP lease on most operating
systems. I use DHCP for my laptop,
but you may want to try static
addresses for your access point.
Well, you’re almost ready to go
online without wires. However, there
is one remaining setting you have to
configure, the SSID.
CIRCUIT CELLAR®
SOURCES
Bluetooth
Atmel Corporation
(408) 441-0311
Fax: (408) 487-2600
www.atmel.com
PCMCIA
3Com Corp.
(800) 638-3266
(408) 326-5000
Fax: (408) 326-5001
www.3com.com
Access point
Cisco Systems, Inc.
(800) 553-6387
(408) 526-7208
www.cisco.com
Linksys
(800) 546-5797
(949) 261-1288
Fax: (949) 261-8868
www.linksys.com
REFERENCE
Andy Dornan,“Emerging
Technology: Can Bluetooth Sink
its Teeth into Networking?”
Network Magazine, November
2000,www.networkmagazine.com
/article/NMG20001103S0002.
www.circuitcellar.com
Motorola’s industry-leading 8-bit Flash
microcontroller—in volume, today.
The 68HC08 high-performance family of 8-bit microcontrollers is
shipping in volume now. Ultra-fast Flash in-circuit programming
means you can replace your OTP and ROM devices cost-effectively.
Features and Benefits
It also allows you to change your code on the fly.
This is a comprehensive solution that includes chips, systems,
software and development tools, that will help speed your design
to market. With this solution, Motorola is extending its long-held
• Large and rapidly growing family of
Flash 8-bit microcontrollers
• Reduced production and
programming costs through
ultra-fast Flash programming
• Write/erase cycle of 10,000 across
full temperature range
leadership in embedded Flash technology.
• Combined program and data space
memory can be programmed one
byte at a time
AZ60
• Flash programming across the
68HC08’s full operating supply voltage
AS60
Increasing Integration
MR32
GP20
• Flexible block protection and security
MR16
GP32
• Simplified programming interface
through Flashwire single-wire mode
AB32
JB8
KX8
MR8
SR12
GR8
GR4
JL3
JK3
KX2
JK1
RK2
In Volume
Production
Q4 00
Q1 01
The 68HC08 family members are available with a variety of on-board peripherals, memory
sizes and types, and package types.
For more information, call your Motorola sales
representative or authorized distributor today,
or visit www.motorola.com/mcu
© 2001 Motorola, Inc. All rights reserved. Printed in the U.S.A. MOTOROLA, the Stylized M Logo and all
other trademarks indicated as such herein are trademarks of Motorola, Inc. ® Reg. U.S. Pat. &Tm. Off.
• Supports user mode reprogramming
through serial ports
• Rapidly growing software library
• Free downloadable autocode generator
• Free downloadable integrated
development environment
including simulator
• Low cost hardware evaluation tools
Embedded controllers with an atti
With over 250,000 controllers in the marketplace, Micromint has been providing innovative,
turn-key solutions to the OEM market for over twenty years - from design through production, as
well as packaging and shipping the final product. Our broad line of embedded controllers and
turn-key solutions can turn your imagination into reality.
NOUVEAU PC
COMPACTFLASH INTERFACE MODULE
The VL-CFA-1 is a CompactFlash
interface that allows Type I and Type
II CompactFlash modules to be used
with any system that includes a standard IDE (hard drive) connector. This
solid-state storage medium with no
moving parts is ideal for program and
data storage in embedded and rugged
applications.
Type II modules include the IBM
Microdrive, a tiny hard drive available
in capacities from 340 MB to 1 GB.
Type II compatibility also allows
the use of larger capacity flash
memory modules. Type II modules
are similar to Type I, but are about
0.2² thick.
After the adapter is in place, the
2.6² × 2.7² CompactFlash or
Microdrive module emulates a
standard disk drive. Neither drivers
nor operating system support is
needed. The VL-CFA-1 is fully
compatible with any operating sys-
Edited by Harv Weiner
tem that can access a disk drive. The
plug-in module can be the system
boot device and contain the operating
system, application program, and
application data.
An 18² cable between the system
and adapter board allows the adapter
to be mounted to a front-panel slot or
other easily accessible location.
Remote access allows the module to
be easily removed or changed in the
system, which is ideal for field diag-
nostics or system software
upgrades.
The remote access capability
extends to systems running larger
operating systems such as
Windows, because a plug-in
Microdrive module (physical hard
drive) can be used in the adapter.
The Microdrive modules are available in the larger storage capacities
required for these operating systems.
The VL-CFA-1 is available in
versions to interface with 40-pin,
0.1 4² IDE connectors and 44-pin,
2-mm IDE connectors. It costs
$70 in 100-unit quantities
VersaLogic Corp.
(541) 485-8575
Fax: (541) 485-5712
www.versalogic.com
Preinstalled DOS & Web Server
Socket to accept M-Systems DiskOnChip
l
386EX, 25MHz, 512K Flash, 512K RAM
l
10Base-T Ethernet
l
In-Circuit-Programmable Xilinx CPLD
l
TCP/IP & Flash File System
l
l
Price
PriceStarting
startingat
at
$229
$229qty
qty100
100
Dev Kits available
l
46 Digital I/O Lines
-l Xilinx
5V DCCPLD
Power
-l 5V
DC /Calender
Power
Clock
-l Clock/Calender
RS232, RS485
-l RS232,
RS485
Dimensions
4.2" x 3.6"
- Dimensions 4.2" x 3.6"
Call 530-297-6073 Fax 530-297-6074
www.jkmicro.com/logicflex
JK microsystems
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
65
EPC
Applied PCs
Fred Eady
Launching E-Mail
Only in politics is
appearance more
important than functionality, so this month
Fred takes a look at
how complex the
process that most of
us refer to as “just
sending e-mail” can
be. Beneath the skin of
any device that sends
e-mail is a bundle of
working-class beauty.
66
Issue 128
March 2001
l
iving in Florida
close to Kennedy
Space Center has its
advantages. Just the other
day I was sitting in the backyard taking a break from writing my column
when the Orbiter that is stacked on
top of its specially modified mother
ship did a low-level flyby for civilians.
I immediately flashed back to the late
’60s. For the space program, those
were the days. The sight of those two
massive airplanes also took me back
to the late ’80s when I was an “engineer” at the Cape. I used to see the
spacecraft up close and personal on a
daily basis. At close range, only a
mother could love it, as I think it
resembles an ugly bird. Beauty is in
the eye of the beholder, and although
I may think a Gulfstream is prettier,
the Orbiter delivers the mail.
If the Internet is of interest to you
(as it is to most), these are the days.
Electronic manufacturers are striving
to make the Internet experience as
easy and enjoyable as possible for anyone who wants to take the journey.
Although the Internet is a place to
chat, shop, and send e-mail, it’s also a
great way to exchange data between
nonhuman entities like embedded
Internet devices. Sometimes bits and
CIRCUIT CELLAR®
bytes alone between machines is not
the answer. The remote Internet-capable embedded device must be able to
speak a human language. For
instance, if a vending machine has its
coin box violated, the crooks may not
be aware that the vending machine is
“smart.” So, fortunately they wouldn’t think to bash it to pieces before
absconding with the cash. Seeing the
coin box door open, the Internet-capable vending machine picks up the
phone and calls the local ISP. The
vending machine’s not calling for
help, it’s calling to send a note home
to notify the boss that somebody
swiped the loot.
I’m not going to concentrate on
devices like vending machines this
time around. Instead, I’m going to
describe a mother ship evaluation
board and the electronic marvel that
rides on it. I’m also going to show you
how to use it out of the box and in
your applications.
INSTANT E-MAIL
To send even the simplest e-mail
messages, you would require an email creation program, TCP/IP stack,
point-to-point protocol (PPP) driver,
password authentication protocol
(PAP) driver, simple mail transfer protocol (SMTP) driver, serial interface,
modem, communications medium (a
telephone line), and a mail account
with an ISP.
I may have left something out, but
you get the idea. That’s a lot of stuff
just to send notes back and forth.
Fortunately, most of the mail process
is hidden by clever software behind
easy-to-use graphical interfaces.
Unfortunately, if you want to roll
your own e-mail engine using embed-
Photo 1—I was tempted to fill in some of these pads,
but I figured if there were more goodies to be added, I
didn’t want to miss the party.
www.circuitcellar.com
Autonomous mode, the CH2156
iModem uses an extension of the
standard Hayes AT command set. The
Cermetek folks call this iNet AT.
Technically, the CH2156 iModem
never operates without microprocessor control. In fact, the modem and
the rest of its family members are
industrial grade high-speed modem
modules coupled with an on-module
controller. This combination of
modem and microprocessor allows
the CH2156 iModem to house all of
the firmware and algorithms necessary to implement TCP, IP, PPP, PAP,
SMTP, and POP3 Internet protocols.
So, that takes care of all the parts
on your shopping list except an e-mail
creation program, communications
medium, and mail account with ISP.
Well, if you don’t need the mail
stuff, the CH2156 iModem is a great
little 56K V.90 modem that can be
dialed into and reconfigured remotely.
All you need is a valid ISP account to
start using the CH2156 iModem.
Don’t have an ISP account? No
worries. The CH2156 iModem comes
programmed with an interim ISP
account ID and password you can use
while you’re waiting for your own.
And, the FCC is already taken care of,
so you can use the CH2156 iModem
without having to worry about
whether or not you’re going to be able
to get FCC Part 68 approval.
CIRCUIT CELLAR®
Issue 128
CH2156 IMODEM INTERNALS
Using Figure 1 as a reference should
help as I describe what’s inside the
cube known as the CH2156 iModem.
First of all, ignore the extended memPhoto 2—Very unassuming, but very powerful.
ory box because the CH2156 iModem
does not include it. This memory is
ded technology, you must know how
for other Cermetek iModems that
to manipulate all of the hardware and
have the capability of sending and
drivers in the aforementioned list.
receiving longer e-mail messages.
Let’s face it, most of you reading
Let’s begin with full autonomous
this column are aspiring or seasoned
operation. A 10-ms TTL low pulse to
professionals. Yes, it is possible to
the Send E-mail control pin causes
build such an e-mail engine from offthe CH2156 iModem to send an ethe-shelf silicon with some homemail using the internal default
brewed software drivers, but if you’re
Internet configuration profile. You
already in the professional ranks, usucan modify this profile if the CH2156
ally, time is of the essence. So,
iModem is to be used in this isolated
instead of taking days to collect parts
configuration. The RS-232 interface
and weeks to develop the code, you
isn’t required in this mode either.
turn to evaluation kits like the one
Semiautonomous control requires
from Cermetek.
the RS-232 interface because the host
The Cermetek Microelectronics
processor must kick off the e-mail
GP20 evaluation board in Photo 1 is
transmission with an iNet AT comcapable of hosting any of the
mand. @TD sends and @TG receives
Cermetek embedded modem mode-mail. The internal configuration
ules. Because I’m interested in sendprofile that resides in the CH2156
ing and receiving e-mail with embediModem is used just
ded microprocessors, the
uP
like it’s used in Full
GP20 is loaded with the
Network
Autonomous mode.
Cermetek CH2156
protocols
The modem is sendiModem (see Photo 2).
POP3 SMTP
Send E-mail
Input
only, so the @TG comLet’s take the bullets one
Extended
sense
Flash
Input 1
TCP
RAM
mand has no effect.
by one and see if the
and
ROM
32K × 8
Input 2
output
Of course, the exterCermetek CH2156
IP
pins
E-mail accept
nal Host-controlled
iModem can help send
PPP
mode needs the RS-232
some embedded e-mail.
interface and a host
There are two ways the
microcontroller because
CH2156 iModem is
Tip
the iNet AT commands
prompted to send e-mail,
HS modem
must flow between the
RXD
on demand and event-trigError correcting
Modem
RTS
data compression
control
host and the CH2156
gered. Three modes conSerial
DCD
interface
DSR
iModem for e-mail to
trol the modem, Full
V.24
RI
PSTN
NVRAM
EIA-232-E
be sent. In this mode,
Autonomous,
CTS
or UART
TXD
the host processor feeds
Semiautonomous, and
DTR
Serial
the CH2156 iModem
Host-controlled.
Modulation
Telephone line
interface
demodulation
interface
Ring
all of the necessary
and buffer
In Full Autonomous
information needed to
mode, the CH2156
make the e-mail coniModem does not require
Modem interface
nection. Thus, the
a host processor. Semiinternal default configautonomous and Hosturation can easily be
controlled modes do need
RST SPK VIO +5 V Gnd RXA TXA TI
overwritten in this
an external supervisory
Figure 1—All this in that little black brick!
mode. This is the most
micro. When not in Full
www.circuitcellar.com
March 2001
67
Photo 3—Notice that the local modem hex IP address
and DNS server hex IP address fields are zeroes here.
flexible mode because everything can
be done on the fly under external
microcontroller control.
Every iModem contains a microcontroller with network protocols and
flash ROM. Extended RAM is only
found on the CH2158/59/60 modules.
Like its cousins, the CH2156 also
contains a buffered serial interface,
high-speed modem complex,
NVRAM, and FCC-approved DAA. In
a nutshell, it can automatically:
• connect to the ISP
• authenticate using a user ID and
password
• send e-mail using SMTP and POP3
protocols
• terminate the ISP session when data
transfer is completed
• pulse the message-accepted pin if all
goes well
The microcontroller used internally
by the CH2156 iModem is a Motorola
GP32 with Internet protocols residing
in flash ROM. The Motorola controller is responsible for executing the
iNet command set. The internal
microcontroller and modem complex
can also execute standard AT commands made popular by Mr. Hayes.
One feature I found useful is the
TTL-compatible RS-232 interface.
Having a TTL voltage level at the
modem pins eliminates the RS-232
voltage converter IC you would normally have to integrate into your
design. That means that, in the case
of a Microchip PIC, I can hook the
CH2156 iModem directly to the PIC’s
UART pins. This also means that it
can be used with larger embedded
engines that are short on serial ports.
A software UART can be used with
some standard I/O pins to affect an email send or regular ISP connection.
68
Issue 128
March 2001
Another great feature of the
CH2156 iModem RS-232 interface is
that there is no change in speed at the
DTE (PC, embedded PC, or PIC)
UART interface. The DTE speed is
constant regardless of how fast or
slow the Telco line speed is. When
the CH2156 iModem is operating in
the Internet state, all communications between the host DTE and
CH2156 iModem DCE interface are
57.6 Kbps. The modulator/demodulator supports line equalization and forward error correction.
Using the AT&Wx (x = 0 or 1) command, the CH2156 iModem NVRAM
can store two user-customized configurations. The NVRAM can save up to
four telephone numbers, with up to
36 digits or modifiers in each telephone number. The CH2156 iModem
uses the standard AT&Y, ATZx, and
ATDS=x commands to manipulate
the NVRAM storage area.
Everything else that normal
modems are concerned with applies
to the CH2156 iModem. In many
ways, the CH2156 iModem is superior to other modems. Rather than discuss the finite speeds and feeds of the
CH2156 iModem, let’s talk about the
goodies on the evaluation board that
support the CH2156 iModem.
For those of you who need instant
gratification, the GP20 sports a
MAX237, which allows hookup
directly to a host embedded or personal computer’s RS-232 port. The host
PC must be running a terminal emulator program like HyperTerminal.
There’s also a buffer to drive the
modem signal indicating LEDs and an
LM386 with supporting components
for sound. A 7805 supplies enough
juice for additional circuitry and a 6pin RJ-11 Telco interface is provided
with surge protection. The TTL level
modem control signals are all pinned
out to a 20-pin header block.
At first glance, I thought I was
going to be able to put a PIC16F877
on the GP20 because there are socket
areas open to accommodate the part.
A closer look revealed that the empty
pads were being reserved for another
purpose. That’s OK because I’ll use
the 20-pin header for this application.
The CH2156 iModem has the capabilCIRCUIT CELLAR®
Photo 4—Toss out the nine and add a one plus the
area code and you’re ready to rock.
ity to sense the input lines 1 and 2. It
can then be instructed to send an email about the status of the input
lines. A DIP switch is provided for
testing this feature.
I enjoy sharing all this wonderful
technology, but I really enjoy firing up
that technology to take it for a spin.
So, let’s apply some power to the
GP20 and CH2156 iModem and see
what she can do.
CH2156 IMODEM ROAD TRIP
Because this article focuses on
using the CH2156 iModem on the
Internet, I won’t go into detail about
its standard operation. As I mentioned
earlier, the CH2156 iModem is a great
modem. It can be controlled by setting levels on the control pins or by
ASCII commands into the RS-232
DCE interface. Before anything can be
done with the CH2156 iModem, it
must be properly reset. Powering on
the modem or applying a 10-ms high
reset pulse to the RST pin accomplishes a CH2156 iModem reset.
Either of these events will cause an
internal iModem reset to occur.
Configuration within the CH2156
iModem should finish about 900 ms
later. The line carrier modulation
DCE speed will be set to 56 Kbps.
At this point, the CH2156 iModem
doesn’t know what speed the DTE is
set for. So, to train the CH2156
Photo 5—If “Message Accepted” doesn’t return, no email will be sent.
www.circuitcellar.com
Jameco www.jameco.com/cir
Photo 6—The third I/O is used to sense the transmit
switch on the GP20.
iModem, the AT<CR> sequence is
sent to the iModem. I’ll use
HyperTerminal set for 57.6 Kpbs, 8
data bits, 1 stop bit, and no parity.
When I apply power, the LEDs on the
GP20 come to life. I then enter
AT<CR> and immediately get an OK
returned from the CH2156 iModem.
I could simply type in @TD to send
the default e-mail, but I think I’ll use
my own account because the default
account is somewhere in California.
Instead, I issued an @TV command.
@TV is an iNet AT command that displays the iModem profile. As you can
see in Photo 3, the default profile is
70
Issue 128
March 2001
intact and waiting for my command.
This information can be changed by
dialing the iModem or locally using
the HyperTerminal PC hookup. All
you have to do is install the CH2156
iModem at a remote site and connect
it to the public phone system. The
end user can then dial up the iModem
and tell it where to send the mail.
The engineering staff at Cermetek
recommends trying to connect by
using the defaults before you monkey
around with the settings. So, let’s
start our trip through iModem space
by using the defaults to call CalifornI-A from the Florida room.
The first thing I had to do was add
an area code in the ISP Phone
Number field. That’s not hard to do,
as you can see in Photo 4. To send
the canned message, I filled in the
Send Mail To field with my destination address. Otherwise, nothing else
needs to be changed. Notice that the
mail server hex IP address is actually
in hexadecimal format. CEA50689
equates to 206.165.6.137 in dotted
decimal IP address format.
CIRCUIT CELLAR®
Photo 7—Note that the local modem hex IP address
and DNS server hex IP Address fields contain information from Frontiernet’s server.
The iModem command set uses
@TD and @TDM1 commands to send
e-mail messages. Each command
directs the iModem to send an e-mail
message that is formatted differently.
The @TD command sends the
canned e-mail message that contains
the status of the input ports as set by
the DIP switches. The ASCII character configuration of the e-mail message sent by the @TD command is not
user-modifiable. Only the switch status will be sent as a pre-configured email message. You can send the
canned e-mail message by pressing a
button on the GP20 board or keying
in @TD (see Photo 5).
After the Enter key is pressed, the
CH2156 iModem goes into action.
After the normal modem tone party, a
“Connect” message is displayed, letting me know that the PPP negotiation was successful. A short time
later, I was informed that the modem
is terminating the connection and
hanging up the line. If the e-mail message was accepted for delivery at the
ISP end, “Message Accepted” is displayed in the terminal emulator window. Within minutes, I received the email message you see in Photo 6.
That was easy. Now, let’s send a
message with content from a human,
yours truly. To do this, I conjure up
another @Tx command, @TM. The
@TM command constructs a userdefinable e-mail message that is sent
using the @TDM1 command. The
ASCII character configuration of the
e-mail message sent by the @TDM1
command is currently limited to 100
ASCII characters. Blanks or spaces are
allowed in the message body and each
occurrence counts as one ASCII character. The termination sequence for
the @TM command is <CR>.<CR>
www.circuitcellar.com
Photo 8—Imagine your embedded PC or microcontroller filling in the blanks.
and any <CR> included in the @TM
data field is interpreted as <CR><LF>.
This is done to maintain compatibility with various terminal emulation
programs. The canned message is not
sent when using user-defined text
such as what I entered in Photo 7. I’ll
also issue @TS to change the e-mail
message subject in Photo 8. I have 15
ASCII characters to use in the @TS
subject field. Another @TD command
is entered this time as @TDM1.
“Connect” is returned and a few
moments later the CH2156 iModem
hangs up the line and my wordy email is confirmed and sent.
NO HASSLE E-MAIL
depending on what type of situation
the embedded PC encounters at that
moment. This idea can also be carried
over to pagers. Some e-mail accounts
and cellular phones can pass e-mail
content to alphanumeric pagers. Now,
project engineers have a simple and
inexpensive means of communicating
from an embedded platform.
The CH2156 iModem is just one in
a family of iModems from Cermetek.
If your design must also receive email, the CH2159 and CH2160 perform that task. The CH2157 can be
used to sense and send temperature
data because it includes “on-modem”
temperature-sensing circuitry.
While writing this piece, I spoke
with Cermetek’s engineering staff. I
found them to be knowledgeable and
eager to help. I’d like to thank them
and leave you with Photo 9, which
reminds you that it doesn’t have to be
complicated to be embedded. Iÿ
Author’s Note: I want to say a special
thank you to Cermetek’s Mel Ward
and Henry Roskos, whose help was
indispensable.
Fred Eady has more than 20 years of
experience as a systems engineer. He
has worked with computers and communication systems large and small,
simple and complex. His forte is
embedded-systems design and communications. Fred may be reached at
fred@edtp.com.
SOURCES
GP20 eval board, CH2156 iModem
Cermetek Microelectronics
(800) 882-6271
Fax: (408) 752-5004
www.cermetek.com
GP32 microcontroller
Motorola
(847) 576-5000
Fax: (847) 576-5372
www.motorola.com
HyperTerminal Private Edition
Hilgraeve, Inc.
(800) 826-2760
Fax: (734) 243-0645
www.hilgraeve.com
The process of sending e-mail with
the CH2156 iModem may seem trivial, but it isn’t. The real beauty of this
process is that you can instantly
make your creation Internet-ready.
With just a few lines of code and
some ingenuity, you’ll be able to send
useful information from your product
with minimum engineering effort.
Many embedded computers are
being used today to dynamically build
HTML-based information pages. The
CH2156 iModem interface is suitable
for performing a similar task with email messages. Embedded code can be
written to put phrases together,
Photo 9—That’s my story and I’m stickin’ to it.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
71
FROM THE
BENCH
Jeff Bachiochi
Getting a Grip on
Complex Integration
Looking at FPSLIC
With
$8000
up for
grabs in
the
FPSLIC
category of Circuit
Cellar’s Design Logic
2001 contest, Jeff
decided to take a
closer look at Atmel’s
field-programmable
system-level IC.
72
Issue 128
March 2001
i
t’s Monday
morning. The coffee is flowing. The
engineering staff has
congregated for the VP’s weekly wisdom. Your group is acknowledged for
the miraculous effort demonstrated in
finishing the widget project just in
time for the company to show it at
the West Coast conference. In return,
the boss has given your group the
next big project. The plan is to break
from tradition and use some of the
latest technology in an effort to
thwart potential redesign issues for
newer features. This design methodology would surely increase the product’s life cycle. Congratulations! And,
by the way, you’ll be meeting with
the Atmel rep at 10 a.m.
Programmable devices have spread
way beyond gate arrays to generate
one of the hottest new technologies.
The big guys are jockeying for position as more system level circuitry is
jammed into a single device. Atmel
has entered this arena with a new
device that will give system designers
all they could want under one roof, er,
chip. The field-programmable system
level integrated circuit (FPSLIC) contains an FPGA, SRAM, RISC microcontroller core, and fixed peripherals
on one monolithic device.
FPGA
FPSLIC’s FPGA section is PCI-compliant and SRAM-based. It contains
distributed 10-ns programmable
SRAM (FreeRAM), eight global clocks,
and cache logic ability (it can be partially or fully reconfigured without
loss of data). The FPGA can be used
as a coprocessor for high-speed
(DSP/processor-based) designs by
implementing a variety of computeintensive, arithmetic functions. These
include adaptive finite impulse
response (FIR) filters, fast Fourier
transforms (FFT), convolvers, interpolators, and discrete cosine transforms
(DCT) that are required for video
compression, decompression, encryption, convolution, and other multimedia applications.
The patented FreeRAM can be used
without losing logic resources.
Multiple independent, synchronous or
asynchronous, dual- or single-port
RAM (16K words) functions (FIFO,
scratch pad, etc.) can be created using
Atmel’s macro generator tool.
The FPGA’s eight-sided core cell
(horizontal, vertical, and diagonal
connections) implements ultrafast
Photo 1—Atmel
combined its AVR
processor and
FPGA functions to
give designers the
best of both worlds.
Notice the dual bus
structure between
the processor and
FPGA sections.
CIRCUIT CELLAR®
www.circuitcellar.com
array multipliers without
using any busing
resources. The cache
logic capability enables a
large number of design
coefficients and variables
to be implemented in a
small amount of silicon,
giving way to vast
improvements in system
speed at a much lower
cost than conventional
FPGAs. Logic functions
can be loaded into the
logic cache without losing data or disrupting the
operation of the rest of
the chip, replacing or
complementing the active
logic, acting as a re-configurable coprocessor.
When dealing with individual FPGAs and micros,
it’s clear; two devices and
separate tools should
never mix. With System
Designer, you have full
control of the process. In
Photo 2, the left-hand
block contains design flow
for FPGAs. The right-hand
block is the normal design
path for the AVR micro.
These paths can be followed independently as
long as the system design
has been defined. The center block of Photo 2 adds a
new path that allows both
sides to be more closely
Photo 2—Atmel's System Designer is the main application for FPSLIC. It gives you the
integrated. This process of
ability to design FPGA and AVR sections independently. The better approach, however, is
co-verification enables
to use the system level integration path allowing both sections to be designed in parallel.
integrated testing to allow
continued parallel develAVR
and interrupt system to continue
opment of the hardware and software.
FPSLIC’s AVR core is a low-power
functioning. The Power Down mode
CMOS, 8-bit microcontroller based on
saves the register contents but freezes
the AVR RISC architecture. Take a
ATSTK94–FPSLIC STARTER KIT
the oscillator, disabling all other chip
look at it in Photo 1. By executing
This Windows-based development
functions until the next interrupt or
powerful instructions in a single
kit includes software, tutorials, docuhardware reset. In Power Save mode,
clock cycle, the embedded core
mentation, and hardware. The hardthe timer oscillator continues to run,
achieves throughputs approaching 1
ware includes a development board
allowing you to maintain a timer base
MIPS per MHz, allowing the system
that contains an FPSLIC, socketed
as the rest of the device sleeps.
architect to optimize power consumpserial EEPROM, and several other bits
tion versus processing speed. The
(i.e., push buttons and displays) and
PUTTING IT ALL TOGETHER
AVR architecture combines a rich
headers to monitor the FPSLIC sigWith this integration comes cominstruction set with 32 × 8 generalnals. Because the FPSLIC is a proplexity. How do you handle it all?
purpose working registers. All the reggrammable device, the PCB also
Atmel supports designers by gathering
isters are directly connected to the
serves as a programmer. Photo 1
tools together in a single-system
arithmetic logic unit (ALU), allowing
shows that there is no nonvolatile
development environment called the
two independent register bytes to be
memory in the FPSLIC device. This
System Designer. This solves the sysaccessed in one single instruction exemeans that all the configuration infortem integration maze and gives you
cuted in a one-clock cycle. The resultmation and micro’s code must come
some debug and testing aids. Using
ing architecture is more code efficient
from somewhere else. FPSLIC, like a
co-verification tools can shorten the
and achieves throughputs up to 10
DSP, expects to get this information
single-path design process.
times faster than conventional CISC
Co-verification tools allow
microcontrollers.
software design, coding,
The embedded AVR core has 4 KB
and testing to proceed in
of SRAM, 16 general-purpose I/O
parallel with the hardware
lines, and 32 × 8 general-purpose
prototyping and debugging.
working registers. Peripherals include
This way, you can feel
a real-time counter (RTC), three flexiconfident in the software
ble timer/counters with compare
by the time it’s needed.
modes and PWM, two UARTs, a programmable watchdog timer with
Photo 3—Atmel's CPS (Configurator
internal oscillator, a two-wire serial
Programming System) programs the
port, and three software-selectable
serial EEPROMs with the final code. A
power-saving modes. The Idle mode
cable is supplied with the FPSLIC
stops the CPU and allows the SRAM,
starter kit's PCB, which connects the
PCB demo board to your PC.
timer/counters, two-wire serial port,
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
73
from an external serial EEPROM upon
powerup (or reset). The device fetches
its program automatically each time
it’s powered-up. Your design file is
actually programmed into the external EEPROM.
Let’s take a trip through the System
Designer’s design flow to see the origins of this code and how the design
flow gets you to the point of actually
programming the device. I will, however, begin at the end of the design
process and discuss the physical programming aspect of using FPSLIC.
CONFIGURATOR
The Atmel AT17 Configurator
Programming System (CPS) consists
of a PC program (see Photo 3) to handle the transfer of the System
Designer’s end product, the bitstream
(.BST) file to the serial EEPROM
located on the starter kit PCB. The
PC and starter kit PCB are connected
with a 10-pin ribbon cable and five
signals (power, ground, SCL, SDA,
program_enable) are used.
Incidentally, full schematics of the
PCB are included in the user’s guide.
The CPS programs the serial EEPROM. The FPSLIC automatically
fetches this file from the serial EEPROM upon powerup (or reset).
I used to think that serial EEPROMS had too many formats (SPI,
I2C, write-protected). Well, another
format was devised for configuring
FPGAs. Like an I2C device, it uses a
CLK and bidirectional data line.
Photo 4—The programming utility creates the file read
from the external serial EEPROM by FPSLIC every
time the chip is powered up or reset. Because the
FPSLIC is volatile, it always updates itself with the
newest code.
However, like SPI, it uses a *CE to
select the device, which eliminates
some addressing information. The
new functions have to do with how
the device is used. The FPGA only
needs to read it in Sequential mode. If
the data doesn’t fit into a single
device, these serial EEPROMs can be
cascaded. A special output, *CEO,
creates a *CE to the next device. This
way, the FPGA doesn’t have to know
the size of the device that is connected. When the first device exceeds its
address range, it disables the data output and selects its cascaded neighbor.
Another function is the reset input.
When this is connected to the FPGA’s
reset, the serial EEPROM can be initialized along with the FPGA.
Otherwise, the FPGA would get out
of sync with the serial EEPROM’s
data. Where does the bitstream file
come from? Here’s where Atmel’s
System Designer software bundle
enters the picture.
PROGRAMMING UTILITY
Photo 5—An AVR assembler is included for those
people who wish to grab the bull by the horns and
write in the AVR's native code.
CIRCUIT CELLAR®
The buck (design) stops here.
Referring back to Photo 2, the last
step in the System Designer program
is a programming utility where an
FPGA design output file (.BST) and
AVR design output (.HEX) can be
combined into a single file. The programming utility shown in Photo 4
has check boxes to add one or both of
the files for inclusion in the final bitstream output file (.BST). The alterwww.circuitcellar.com
CALL, W
RITE, FA
X
or E-MAIL
For A
FAST Shipping
ALL
ELEC T R ONICS
C
O
R
P
O
R
16 Character X 2 Line
LCD with Backlight
Daewoo # 16216L-5-VSO
5 x 7 dot format. 2.56” x 0.54”
viewing area. 3.15” x 1.41”
module size. LED backlight. Includes hookup/spec sheet.
CAT # LCD-53
750
$
10 for $6.50 each
100 for $5.00 each
each
Motorized 20K Pot
Shokai # WHE1604A 2 X 20KB
Dual 20K linear pot.
Powered by a small
reversible DC
gearhead motor.
At 6 Vdc the pot varies
from minimum to
maximum resistance,
or vice versa in
about 8 seconds.
Pot and motor assembly
are approximately 1.7” deep,
behind mounting plane. 6mm
flatted shaft is 0.7” long. 9 mm threaded
bushing. These are new pots, prepped with
2.5” wires and a connector.
CAT# MPOT-20K
10 for $35.00
4
$
00
A
O
Molon # CHM-1205-5
Powerful 12 Vdc, 6 RPM
gearhead motor. Gearbox is
3” x 2.75” x 0.83”. Drive
motor and shaft are both
on the same side of
the gearbox. Shaft is
3.3” long, Top of shaft
is 0.37” square. Base
is 0.5” diameter. Motor draws
130 mA at 12 Vdc, no load.
Motor protected by removable
rubber cover.
CAT # DCM-164
CAT # DCM-166
150 for 60¢ ea.
600 for 50¢ ea.
1500 pieces 35¢ ea.
Outside th
e U.S.A.
send $3.0
0 postag
e.
Thermoelectric Coolers
Peltier Junctions
(127 thermocouples per device)
1200
$
each
Linear Actuator for
Auto Door Lock
12 Vdc motor-drive
actuator for automotive door locks.
Nylon plunger moves
0.75”. Push or pull,
depending on polarity.
Includes mounting hardware
and a 10” metal extension rod which fits
through the hole in the end of the plunger.
Overall dimensions of actuator assembly
(retracted): 8.42” x 2.35” x 1.15”. Rubber boot
protects against moisture and dust.
Pigtail leads. CAT # DLA-1
550
$
The perfect power supply for
audio / video / telephone /
communication/ small
appliances / any device
that normally uses a wall
transformer. Provides all of
the popular voltages
between 3 and 12 Vdc,
and it’s regulated, so the voltage
doesn’t fluctuate when the load varies. A good
multi-voltage lab supply for breadboard projects
up to 1 Amp. Includes a set of seven of the
most popular power connectors.
ORDER TOLL FREE
These incredible miniature solid state heat
pumps raise or lower temperature in a small
area almost instantly. Utilizing the Peltier
effect these modules perform the same cooling
or heating functions as freon based refrigerators but they do it with no moving parts, and
are very reliable. Current applied to the device
will produce heat on one side and cold on the
other side, up to 68° C difference between the
two sides. Modules can be mounted in parallel
to increase the heat transfer effect or can be
stacked to achieve high differential temperatures. Operate on 3-12 Vdc. Requires a heat
sink to prevent overheating.
Two sizes available:
1.18" (30 mm) square X 0.15"
CAT# PJT-1 $17.00 • 5 for $75.00
1.57” (40 mm) square X 0.15”
CAT# PJT-2 $26.00 • 5 for $110.00
Special Quantity Purchase
Nickel-Metal Hydride
AA “Flat-Top” Cells
each
1 Amp Switching Power
Supply w/ Selectable Output
3 - 4.5 - 6 - 7.5 - 9 - 12V
CAT # PS-10
age
.
CATALOG
N
each
Mabuchi # FF-N20PN
Miniature 1.5 to 3 Volt
DC motor. Ideal for models
and radio control applications
where small size is important.
No load rating: 15,800 RPM @ 2.4 V, 96 mA.
Length (excluding shaft), 0.654” long x 0.47”
x 0.39”. 0.039”(1mm) diameter x
0.13” long shaft. Solder-loop terminals.
Large quantity available.
1
I
Free 96 P
DISCOUNT
Pricing
6 RPM Gear Motor
Miniature DC Motor
2 for $ 50
T
QUALITY Parts
Panasonic # HHR-11AA0
1.2 Volt, 1100 mAh “flat-top” rechargeable AA
cells. These cells are designed for use in
battery packs; they do not have the raised
button found on most replaceable batteries.
0.55” diameter X 1.95” long. Large quantity
available. Two styles:
REGULAR-FLAT TOP
CAT # NMH-110
150
$
each
SOLDER-TABBED
CAT # NMH-110T
75
1295 $1
$
each
40pcs $1.25 • 120pcs $1.00
800pcs 85¢ each
each
40pcs $1.50 • 120pcs $1.25
800+ $1.00 each
1-800-826-5432
Shop ON-LINE
www.allelectronics.com
MAIL ORDERS TO:
ALL ELECTRONICS CORP.
P.O. BOX 567 • VAN NUYS, CA 91408-0567
FAX (818) 781-2653 • INFO (818) 904-0524
E-MAIL allcorp@allcorp.com
NO MINIMUM ORDER • All Orders Can Be Charged to Visa, Mastercard, American Express or Discover • Checks and Money Orders Accepted by Mail •
Orders Delivered in the State of California must include California State Sales Tax • NO C.O.D • Shipping and Handling $5.00 for the 48 Continental United
States - ALL OTHERS including Alaska, Hawaii, P.R. and Canada Must Pay Full Shipping • Quantities Limited • Prices Subject to change without notice.
MANUFACTURERS - We Purchase EXCESS INVENTORIES... Call, Write, E-MAIL or Fax YOUR LIST.
can be forced onto a separate
FPGA pin, which gives access
to both functions.
AVR DESIGN PATH
Photo 6—A 30-day, time-limited evaluation copy of IAR Systems'
Embedded Workbench is included for people who speak C.
nate tab on the programming utility
labeled “Control Register Settings”
allows some configuration parameters
to be set. For instance, one way a
micro can get away with fewer I/O
pins is through alternate functions
like digital I/O or external interrupt
sharing of the same pin. And, because
the AVR and FPGA are so closely
interconnected, the alternate function
This path is familiar to
designers who want to write
code using their favorite thirdparty tools. However, the
System Designer’s AVR design
path begins with a code entry
section, which enables your
favorite text editor. Then, this
can be used to enter source
code for people who want to
write in assembler. Language
alternatives are enabled via the
next section.
COMPILER
Referring to Photo 2, you’ll see
that it’s the assembled output from
the compiler section that is used by
the co-verification and programming
utility portions of the system level
integration path of the System
Designer. The integrated WAVRASM
assembler (see Photo 5) will directly
assemble files produced from the text
editor code entry (.ASM) portion of the
System Designer.
The assemble and compile selection
can be modified to load an alternate
tool of your choice in place of
WAVRASM. Presently, two compiler
manufacturers support the AVR
devices, IAR Systems (see Photo 6)
and ImageCraft (see Photo 7). You’ll
find both C compilers (time-limited
license) included on the FPSLIC CD.
These are full-function demos and can
be used to create C code, which will
be compiled into the files needed by
the system level integration path.
STAND-ALONE FUNCTIONAL
DEBUG
The final function available within
the AVR design path in the System
Designer is the stand-alone functional
debugger. This function is handled
through the AVR Studio (see Photo 8).
Although a code simulator may be
part of your compiler manufacturer’s
suite of tools, Atmel’s simulator within AVR Studio includes the FPGA
iTrex
Better Inventory Management
l
Part Master, BOMs, Purchase Orders, Work
Orders, Sales Orders, Receiving, Invoicing,
Stockroom, Address Book,
and Security Modules
l
Integrated inventory and
manufacturing control
l
Affordable
l
Multi-user
Xelos
Visit www.xelosproducts.com
for a free DEMO
Or call us at (415)898-7902
76
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
portion of the FPSLIC design and is
more helpful in understanding the
interaction between the AVR core and
the FPGA.
At this point, you are at the end of
the AVR design path using the System
Designer, your code work is complete,
and you can look forward to the real
hardware ahead. If you require a hardware debug/emulation platform,
Atmel’s only hint for the time being
is the potential use of JTAG.
FPGA DESIGN PATH
For many solder jockeys, schematics are the only real way to display
circuit hardware. The act of connecting components with a line tells the
true interconnection story. You must
refer to data books to discover a component’s task when it exceeds the
simplest logic functions. Most logic
data books include a picture of the
internal function and a truth table of
inputs versus outputs or an equation
of the component’s function.
Sometimes you may even find a state
table. All of these methods can be
used to fully describe the function of
the device. CAD programs have
been used to document designs
using schematics for years. These
are perfect for engineer interfacing, but machines lack the ability
to understand pictorial circuitry.
This is why an industry-standard
hardware descriptive language
(HDL) was developed.
ABEL, VERILOG, AND VHDL
The ABEL HDL (advanced
Boolean equation language) was
developed for PLD circuit design
by Data I/O. The ABEL compiler
allows designs to be simulated
Photo 7—An evaluation copy of ImageCaft's IDE for ICCAVR
is included, too.
and implemented into a PLD,
such as a PAL (programmable array
• test vectors
logic), a CPLD (complex programma• end
ble logic device), or an FPGA. The
basic structure of an ABEL source file
Verilog (verifying logic) was inventcontains the following elements:
ed as a simulation language. The
Verilog HDL is maintained by a non• header: module name options and
profit organization, Open Verilog
title
International (OVI). OVI had the task
• declarations: pin, constant, node,
of taking the language through the
sets, states, and library
IEEE standardization procedure. Work
• logic descriptions: equations, truth
is underway to define analog extentables, and state diagrams
sions to the Verilog language.
Painless
PCI Bus Designs!
Your PCI bus designs will be a
breeze with this concise but
comprehensive new guide. You’ll
find up-to-the-minute info on:
√
√
√
√
√
√
√
√
√
PCI electrical specs
Multiple bus masters
Arbitration methods
Interrupt processing
CompactPCI standard
PCI BIOS
Plug and play
Hot Plug and Hot Swap
PCI Bus
Demystified
by Doug Abbott
$49.95 print version
ISBN 1-878707-54-X
Includes CD-ROM
$37.50 downloadable
Deluxe eBookTM
version also available
And much more!
To order, visit our web site or call 1-800-247-6553
FREE! PCI Bus Quick Reference Guide
Visit www.pcibusdemystified.com
Visit www.LLH-Publishing.com for the latest technical
books and eBooks on embedded systems design,
wireless telecommunications, DSP, and more!
Our books are available at
bookstores everywhere.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
77
The development of VHDL
Because each manufacturer
(very high-speed integrated
chooses its implementation
circuits HDL) was initiated
of how the available gates
in 1981 by the U. S.
will be arranged, no design
Department of Defense to
will fit into one manufacaddress the hardware life
turer’s device the same way
cycle crisis. The cost of
it fits into another. So, your
replacing electronic hardware
design must be broken
as a technology became obsodown and analyzed to see
lete and was reaching the
how it will best fit into
point of crisis. This was
your choice of devices.
caused by non-standardized
Exemplar Logic’s Leonardodocumentation of the funcSpectrum is the synthesis
tion of the components makprogram used in this step of
ing up a system. At this time,
the FPGA Design path to
Cadence and other EDA
match a design to a specific
Photo 8—AVR Studio includes a simulation of the AVR code along with the FPGA
(electronic design automadevice. Leo requires little
hardware, a feature not provided with most compilers.
tion) companies owned
more than your design files
Verilog and looked at VHDL as a
and a choice of target device to deterschematic drawing. You can experipotential tool owned by competitors.
mine how it will implement the
ment with this function using Orcad,
As technologies advance, so must
design (see Photo 11).
which will output a .VHD file. A fullthe standards. Both the Verilog and
I started on this path with a textual
function, size-limited demo version is
VHDL camps continue to reevaluate
description of the design using a text
available on its web site. After you
and adjust to stay current. You will
editor or schematic capture program.
have your FPGA section specified
find partial tutorials about both
This allowed the design to use quali(HDL files), it’s off to the stand-alone
Verilog and VDHL on the FPSLIC CD.
fied parts from a standard library,
functional simulation.
These are presented via Pacemaker
which guarantees that operation comMultimedia by Doulos (see Photo 9).
forms to documented performance
MODELSIM
The language reference manual (LRM)
standards. Standard simulation tools
In the FPGA design path, Model
for Verilog is IEEE-standard 1364 and
can then be used for verifying the
Technology’s ModelSim is used in
the LRM for VHDL is IEEE-standard
design. Then device-specific resources
Standalone mode. This mode requires
1076. Both are well-rooted in the IEEE
are called on to synthesize the design.
compilation of the design files, which
standardization process.
So, in reality I am now getting back to
usually include a testbench file. The
a schematic of the original design
testbench file, written by you, is
implemented using a specific gate
HDL ENTRY
used by the simulation program to
array technology. How is the syntheThe FPGA design path in Atmel’s
automatically apply stimulus to the
sis implemented into the gate array?
System Designer begins with HDL
design. The simulation is only as good
The last (required) step of the FPGA
entry. If you are a hardware designer
as the stimulation procedures. In
Design path performs this function.
with little or no experience with
Photo 10, ModelSim is shown with a
Verilog or HDL creation, there are
number of function windows open.
schematic capture programs that will
FPGA PLACE & ROUTE
This step is optional and is used to
create HDL output files from the
Atmel calls on Figaro by Cadence
gain a sense of verification of
Design Systems for the physical porthe design if the AVR and
tion of the FPGA design path in
FPGA design paths are being
System Designer. I call this the physifollowed independent of one
cal portion because its responsibility
another. (ModelSim is also
is to interconnect the gates within the
used for co-verification in the
target device.
system level integration path,
Let’s take a closer look at the FPGA
which allows both the AVR
portion of Atmel’s FPSLIC. The file
and FPGA paths to run conpassed from the synthesis portion is
currently for the shortest
in the electronic design interface fordesign cycle.)
mat (EDIF). This is another standard
used to transfer files between elecHDL SYNTHESIS
tronic CAD (ECAD) or electronic
Programmable logic devices
design automation (EDA) systems.
Photo 9—For those of you who want a tutorial of Verilog or
have
differing
architectures,
From the .EDF, file Figaro creates a
VHDL, you can get an introduction to both from an included multibut are all made up of gates.
media presentation by Doulos.
net list. With the net list and target
78
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
Rabbit
Photo 10—Just like
code simulation,
Model Technology's
ModelSim allows the
FPGA to be simulated
via a user-written
testbench file.
ADAC
configuration, it can begin to map the
cell usage for the design. Placement
and routing is similar to PCB layout.
First, the necessary cells are selected;
choice of cell (placement) is not based
on connections. Next, the cells are
moved around for a good fit based on
the connections. The rat’s nest of connections is then routed using the
available pathways. Photo 12 shows
Figaro’s compiler window with a view
of the cell format for the FPGA section of FPSLIC. When placement and
routing is complete, bitstream output
files are created. Remember, the bitstream file (containing the programmable connection within the FPGA)
is combined with the AVR’s code into
a single file, which is to be stored in
an external EEPROM and read into
the FPSLIC during powerup or reset.
You may wish to run the finished
design through ModelSim again at
this point. This is a good idea if any
manual changes were made in the
synthesis or placeand-route steps.
device option section. This step
would normally be completed before
the start of any design. It would be
foolish to begin the FPGA design or
AVR design path without examining
how the FPGA and AVR core work
together. Here you must decide how
the available memory will be defined,
code versus data. Also, you need to
choose which AVR clock source will
be available to the FPGA via GCLK6.
Beyond these choices, you must make
design decisions about how certain
tasks are performed. For instance,
your design may include a CRC
(cyclic redundancy check) function.
This can be implemented in either
software or hardware. Responsibility
for all functions should be defined
right up front to avoid finger pointing
later on.
Assuming you have separate groups
that will tackle the FPGA design and
AVR design paths, they can begin
their respective design cycles.
SYSTEM LEVEL
INTEGRATION
PATH
So far, I’ve discussed using the individual AVR design
and FPGA design
paths. Now let’s see
how using the system level integration
path can help save
design time. This
begins with the
80
Issue 128
March 2001
Photo 11—Exemplar Logic's Leonardo Spectrum takes your FPGA design file
and breaks it down into the pieces necessary to implement the design based
on the target device, in this case Atmel's FPGA.
CIRCUIT CELLAR®
www.circuitcellar.com
Photo 12—Figaro auto-routes Leo's output into FPGA connections. On the left of Figaro's windows, you can see the rat's nest of the design's components. On the right is a
compiled view of the FPGA device. The remaining insets are zooms into the FPGA, right down to the individual gates.
AVR-FPGA INTERFACE
BEFORE AND AFTER
When the FPGA design group has
finished its HDL entry, system level
integration can continue by defining
the physical interface between the
FPGA and AVR. Photo 13 shows how
these relationships are created.
The input design ports are all of the
signals associated with the HDL
entry. To integrate the design, you
connect signals in the FPGA to the
appropriate AVR signals. The AVR signals include I/O selects, interrupts,
buffered data bus control, clocks,
SRAM controls, SRAM address, and
SRAM data bus. Take notice of the
check box in the lower left corner of
the AVR-FPGA interface screen; this
tool will generate a skeletal testbench
file for the FPGA design team, which
reflects the interconnections made
during this step.
After the AVR design team finishes
the AVR code, the first pass of co-verification can begin. The co-verification
allows the actual AVR code to be executed (simulated) using Atmel’s AVR
Studio as ModelSim simulates the
HDL functions. This is the first time
the FPGA design path and AVR design
path connect. The FPGA design team
can continue with synthesis, layout,
and routing while co-verification continues. Parallel paths can be a timesaver in linear design.
When the FPGA design team has
finished with synthesis, layout, and
routing, the second pass of co-verification can begin. The second pass
allows bi-simulation with the timing
information included from the FPGA
layout and routing process.
Ordinarily, a prototype PCB design
www.circuitcellar.com
CIRCUIT CELLAR®
would also be in process at this time.
Some of you may choose to use the
FPSLIC starter kit as an early prototype. The programming utility function of the System Designer can now
be used to create the finished bitstream file for downloading into the
starter kit using the CPS.
NOT FOR NEWBIES
FPSLIC is a combination of two
super products, FPGA and AVR,
which are extremely popular on their
own. But let’s be real here, each
requires special tools with a significant learning curve to become proficient. Atmel does a nice job of incorporating the necessary tools into the
System Designer to allow the FPGA
and the AVR devices to be integrated
into the single FPSLIC package.
Because many third-party tools are
Issue 128
March 2001
81
Photo 13—To allow system level integration, you must show interface connections
between the FPGA and AVR sections. This
screen shows how easily this is accomplished. The tabs on the right bring up sections available on the AVR device and the
left shows FPGA parts. Individual items are
then connected by a click of the mouse.
incorporated here, there is some
licensing necessary. The cost of the
starter kit includes a short-term
license, but after that you have two
options according to the user’s guide:
you can subscribe for ~$500 for six
months or submit an application note
and, if approved, receive six months
of free support. Application note
guidelines are also in the FPSLIC
User’s Guide.
There is one version of FPSLIC in
an 84-pin PLCC package, however, all
higher pin packages (100, 144, 208,
and 240) are flat-pack SMT. The big
mama, a 352-pin device, is packaged
in BGA. The starter kit comes with a
soldered 208-pin SMT. You’ll be able
to use this PCB for most initial prototypes, as every pin comes out to a 0.1²
dual row header.
It seems your boss has done some
homework prior to the selection of
the FPSLIC for this year’s super widget. Now you get to play God. Can you
turn prophecy into profit? Don’t forget to add your Atmel apps engineer
to your buddy list. I
Jeff Bachiochi (pronounced BAH-keyAH-key) is an electrical engineer on
Circuit Cellar’s engineering staff. His
background includes product design
and manufacturing. He may be
reached at jeff.bachiochi@circuitcellar.com.
SOURCES
AT94K40AL FPSLIC System
Designer, AT17 Configurator
Programming System, AVR Studio
Atmel Corporation
(408) 441-0311
Fax: (408) 487-2600
www.atmel.com
82
Issue 128
March 2001
CIRCUIT CELLAR®
Orcad Capture, Figaro
Cadence Design Systems, Inc.
(888) 671-9500
(503) 671-9500
Fax: (503) 671-9501
www.orcad.com
ABEL HDL
Data I/O Corp.
(800) 426-1045
(425) 881-6444
Fax: (425) 882-1043
www.dataio.com
Pacemaker Multimedia
Doulos
+44 0 1425 471223
Fax: +44 0 1425 471573
www.doulos.com
IAR C for AVR
IAR Systems Software Inc.
(415) 765-5500
Fax: (415) 765-5503
www.iar.com
ImageCraft C for AVR
ImageCraft Creations Inc.
(650) 493-9326
Fax: (650) 493-9329
www.imagecraft.com
LeonardoSpectrum
Exemplar Logic, Inc.
(800) 632-3742
www.exemplar.com
ModelSim
Model Technology
(503) 641-1340
Fax: (503) 526-5410
www.modelsim.com
Verilog HDL
Open Verilog International
(408) 358-9510
Fax: (408) 358-3910
www.ovi.org
www.circuitcellar.com
new
!
see what’s new at www.saelig.com!
DrDAQ
PC Instruments
Educational
Datalogger
ADC-10 8-bit $79 through ADC-216 16-bit $799—display
scope, spectrum and meter simultaneously. Connect to PC
parallel port and start
gathering/displaying data
immediately!
built-in sensors!
www.drdaq.com
DrDAQ plugs into a PC for useful
datalogging at school, college,
industry. Built-in sensors for light,
sound, temp. or add pH sensor and
run one of the many suggested
logging/alarm system
standalone or with PC.
• TH-03 thermistorto-PC converter
•
RS232 to RS422 &
RS485 converters
• Plug directly into PC
— self powered!
• Drive any RS422
or RS485 devices.
• Send control and data
100s of feet!
K422/K485, 25pin > 9pin . . . $69
K422-99/K485-99,
9pin > 9pin . . . . . . . . . . . $69
Isolate RS232/422/485 signals
Kxxx-ISOL 25pin
self-powered . . . . . . . . . $139
2-Year
Dataloggers
osziFOX
$
129
Remote control & data
acquisition without power!
BITlink ®
ISA PCI p-port
2-wire
control network
Industry-standard
$
card for PC’s . . . . . . . . . . . . . 299
• Master, Slave or Bus monitor
• Control or program I2C devices
• Low volt ICA93LV for 3V ic’s . .
• PARALLEL PORT VERSION
NEW - PCI VERSION!
O
W
$
399
2 C”
to I
“How lig.com
.sae
www
power & information on 2-wires!
• Over 50 different DIN-modules for:
analog i/p & o/p, thermocouple i/p,
digital i/p, relays, on 2000m network!
CANbus Starter Packs
Boards for PCI/ISA/PCMCIA/PC104/VME/compPCI
Drivers for WIn95/98/NT,VxWORKS, pSOS, Lynx,
Linux, OLE, HPVee, LabView, etc.
!
Sn g
PCMCIA
Datalogger TDS2020D
P i
Go g g
L
www.abidata.be for details.
TC-08 8x thermocouples
Make PCs
talk I2C
easily!
N
Self-contained in
2" x 3" plastic box,
2-year batterypowered analog and
digital dataloggers
for storing events,
voltages, currents or
pressures for days to weeks.
Download detailed time and data
via RS232 port and review your
results with graphic software or
PC spreadsheet.
Turn your
PC into a
scope!
• EnviroMon temperature
science experiments! - only $99!
Saelig Co.
Handheld
PenScope
lowpower PCcard logging
• Store analog/
digital data on
PC FlashATA cards
• > 100 readymade
software function
modules—finish quickly.
• 8ch 10bit A/D, 33 I/Os, I2C, 2 x
RS232, interrupts, sleepmode,
pre-emptive multitasking, easy to
attach LCD or keypad.
• CANbus adapter—recompile or log
data over huge network!
Inc.
716-425-3753 • Fax: -3835
www.saelig.com • saelig@aol.com
Customer list inc: Intel,
Compaq, Philips, NEC,
Kodak, Nokia, US military,
Microsoft,
Dell, Xerox,
universities, T.I., Lucent,
Dalsa, Harris, Litton,
Sony, J&J, Thomson, etc.
CANboards
by J
a
fo nz
com r all
pute
rs
SMD PCB adapters
for prototyping
USB ic’s
RS232 <> USB easily!!
Hi ! I ’ m A l a n L o w n e .
In 1988, I started Saelig (Olde
English for “happy, prosperous &
blessed” -- which is what I want my
customers to be!) to bring unique,
easy-to-use control and instrumentation products to USA from Europe.
We are noted for our
great after sales
support. Call toll-free
at 1-888-7SAELIG for
free advice in solving
your s p e c i f i c c o n t r o l
o r m e a s u re m e n t
problem.
SILICON
UPDATE
Tom Cantrell
SoC Hop
t
The latest
in the SoC
business is
a new
branch off
of the Cypress
Semiconductor tree.
With an affordable
PSoC in the Cypress
MicroSystems lineup,
it’s clear that the new
guy doesn’t intend to
ride the pine for long.
84
Issue 128
March 2001
he field-programmable SoC
(System-on-a-Chip)
that combines a CPU
with programmable logic continues to
be a hot topic around the engineering
department water cooler. These parts
can be a huge win for small- and
medium-volume customers who want
to exploit the single-chip custom integration possibilities, but don’t have
the time, know-how, budget, or volume to commit to an ASIC.
The challenge for designers is to
sort through the growing list of
emerging parts to find the best fit.
At one extreme, the entire SoC can
reside in a standard FPGA, so-called
soft-core chips. Useful examples of
this approach can be found in Jan
Gray’s article, “Building a RISC
System in an FPGA” (Circuit Cellar
116), in which he describes a practical
16-bit RISC that fits easily in a small
Xilinx FPGA. More recently, I
explored the NIOS core offered by
Altera in “Excalibur Marks the Spot”
(Circuit Cellar Online, August 2000).
Then there are the hard-core SoCs
that combine a hardwired CPU core
with a chunk of programmable logic
on a single chip. In “SoC it to Me,”
(Circuit Cellar 116), I described
Triscend as one of the earliest pioneers of this approach with its ’51and ARM-based units, along with
Atmel’s AVR-based FPSLIC (“Atmel
Gets Huge,” Circuit Cellar Online,
January 2000). Subsequently, FPGA
suppliers like Xilinx and Altera have
made CPU licensing deals (PowerPC,
ARM and MIPS, respectively) to stake
out their own hard-core claims.
Most recently was the coming-out
party for Cypress MicroSystems,
which is this month’s subject. The
Washington-based startup is a spinoff
from Cypress Semiconductor, a company almost as well-known for its
chip-making skills as for the antics of
its outspoken founder, T.J. Rodgers.
Ultimately, it looks like T.J. is giving Cypress MicroSystems some seed
money and, more importantly, access
to Cypress Semi’s capacity and nifty
PSoC blocks
Flash
program
memory
Voltage
reference
Figure 1—Here’s
a new chip from
an (almost) new
company.
Cypress
MicroSystems’s
PSoC brings two
gifts to the quickly
emerging fieldprogrammable
SoC market, analog capability and
a practical price.
X1
X2 32-kHz crystal
oscillator
Internal 32-kHz
oscillator
Watchdog
timer
Sleep
timer
M8C
8-bit
microcontroller
core
Precision oscillator
and
PLL
Temperature
sensor
Brownout
detection
Power-on-rest
control
Address / data
Interrupt
controller
SRAM
CIRCUIT CELLAR®
Address / data
Analog
PSoC blocks
Programmable
interconnect
Digital
PSoC blocks
Decimator
MAC
multiply / accumulate
General-purpose
I/O
Internal I/O bus
Pin-by-pin configurable
I/O transceivers
Total I/O pin count
varies by device
www.circuitcellar.com
Operating frequency
Operating voltage
Program memory (KB)
Data memory (bytes)
Digital PSoC blocks
Analog PSoC blocks
I/O pins
External switch
mode pump
Price (1K)
Available packages
8C25122A
8C26233A
8C26443A
8C26643A
94 KH–24 MHz
2.7–5.5 V
4
128
8
12
6
No
94 KH–24 MHz
2.7–5.5 V
8
256
8
12
16
Yes
94 KH–24 MHz
2.7–5.5 V
16
256
8
12
24
Yes
94 KH–24 MHz
2.7–5.5 V
16
256
8
12
40/44
Yes
$1.76
8 PDIP
$2.21
20 PDIP
20 SOIC
20 SSOP
$2.79
28 PDIP
28 SOIC
28 SSOP
$3.53
48 PDIP
48 SSOP
44 TQFP
process technology. It’s a smart move
to take the spinoff approach because
doing SoC business is far different
than selling a standard memory or
logic chip, what with all the extra
tools, support, and such. It also fits
well with Rodgers’s espoused “give
’em rope” management philosophy.
Table 1—The PSoC lineup consists of
four parts differentiated by the amount
of memory and number of available I/O
pins. The price is definitely right.
then you had to remember to turn the
option off when you were defining a
block of data (e.g., look-up table) that
happened to cross the boundary.
Although not a RISC by conventional standards, the original M8 had
a reduced instruction set. Every
instruction fit in one or two bytes, a
M8 FOR LIFE
worthy achievement, but one that
Cypress Micro also inherits the M8
sacrificed easy and efficient coding.
8-bit CPU core first used in the
SPLIT PSOC
Finally, there were a few gotchas
Cypress Semi USB chip I wrote about
The CY8C25xxx/26xxx (a.k.a., the
that, truth be told, fell more under
in “USB Micro” (Circuit Cellar 88).
PSoC (see Figure 1)) is roughly compathe heading of mistakes than comproOriginally designed as the brains of
rable to the Triscend and Atmel parts
mises. For instance, in its first incara mouse, the M8 was minimalist
in that it combines a hardwired 8-bit
nation, the RET instruction automatiindeed. I wrote at the time that it
CPU core with a complement of flash
cally restored the C and Z flags from
reminded me of the ’6502 because it
memory and programmable logic.
the stack, eliminating the time-honrelies on a single accumulator (A) and
However, the PSoC does shake up the
ored method of using them to return
index register (X), but in retrospect
status quo in more than a few ways,
information to the calling routine.
that may have been overly generous.
starting with the price.
This brings us to the IPRET
I’m all for keeping it simple, but the
As shown in Table 1, you’re only
instruction that wrote the accumulaoriginal M8 probably pushed the contalking a few bucks for even modesttor to a register, popped the accumucept a bit too far.
volume orders! This is profound given
lator off the stack, and performed a
For instance, in that A version of
the fact that the norm up until now
RET. Why such an oddball instructhe core, only the low-order 8-bits of
has been double-digit price tags, and
tion? Well, there’s no sense placing
the program counter automatically
even triple digits for the whizziest 32too much marketing finesse on it.
increment, requiring insertion of a
bit units.
IPRET simply hacked the last three
special XPAGE instruction to increField-programmable SoC has been
instructions of a typical interrupt
ment the PC across an 8-bit page
held back by unrealistically high
service routine into a single atomic
boundary. Sure, the assembler had an
prices. You have to give Cypress
operation (i.e., cannot be interrupted)
option to do it automatically, but
Micro credit for being the first to
as the only way to ensure
compete dollar for dolagainst creeping stack
lar with traditional
MUL_DH
death caused by interrupt
MCUs.
MUL_DH
MUL_X or MAC_X
To
overrun.
Another PSoC innointernal
Multiplier
Live and learn is the
vation further reflects
system
ACC_D3
ZOUT, 16 bit
bus
MUL_Y or MAC_Y
name
of the chip game.
that ambitious goal.
ACC_D2
16 bit
32-bit
The third generation of
These days, practically
ACC_D1
accumulator
ACC_D0
the core that lives in the
every MCU comes with
PSoC, which is called the
some analog features, be
M8C, addresses these conit an A/D converter,
ACC_CL1
32-bit ACC
cerns. Actually, it’s differpower monitor, or even
ACC_CL0
ent mainly because of
a temperature sensor. It
Figure 2—Like a motorcycle or car, when it comes time for a DSP drag race, the PSoC
fleshing out the instrucdoesn’t make a lot of
high-speed multiplier leaves bigger chips in the dust.
tion set with three-byte
sense to integrate all the
www.circuitcellar.com
digital stuff in a SoC, only to have to
then add external analog chips. The
PSoC addresses the fact that the
embedded world goes beyond ones
and zeroes by adding programmable
analog logic to the mix.
CIRCUIT CELLAR®
Issue 128
March 2001
85
instructions and reworking
with four selections (512, 64,
the I/O and interrupt schemes
8, and 1 Hz). In turn, the
(say farewell, IPRET).
watchdog timeout is automatNevertheless, it’s still by
ically set to three times the
no means a bloated chip, and
sleep timer interval.
performance pretensions are
The PSoC includes a precigenerally modest. The fastest
sion bandgap voltage referinstructions take four clocks
ence as the basis for power
and the slowest take more
supply monitoring and user
than a dozen, with an average
analog circuits. The
of around six to eight for typbrownout trip voltage feaical programs. Running at the
tures eight programmable
24-MHz maximum clock
levels, four each (92%, 88%,
rate, that leaves three to four
84%, and 89%) for 3.3- and
MIPs on tap, which is pretty
5.0-V systems.
much the sweet spot for 8-bit
I mentioned the wide operPhoto 1—Building your application-specific PSoC is a point-and-click affair with
applications.
ating
voltage earlier. Larger
Device Editor software.
On the other hand, the
members of the family
specification requires factory calibraPSoC does boast a high-speed MAC
(except the 8-pin version) include a
tion, and the design handles the wide
(multiply and accumulate) function. It
novel switch mode pump (SMP) pin
voltage range of the part (2.7 to 5.5 V)
isn’t built into the core as an instrucfor battery-driven applications. With
in a clever way. At powerup, two faction, but rather it is an I/O-driven
the addition of an external inductor
tory calibration constants (one for 3.3
add-on (see Figure 2). Software simply
and diode, the part will start up propV and one for 5 V) are placed in the
writes the 8-bit X and Y operand regerly at 1.2 V and then operate down
top two locations in SRAM. The first
isters corresponding to the desired
to 0.9 V. At power-on reset, the SMP
task for user software is to program
operation (i.e., MUL or MAC), and the
will pump and regulate VCC to 5%
the appropriate calibration constant
result registers (16-bit MUL or 32-bit
above the aforementioned brownout
into an oscillator trim register.
ACC, respectively) are updated autotrip voltage. Unlike parts that run at
A number of onboard clocks are
matically (in the words of the
low voltages, external I/O levels are
derived from the basic 48-MHz and
datasheet, “immediately”).
maintained, flash memory can be pro32-kHz sources. The CPU clock passgrammed, and so forth because the
es through an eight-selection divider
pump boosts the voltage to a normal
PIN POWER
covering the power-of-two range from
operating range.
As far as peripherals go, the PSoC
the top speed of 24 MHz all the way
Speaking of programming flash
comes in the form of a blank slate
down to 93.75 kHz. Software can
memory, the PSoC follows the latest
from the factory, so almost all the
change the divide selection at any
trend of incorporating on-chip ROM
pins start out with a general-purpose
time without concern. There’s also a
code to handle the messy details. It’s
I/O hat on. With GPIO, pin drive
sleep timer based on the 32-kHz clock
simply a matter of setting up paramecharacteristics are individually prothat generates a periodic interrupt
ters and data in SRAM, putting a code
grammable as strong, resistive, or
high-Z. Each pin can also act as an
interrupt input (sharing a common
User module
Availability
Analog user module
Availability
vector) with optional rising, falling, or
8-bit timer
Release 1
6-bit SAR ADC
Release 1
any edge assertion.
16-bit timer
Release 1
9-bit SAR ADC
Q1/2001
In all parts, two pins are available
24-bit timer
Release 1
8-bit incremental ADC
Release 1
for optional connection to a 32-kHz
32-bit timer
Release 1
10-bit incremental ADC
Q1/2001
watch crystal. However, there’s a
8-bit counter
Release 1
12-bit incremental ADC
Q1/2001
16-bit counter
Release 1
8-bit delta-sigma ADC
Release 1
good chance you won’t need one
24-bit counter
Release 1
12-bit delta-sigma ADC
Q1/2001
because the PSoC includes both low32-bit counter
Release 1
6-bit DAC
Release 1
(32-kHz nominal) and high-speed (48PWM
Release 1
9-bit DAC
Q1/2001
MHz) oscillators onboard.
Serial transmitter
Release 1
Differential comparator
Release 1
Serial receiver
Release 1
2-pole high-pass filter
Release 1
As is usually the case with on-chip
Full UART
Release 1
2-pole low-pass filter
Release 1
oscillators, the low-speed unit specs
SPI master
Release 1
2-pole band-pass filter
Release 1
are less exact, with only ±20% accuraSPI slave
Release 1
2-pole notch filter
Release 1
cy across voltage and temperature.
CRC generator
Release 1
Gain stage
Release 1
Pseudo random
Release 1
3-pole (or higher) filters
Q1/2001
However, the high-speed oscillator
number generator
is another story, achieving an
admirable ±2% accuracy over speed
Table 2—The growing list of Cypress-supplied user functions is already sufficient to meet the needs of most
and temperature. Meeting this tight
embedded applications, and the price for this IP (practically free) is definitely right.
86
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
Photo 2—The PSoC development kit includes the
Device Editor software and an emulator that connects
to an 8-, 20-, 28-, or 48-pin pod (28-pin shown here).
At only $125 for the kit (plus $45 for the pod of your
choice), the PSoC kit is practically an impulse buy.
Just do it!
for the desired operation in the accumulator, and issuing the SSC (system
supervisor call) instruction. Flash
memory operations are performed on
64-byte blocks and each block can be
protected against external read, and
external and internal write. The preliminary datasheet mentions 100,000
erase and write cycle endurance on
the front cover but doesn’t include
other specs, such as write and erase
time or data retention.
HAVE IT OUR WAY
and software drivers in a matter of
minutes. PSoC development is cheap
and easy with the low-cost EV kit (see
Photo 2). There’s also a C compiler
available for only $145.
Reflecting the MCU-centric strategy, the architecture underlying the
programmable logic is actually far
more complex than ASIC gates or
FPGA logic cells.
On the digital side of the equation,
the PSoC includes eight function
blocks. It’s kind of a byte-slice
approach, where each block delivers
eight bits of functionality. Longer data
lengths are handled by chaining
blocks together. That means you
could, for example, have eight 8-bit
timers, two 32-bit timers, or any configuration in-between.
Four of the eight digital blocks are
supplemented with communication
functionality (e.g., status bits, parity,
and such) that allows them to function as UART or SPI serial ports.
That’s pretty cool, but it’s the analog programmable logic that really
sets the PSoC apart. It consists of 12
blocks arranged in four columns, with
three types of blocks.
The so-called continuous time
block (see Figure 3) incorporates multiplexers that selectively route the
proper signals (pin, voltage reference,
I/O of another analog block) to the
inputs of a 16-level programmable
gain or attenuation amp. The other
two switched capacitor blocks include
an amp fronted by dual 32-level
Resistor matrix
Is it a CPU with programmable
logic or programmable logic with a
CPU? That’s the question for all these
newfangled SoC parts for the masses,
including the PSoC.
The answer largely depends on
who’s doing the selling, to whom, and
with what kind of tools. Fact is,
where folks stand on the matter is
largely based on where they sit. ASIC
and FPGA types prefer something that
feels familiar and works with their
standard chip design tools.
CC
Then there are other folks
PWR
who just want a slightly
Port inputs
CEN
Block outputs
+
tweaked configuration of an
CBUS
OBUS
–
otherwise typical MCU. No
AGND
VDD
VREF
need for VHDL and such.
F2
P[2:0]
OBUS
Instead, a simple, low-cost,
N[2:0]
OS
OUT
Block inputs
point-and-click chip-builder
GOUT
LOUT
AGND
tool with a library of canned
VREFS
P(IN)
functions is the best call.
AGND
Cypress takes the latter
VREF–
VREF+
approach. Its Device Editor
G
R
software (see Photo 1)
T[2:0]
allows you to browse
F[1:0]
through a library of highSC block
CT block
VSS
AGND
level user functions (see
Table 2) and, with a few
Figure 3—It’s the analog logic blocks, amplifiers with programmable
clicks of the mouse, crank
interconnect and passives that sets the PSoC apart from the crowd
out the configuration data
and allows it to go head-to-head with traditional MCUs.
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
87
switched capacitor arrays with versatile clocking in a summing configuration. These three blocks correspond
with the links (gain, filter, conversion) in the analog signal chain.
The bottom line is that you’ve got a
bag full of op-amps, resistors, and
capacitors that can be lashed together
to build ADCs, DACs, filters, comparators, and so on. A key point is
that the entire programmable logic
configuration is defined in on-chip
registers and can be quickly changed
by software. You can stretch the
mileage of the silicon by reprogramming the logic to perform different
functions over time as an application
switches between different tasks.
most of all, no risk that you’ll have to
eat 10,000 custom ASICs if something
goes awry. Yes, many designers will
demand something with more generically programmable logic. But, I think
there’s also a market for a chip that is
quick and easy to customize for typical applications.
Unlike some of the fancier chips
around, the Cypress parts are a feasible alternative for any designer, even
for those who think a SoC is something you wear with your shoes. I
Tom Cantrell has been working on
chip, board, and systems design and
marketing for several years. You may
reach him by e-mail at
tom.cantrell@circuitcellar.com.
WELCOME ABOARD
I definitely give Cypress MicroSystems credit for having the courage
to step into the MCU fray. Now, the
unique programmable analog capability, along with the practical price,
boosts the credibility of PSoC as a
contender for mainstream sockets.
There’s no need for clip design
expertise, expensive tools, NRE, and
SOURCE
PSoC Designer, CY8C25xxx/26xxx,
M8, Device Editor
Cypress MicroSystems
(877) 751-6100
Fax: (425) 415-1523
www.cypressmicro.com
CIRCUIT CELLAR
CELLAR
CIRCUIT
Test Your EQ
Problem 1—Consider the following closed loop
system withn on-unity feedback
Rs
+
–
K
ss+2
Cs
Problem 2—You have three diodes, A, B,
and C, and you measure their V-I curves
as shown below. What can you say about
the resistances of the three diodes?
I
α
s+3
A
C
B
Let the input be a unit step,.What restrictions on
the value so K and ¥ are needed to ensure that
V
Problem 3—There are two clocks CLOCK1
and CLOCK2 hooked up to pins on an
embedded system. You are provided with a
routine long int ClockValue(long int whichclock) which returns the current clock state.
Write a "C"-program that returns a 1 if
CLOCK1 is faster than CLOCK2 and zero
otherwise.
Problem 4—What are the three things that
the core of a microkernel operating system is
responsible for?
What’s your EQ?—The answers and 4
additional questions and answers are
posted at www.circuitcellar.com
You may contact the quizmasters at
eq@circuitcellar.com
www.circuitcellar.com
8
more EQ
questions
each month in
Circuit Cellar Online
see pg. 2
CIRCUIT CELLAR®
Issue 128
March 2001
89
IDEA BOX
THE
DIRECTORY
OF
PRODUCTS
AND
SERVICES
AD FORMAT: Advertisers must furnish digital submission sheet and digital files that meet the specifications on the digital submission sheet.
ALL TEXT AND OTHER ELEMENTS MUST FIT WITHIN A 2² ´ 3² FORMAT. Call for current rate and deadline information. Send your disk and digital submission
sheet to: IDEA BOX, Circuit Cellar, 4 Park Street, Vernon, CT 06066 or email kc@circuitcellar.com. For more information call Kevin Dows at (860) 872-3064.
Suppliers Directory now available online. Check out our web site
www.circuitcellar.com to see who has what and how to get it!
phyCORE Modules:
TION
GENERATION
NEW GENERA
SINGLE BOARD COMPUTERS
■
■
■
■
■
■
■
Insert-ready sub-mini SBCs (small as 47x55 mm.) supporting the
XAGx, Infineon C167Cx
C167Cx,
Philips 8xC591
8xC591, 89C51Rx2
89C51Rx2, XACx
XACx, XAGx
Motorola MPC555 & ST Microelectronic ST10F168
Low EMI design achieved via GND circuitry, 6 to 8 layer PCB, bypass capacitor grid and short signal traces achieved via small
footprint and use of 0402 SMD passive components
32 KB to 8 MB external SRAM & Flash (controller-dependent)
FlashTools enable on-board in-system (ISP) programming
RS-232, RS-485, I2C & CAN interfaces; ADC; Chip-Select signals
Controller signals extend to standard (2.54 mm.) or high-density
Molex (0.625 mm.) header pins on two sides of the board,
allowing the SBC to be plugged like a "big chip" into targets
Available in Rapid Development Kits including Development Board,
AC adapter, serial cable and SPECTRUM CD with eval software tools
(Keil, TASKING), FlashTools, electronic documentation and demos
PHYTEC America LLC ■ 255 Ericksen Avenue ■ Bainbridge Island, WA ■ USA 98110
www.phytec.com
90
Issue 128
March 2001
CIRCUIT CELLAR®
(800) 278-9913
www.circuitcellar.com
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
91
EMBEDDED INTERNET MADE
EASY! with the
F
DOS StampTM
• Free TCP/IP, PPP,
Mini-server
• Easy to Use
• Low Cost
• Low Power
• Tiny Size
• High Speed
• DOS Environment
rom
$9
Q 9
.100
Easy Software Development: Use your C/C++ or Basic compiler to produce DOS EXE. Download EXE to flash disk via serial
port. EXE runs on power up.
Standard Features: BIOS & DOS-ROM, 128K flash disk,
512K SRAM, 40 MHz AM188ES CPU, 16 digital I/O (opto rack
interface), 2 RS-232, 2 timer/counters, simple bus interface,
real-time clock with timed power-up
Options: 8-ch 12-bit ADC, flash disks up to 288 MB, 1 RS-485
Tiny Size, Low Power: 2”x2.6”, 5V @ 200 mA at full speed.
Visit http://www.bagotronix.com for info, prices, and FAQs
2900-1 Crescent Drive
Tallahassee, FL 32308
850-942-7905 phone & fax
Programmable Controller
Create Your Own Product
Create Your Own Product
Create
Your Module
Own Product
Magic
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Create Your Own Product
Module + Development Kit (MK400) $149.95 ea.
ELK
• Control Machines, Automation,
HVAC, Access, etc.
• 4 Analog/Digital Inputs
• 4 Relay Outputs
• Multiple Timers & Counters
• Powerline X10 Communication
• RS485 Data Bus
• 16K Program Memory
• Free Development Software
Accessories
• 400 Channel Voice Annunciator
• Security Control Interface
• Calendar/Clock Module
• Modem/Printer Interface, Event Buffer
• Access Control Interface (26 bit Wiegand)
800 797 9355 • 828 397 4200 • info@elkproducts.com • www.elkproducts.com
92
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
SI-SCOPE Analyzer
Full featured PC RS232 Analyzer for Windows
and DOS. No more guess work SI_SCOPE lets
you view and interact with any RS232 line.
Complete with Timestamps, Triggers, Signal
Capture, and more!
SI_COMM ActiveX
Robust 32 Bit Communications ActiveX for VC++
and VB. Full Port Control, Async Callback
Events, Xmodem, Ymodem, Zmodem, and more!
Complete with examples in VB and MFC!
Software InnoVations Inc.
72 Prospect Hill Rd.
Wallkill, NY 12589
Ph: 845-566-1919
Fax:845-566-1118
info@sinnovations.com
www.sinnovations.com
PRINTED CIRCUIT
BOARDS
• Design, PCB Fabrication & Assembly
• DS, Multi-Layer, SMT & RF PCBs
• In-house CAM & Photo Plotting and
Electrical Testing
Superior Quality at Competitive Prices
"...your product was delivered on
schedule and was of the highest quality."
R.R. Bell Atlantic Test Systems
Quick Turn ML & SMT
Capital Electro-Circuits, Inc
7845-M Airpark Rd., Gaithersburg, MD 20879
Phone: (301) 977-0303
Fax: (301) 990-6715 BBS: (301) 990-9628
Web: www.capitalelectro.com
email: sales@capitalelectro.com
Call for FREE PCB Buyers Guide
RS232
to Windows
WinWedge inputs real-time
serial data from any device
direct into Excel, Access, VB
or any Windows program.
www.taltech.com
New CE
version!
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
93
Micros, Robots & Kits
Easy & Sophisticated robot kits
Program in Assembly, Basic, C & Progo™
$30 Off
A Robot Kit
Talrik™ Jr Pro Robot
Mention coupon #cc103
One offer per household
Not Valid w/ other offers.
Expires 4/30/01
©2001 Novasoft™, Inc & Mr Robot™
NEW PRODUCT!
Fastest HC11 Downloader
In The World! Only $19.95
(Download S19 files up to 115,200 baud!)
...
Ultrasonic Sensors $86
16 Servo Control Kit $39
Much More ...
...
Orders: sales@mrrobot.com
1-888-Mr-Robot or 804-272-5752
Catalog: www.MrRobot.com
Email: sales@picofab.net
94
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
Home Automation
*LYH<RXU3URGXFW(WKHUQHW7&3,3
µ[µ
VPDOOHU
WKDQ3&
,QWHO(;
.%65$0
.%)ODVK
'LVN2Q&KLS
0%WR0%
%$6(7
(WKHUQHW'26
7&3,3
LQFOXGHG
56
9ROW3RZHU
'LJLWDO,2·V
3&6HULDO3RUWV
-. PLFURV\VWHPV
—)ODVK7&3
4W\
'HYNLWVDYDLODEOH
www.jkmicro.com/uflash
Call 530-297-6073
Fax 530-297-6074
Puzzled over which
Modem to buy?
•
•
•
•
•
14.4k, 33.6k, & 56k V90 versions
60 ma. typical power required
56k version @ $185 quantity 1
Extra available RS-232 port
Rugged PC/104 form factor
Since 1985
OVER
16
YEARS OF
SINGLE BOARD
SOLUTIONS
www.emacinc.com
Phone 618-529-4525 Fax 618-457-0110
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
95
PCI ISOLATED
SERIAL I/O ADAPTER
◗ PCI Two port RS-232/422/485 serial adapter
◗ 500V true port-to-port isolation ◗ Free Technical Support
◗ Automatic RS-485 driver enable or RTS ◗ Made in USA
◗ Standard PC data rates up to 460K bps
◗ Simple installation with included software
◗ Single and quad port versions available
Discover why industry leaders rely on Sealevel Systems’ Serial I/O
and Digital I/O control products. Visit our website or call today for
a free catalog or CD.
Sealevel Systems, Inc., 155 Technology Place, Liberty, SC 29657
email: support@sealevel.com fax: 864.843.3067
864.843.4343
© 2001 Sealevel Systems Incorporated
96
Issue 128
March 2001
CIRCUIT CELLAR®
www.sealevel.com
www.circuitcellar.com
RS232/RS422 Converter
New
Port
powered
• Full duplex
• 422 or 485 4 wire
• Short haul modem
up to 5000 feet
• Supports up to 40
RS422 devices
Easy to use converter adapts any
RS232 computer to RS422 or 4 wire
RS485. Using two twisted pair wire the
ADA422L will support up to 40 devices
at distances up to 5000 feet. Power is
obtained from the RS232 signal lines.
$84.00 quantity 1.
OEM discounts.
Connecticut microComputer, Inc.
PO BOX 186, Brookfield,CT 06804
(203)740-9890 Fax:(203)775-4595
www.2cmc.com
code CC60
Touch Screen 6”
Windows & Microsoft Are Registered Trade Marks Of
Microsoft Corp.
100 Mhz CPU
1/4 VGA
320 x 240
Embedded Computer
FREE!
Visual Basic
Visual C++
Embedded Tools From Microsoft.
100 % Ready to program using the
latest Microsoft 32-Bit Embedded tools.
Built-in Remote Debug and Touch
Screen makes this complete package
easy to use. For More Information and
Pricing Visit Our Web Site.
www.RLC.com
Enterprises, Inc.
Toll Free 1-888-RLC-TECH
www.circuitcellar.com
Features
Elan SC-400 ( 486 100Mhz )
Solid State Disk
Serial Ports ( 3 )
Printer Port
Digital I/O ( 16 )
Analog Inputs ( 6 ), 12 Bit
PCMCIA Card Interface
CIRCUIT CELLAR®
Issue 128
March 2001
97
NuDAQ.com
PC Based Data Acquisition & Control Products
PCI-9812, 20 MHz Simultaneous
4-Ch Analog Input Card
PCI-7300A, Ultra-High Speed 32-Ch
Digital I/O Card
LABView,® HP-VEE,® IF Software, DLL’s, InTouch, ® Win 95/98/NT
Visit www.NuDAQ.com for EXTENSIVE DETAILS. Much broader selection online!
Circuit Specialists, Inc.
since 1971
1-800-528-1417/ Fax: 480-464-5824
Books by engineers,
for engineers.
www.LLH-Publishing.com
www.LLH-Publishing.com
Check out our ever-expanding
list of technical books, eBooks,
ePapers, eLectures, and
eCourses on embedded
systems design, DSP, wireless
communication, PCI bus, and
much more!
For a FREE ePaper on PICs and
PICBASIC, link to
www.LLH-publishing.com/FREEePaper.htm
98
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
Want to learn to program the PICmicro?
Get Sirius with our new PMDS 2!
Need to quickly get up to speed on the PICmicro®? We’ve made
our award-winning PICmicro development system even better. The
new PMDS 2 microcontroller development system includes
everything you need for program development, education, experiments,
or control applications using PICmicro microcontrollers. The professional pack
comes with an EPIC-MDS programmer for
unparallelled versatility, or add a PREP development board for robot education, or a
Quick-MDS for prototyping.
The PMDS 2 Professional Pack Includes:
• 2 PICmicros: the PIC16F84 & the hot new PIC16F876
• 2X16 LCD, keypad, analog pots, analog reference adjust,
buffered port probe, RS-232 port, 4k I2C™ and Microwire®
serial EEPROMs, 2 servo outputs, IR receiver, & in-circuit
programming port for the EPIC-MDS programmer
• a user-friendly manual with lots of diagrams and code examples
• all adapters and cables–there’s nothing left to buy!
www.siriusmicro.com
www.circuitcellar.com
CIRCUIT CELLAR®
EPIC is licensed by microEngineering Labs.
PIC, PICmicro and Microwire are registered
trademarks of Michrochip Technology Inc. in
the USA and other countries.
172 Harvard Road
Waterloo, ON, N2J 3V3 Canada
519.886.4462 519.886.4253(fax)
Issue 128
March 2001
99
DATA ACQUISITION & CONTROL
For acquisition and control of digital and analog signals.
High speed Serial Port Interface
24 digital I/O (TTL compatible)
11 Analog Channels with 12 bit ADC
4 channels with signal conditioning
Embedded stepper motor controller
32 bit DLL
67(33(5
02725
SPORT232
&21752/
Control up to 16 stepper motors simultaneously
using a “SINGLE SERIAL PORT”.
Up to 8500 Steps/sec with linear Accel/Decel.
Chopper driver up to 48V/2A for 4,5or 6 wire motors.
Software Winding Current Setup.
Shaft encoder input , external driver capabilities.
Internal FIFO for linear, cubic or spline Interpolation.
24 digital I/O,2 SPI, 11 analog channels on-board.
32 bit DLL with examples in VC++,VBasic and Delphi.
Less than US$100/axis!
9 Channel Data
Loggers from
US$400. Ask us, or
visit our web site.
ST400-NT
RMV Electronics Inc.
230-2250 Boundary Rd.
Burnaby, BC, Canada V5M 3Z3
Tel: (604) 299-5173 Fax: (604) 299-5174
Web site: www.rmv.com
100
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
www.circuitcellar.com
CIRCUIT CELLAR®
Issue 128
March 2001
101
+LJK3HUIRUPDQFH0LFURVWHS0RWRU
'ULYHU&RQWUROOHU$9%LSRODU
3ULFH 47<
47<
3OHDVH&DOOWR2UGHU
• 56&RQWUROOHGRU&DQQHG&\FOHG&RQWUROOHG
• +LJK&XUUHQWGULYLQJXSWR
$PSVDW9'&SHUSKDVH
• 8SWRPLFURVWHSVSHUUHYROXWLRQ
• 6KRUW&LUFXLWDQG2YHU7HPS3URWHFWLRQ
• 3URJUDPPDEOHELWRSWLFDOO\LVRODWHGLQSXWV
• &KDQQHO3URJUDPPDEOHIRU9$QDORJ
,QSXWVRU77//HYHO2XWSXWV
• -R\VWLFNFRQWUROODEOH
• %XLOWLQ$FFHOHUDWLRQ'HFHOHUDWLRQUDPSLQJ
• 6RIWZDUH&XUUHQW$GMXVWPHQWYLD56
• &RPSDFW6L]H[[LQ
7HO
)D[
&6DYL5DQFK3UNZ\
<RUED/LQGD&$
ROBOTS
6LJJ,QGXVWULHV,QF
ZZZVLJJLQGXVWULHVFRP
PROGRAMMABLE
AUTONOMOUS
EXPANDABLE
MINIATURE
KITS
www.divent.com
102
Issue 128
March 2001
CIRCUIT CELLAR®
www.circuitcellar.com
ADVERTISER’S INDEX
The Advertiser’s Index with links to their web sites is located at www.circuitceller.com under the current issue.
Page
Page
Page
80
ADAC
7
Design Logic 2001 Contest
Page
90
102
Abacom Technologies
95
Designtech Engineering
95,96
99
Ability Systems Corp.
99
Diversified Engineering
15
102
Diversified Enterprises
100
25
Dreamtech Computers
64,82
8
101
74,88
Acroname
ActiveWire, Inc.
Advanced Transdata Corp.
44
16
A K Peters Ltd
87
75
All Electronics Corp.
91
Allen Systems
98
Electronic Systems Consuting
91
102
Amazon Electronics
9
Amulet Technologies
91
Andromeda Research
92
70,95
MetalinkCorporation
Micro Digital Inc
Microchip
microEngineering Labs, Inc.
Micromint Inc.
Earth Computer Technologies
21
Midwest Micro-Tek
ECD (Electronic Controls Design)
93
Mosaic Industries, Inc.
EE Tools(Electronic Engineering Tools)
63
Motorola
34,45
MVS
Elk Products
94
Mylydia Inc.
EMAC, Inc.
49
Netburner
102
Netmedia, Inc.
87
Engineering Express
AP Circuits
91
FDI-Future Designs, Inc.
90
Nohau Corp.
Arrick Robotics
23
General Software
94
Novasoft
Atmel Corporation
99
HVW Technologies Inc.
99
Ontrak Control Systems
92
Bagotronix, Inc.
91
Hagstrom Electronics
91
Basic Micro
97
IMAGEcraft
C2
Parallax, Inc.
99
CCS-Custom Computer Services
Peter H. Anderson
100
92
56,57
102
93
24,102
100
98
101
43,97
99
101
50
CSMicro Systems
Capital Electro-Circuits, Inc
Ceibo
Cermetek Microelectronics, Inc.
Circuit Specialists
Conitec
Copeland Electronics Inc.
Cyberpak Co.
IndustroLogic, Co.
Intec Automation, Inc.
90
Phytec America LLC
58
Interactive Image Technologies Ltd.
96
Phyton, Inc.
94
Intronics, Inc.
94
Picofab Inc.
Prairie Digital Inc.
94
93,94
Island Logix
94
JK microsystems
96
Pulsar Inc.
JR Kerr Automation & Engineering
89
R4 Systems
Jameco
91
R.E.Smith
LLH Technology Publishing
97
RLC Enterprises, Inc.
100
RMV Electronics Inc.
Lemos International
79
Rabbit Semiconductor
2
Link Instruments
23
Remote Processing
96
Lynxmotion Inc.
99
SMTH Circuits
MCC (Micro Computer Control)
83
Saelig Company
92
65,95
69
13,77,98
97,98
Cygnal Integrated Products
39
Dallas Semiconductor
97
Data Design Corp.
C4
Dataman Programmers, Inc.
94
Decade Engineering
PCB Express, Inc.
98
37
Connecticut mircoComputer Inc.
100
29
100
96
Laipac Technology, Inc.
5
MJS Consulting
96
Sealevel Systems Inc.
94
Senix Corp.
102
Sigg Industries
90
Signum Systems
98
Silverline Power Conversion
99
Sirius MicroSystems
95
SmartHome.com
93
Software InnoVations
32
Solutions Cubed
90
Square 1 Electronics
93
65,71
101
TAL Technologies
Technologic Systems
Technological Arts
C3
Tech Tools
97
Tern Inc.
17
Texas Instruments
76
Trilogy Design
45
Trinity College Robot Contest
93
Vantec
92
Vetra Systems Corp.
21
Virginia Tech Tranport Inst.
101
1
Weeder Technologies
Wilke Technology GmbH
76
Xelos
43
Xilor Inc.
95
Z-World
93
100
31
Zagros Robotics
Zanthic Technologies Inc.
ZiLOG
Scott Edwards Electronics Inc.
DDSGEN: A High-Performance DDS Generator: Part 1
Flash Gang Programmer for Microcontrollers
A Sure Thing: Guaranteeing 99.99999% Reliablity
Selecting the Right Microcontroller Unit
PIC This Lock
A Single-Chip PN Sequence Generator
I Above the Ground Plane: Have You Seen the Light?
I From the Bench: See Through the FOG Using Fixed-Point Calculation:
Fiber Optic Gyros
I Silicon Update: Motor City MCU
EPC Applied PCs: Just Like in the Movies—Working with SBC-386EX-S
Embedded Applications
www.circuitcellar.com
CIRCUIT CELLAR®
W
E
I
V
E
R
P 129
Issue 128
March 2001
103
PRIORITY INTERRUPT
One Man's Junk
c
ertainly you’ve heard the old expression that one man’s trash is another man’s treasure. In fact, there’s
a bit of a joke about that around my neighborhood. It seems that I have the best junk. Seldom does any of
it ever make it to the trash truck.
When I decide I’m cleaning out the cellar or a garage bay, I don’t post garage sale signs or lug stuff out to the
curb. All I do is put out the word and lots of “friends” suddenly show up to help. The smarter friends bring pickup trucks because
they end up taking a lot home with them. The standing rule is that if you want anything in the box you have to take the whole box.
Don’t get the wrong impression. I don’t live in a pile of junk. I’ve just collected a lot of excess stuff over the years and fortunately I
have lots of storage areas. I affectionately call it junk, but it certainly isn’t trash in the classical sense. Mostly these are things that I
thought I might use someday, but didn’t actually have a project when I obtained them. There’s that 100' roll of aluminum tubing, the
large box of surplus magnetic flux sensors (intended to be driveway sensors), the half dozen or so 3-ton hydraulic jacks, the 5-HP
trash pump, the C-band satellite receiver (new in the box) and 24² Sony color monitor, the special cassette player designed for fast
playback without the “chipmunk” voice, the crate of 2-lb tubes of lithium grease, the electric fence, the case of sterno…. The list
goes on and on.
This unique waste management system has worked fine for years and up to now I’ve never had any problem disposing of my
crated excesses. I just make sure my “gift” boxes contain something like a 5-gallon can of roofing tar, winter tire chains, shortwave
radio, or some other great “guy stuff.” Trash or treasure, you name it. It all miraculously disappears. That was, of course, until now.
There was a joke circulating that asked what people would do if the government charged a $1000 per year tax on a personal PC
and required people to buy a new one every two or three years. Obviously there would be rioting in the streets. The punch line of
the joke was that paying this kind of money and adhering to such replacement insanity is exactly what we all smile and gladly do
for Bill Gates. Whether we are happy or not about why we do it, the unfortunate side effect is that we are all constantly replacing
computers and peripherals. We’re knee-deep in obsolete electronics and we can’t get rid of it. That’s my new problem.
There are more than 400 million PCs in use with about 50 million obsolete ones looking for disposal soon. I’m not so much worried about the where, I’m more concerned about the when and the how. It seems like no amount of incentive can get rid of obsolete
PCs these days.
There was I time when disposal meant that we just threw things away. Put the trash at the end of the driveway and someone
carted it off. The problem now is that many communities have determined that PCs are not as recyclable as we might like them to
be. In fact, states such as Massachusetts have banned the disposal of CRTs entirely. Disposing of cathode ray tube computer monitors has long been a messy affair anyway. For starters, they contain a mind-boggling number of toxic chemicals, including significant amounts of lead (as much as 27%). Estimates suggest that roughly 75% of obsolete electronics end up in storage, 15% or so
go to the dump, and about 7% are refurbished or reused. That leaves us with a grand total of only 3% being recycled for basic
materials.
I suppose it’s humorous and ironic that for most of us, PC waste management is a lot like nuclear power industry waste management: find someplace to store it forever or pass it off to somebody else to hide. The future will certainly be helped by the evolution
of green computers that are less hazardous, but we need to make a concerted effort at solving the present disposal problems too.
The pile of obsolete equipment in the Circuit Cellar keeps getting higher and higher. Apparently it’s not enough to throw in a roll of
roof flashing and a paint sprayer to make the whole box disappear anymore.
steve.ciarcia@circuitcellar.com
104
Issue 128
March 2001
CIRCUIT CELLAR
www.circuitcellar.com
TechTools
Innovative Tools for Rapid Embedded Development
Our New Products are
R.E.D.
Ü Rapid Embedded Development tools from TechTools
In-Circuit Firmware Development with SPEED.
-4!
• 2000 Support
• 3-5 Volt Target
Support
EconoROM ™III
Economical EPROM Emulator
ER3 is designed for quick, in-circuit firmware test cycles.
ER3 will speed up your firmware
development by eliminating the need
to remove-erase-program and reinstall EPROMs each time you
test a code change. These
devices plug into the EPROM
socket on your target board
and emulate the EPROM
throughout the development
process.
Voltage
Measurement!
2.5 Mbps
Download!
New FlexROM II, III and EconoROM III interface
now supports multiple file projects with “1-Click”
file conversion and downloading.
We provide software that loads your
firmware code into the emulator in a matter of
seconds! No more waiting for the eraser or
EPROM programmer. No more “debugging” bent
pins or bad EPROMs.
Up to
1MByte
per unit.
.4!
Up to
32MByte
per unit.
Voltage
Measurement!
Active
Cables
QuickLoader™ Version 3.0
FlexROM ™III
FLASH, EPROM & SRAM Emulator
NEW Active
Cables!
FR3 is a Flexible, in-circuit memory Emulator with instrumentation.
FlexROM emulators provide engineers with a flexible
development tool for any Embedded project that uses an
external FLASH, EPROM or SRAM device.
Increase productivity by downloading firmware code or
data into the emulator at 2.5 Mbits per second. Set an
Address Trigger, measure the Target’s voltage level and
see the Target’s address fetches with FR3’s Hardware
Instrumentation.
Adapt easily to new target
technologies with FR3’s
Active Cables.
Increased productivity, always available hardware Instrumentation and adaptability make FlexROM a very powerful tool.
Our PICmicro® Development Tools are also R.E.D.
PICmicro® In-Circuit Emulator
DATA
Breakpoints
on ALL 14bit
Devices!
ClearView™ Mathias fully emulates the selected
PICmicro, including program memory, register
memory, EEPROM, I/O activity, SLEEP mode and
ALL peripherals.
Mathias includes TDE™ (TechTools Design Environment), a highly productive Development and Debugging Environment with full source-level support
for all popular Assemblers and C Compilers.
TechTools Complete Development System with integrated
ClearView debugger will save you days or even weeks of
development time!
For a complete product listing, optional modules, pricing and evaluation software, visit our WEBSITE:
www.tech-tools.com, Email: sales@tech-tools.com or
CALL:
(972) 272-9392
PICmicro is a registered trademark of Microchip Technology Inc., Windows and Windows NT are registered trademarks of Microsoft Corporation. ClearView, PICwriter, CVASM16,
EconoROM, FlexROM, UniROM, VCOM, URCOM, Bank Shadowing, TechTools and the "Wizard" symbol are trademarks of TechTools, P.O. Box 462101, Garland,Texas 75046-2101.
All other trademarks are trademarks or registered trademarks of their respective companies.
STILL THE WORLD’S MOST
POWERFUL PORTABLE
$795
inc 4mb ram
PROGRAMMERS?
NEW MODEL
$1295
Surely not.
Surely someone somewhere
has developed a portable programmer that
has even more features, even greater
flexibility and is even better value for
money.
Actually, no. But don’t take our word for
it. Use the feature summary below to see
how other manufacturers’ products compare.
DATAMAN-48LV
• Plugs straight into parallel port of PC or
laptop
• Programs and verifies at 2, 2.7, 3.3 & 5V
S4 GAL MODULE
• True no-adaptor programming up to 48
pin DIL devices
• Programs wide range of 20 and 24 pin
logic devices from the major GAL vendors
• Free universal 44 pin PLCC adaptor
• Supports JEDEC files from all popular
compilers
• Built-in world standard PSU - for goanywhere programming
• Package adaptors available for TSOP,
PSOP, QFP, SOIC and PLCC
• Optional EPROM emulator
DATAMAN S4
• Programs 8 and 16 bit EPROMs,
EEPROMs, PEROMs, 5 and 12V FLASH,
Boot-Block FLASH, PICs, 8751
microcontrollers and more
• EPROM emulation as standard
• Rechargeable battery power for total
portability
• All-in-one price includes emulation
leads, AC charger, PC software, spare
library ROM, user-friendly manual
• Supplied fully charged and ready to use
MONEY-BACK
30 DAY TRIAL
If you do not agree that these truly are the
most powerful portable programmers you can
buy, simply return your Dataman product
within 30 days for a full refund
SUPPORT
• 3 year parts and labor warranty
• Windows/DOS software included
• Free technical support for life
• Next day delivery - always in stock
Orders received by 4pm will normally be despatched same day.
Order today, get it tomorrow!
Still as unbeatable as ever. Beware of
cheap imitations. Beware of false
promises. Beware of hidden extras.
If you want the best, there’s still only one
choice - Dataman.
Order via credit card hotline - phone
today, use tomorrow.
Alternatively, request more detailed
information on these and other marketleading programming solutions.
Dataman Programmers Ltd
215 East Michigan Avenue
Orange City, FL 32763
Telephone (904) 774-7785
Fax (904) 774-7796
Home page: http://www.dataman.com
Email: sales@dataman.com
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising