circuit cellar2001 11

background image

7

9

25274 75349

1 1>

CIRCUIT

CELLAR

®

ww

ww

ww

..cc

iirr

cc

uu

iitt

cc

ee

llll

aa

rr

..cc

oo

mm

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

$4.95 U.S. ($5.95 Canada)

# 1 3 6 N O V E M B E R 2 0 0 1

WIRELESS COMMUNICATIONS

Off To The Races With RF

Wireless Weather Station

How To Measure RF Field Strength

Sorting Through IR Technology

background image
background image
background image

Digital Oscilloscopes

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

DSO-2102S

$525

DSO-2102M

$650

Each includes

Oscilloscope,

Probes, Interface Cable, Power
Adapter, and software for
Win95/98, WinNT, Win2000
and DOS.

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

www.LinkIns4.com

Link Instruments

369 Passaic Ave

Suite 100

Fairfield, NJ 07004

(973) 808-8990

Fax (973) 808-8786

Logic Analyzers

• 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

All prices include Pods and Software

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

3

An RF Lap-Scoring System

Pete Cross

Robot Sensor Controller Board
Part 2: How The Brain Works

Daniel Ramirez

Build a Wireless Weather Station

Jerry Wasinger

Measuring RF Field Strength

SE Nickols

Sucessfully Choosing IR Technology

Bruce Reynolds

I

APPLIED PCs
PICing a Place on the LAN

Fred Eady

I

FROM THE BENCH

Probe This

Jeff Bachiochi

I

SILICON UPDATE
The Last Micro?

Tom Cantrell

COLUMNS

ISSUE

Guest Task Manager

Ingo Cyliax
One Man’s Trash...

New Product News
edited by Rick Prescott

Test Your EQ

Advertiser’s Index
December Preview

Priority Interrupt
Steve Ciarcia
Moving Forward

4

8

82

94

96

136

50

68

74

FEA

TURES

10

20

34

44

58

background image

CIRCUIT CELLAR

®

www.circuitcellar.com

EDITORIAL DIRECTOR/PUBLISHER

Steve Ciarcia

WEB GROUP PUBLISHER

Jack Shandle

MANAGING EDITOR

Rob Walker

EDITORIAL PRODUCTION COORDINATOR

Jennifer Huber

TECHNICAL EDITORS

Jennifer Belmonte

WEST COAST EDITOR

Tom Cantrell

CONTRIBUTING EDITORS

Ingo Cyliax
Fred Eady
George Martin
George Novacek

NEW PRODUCTS EDITOR

Rick Prescott

PROJECT EDITORS

Steve Bedford
David Tweed

ADVERTISING

ADVERTISING SALES MANAGER

Kevin Dows

Fax: (860) 871-0411

(860) 872-3064

E-mail: kevin.dows@circuitcellar.com

ADVERTISING COORDINATOR

Valerie Luster

Fax: (860) 871-0411

(860) 875-2199

E-mail: val.luster@circuitcellar.com

ADVERTISING CLERK

Sally Collins

Fax: (860) 871-0411

(860) 875-2199

E-mail: sally@circuitcellar.com

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.

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.

For information on authorized reprints of articles,

contact Jeannette Ciarcia (860) 875-2199 or e-mail jciarcia@circuitcellar.com.

Circuit Cellar® makes no warranties and assumes no responsibility or liability of any kind for errors in these programs or schematics or for the con-
sequences of any such errors. Furthermore, because of possible variation in the quality and condition of materials and workmanship of reader-
assembled 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 con-
struct 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.

CHIEF FINANCIAL OFFICER

Jeannette Ciarcia

CONTROLLER

Howard Geffner

CUSTOMER SERVICE

Elaine Johnston

ART DIRECTOR

KC Prescott

GRAPHIC DESIGNERS

Cindy King

Mary Turek

STAFF ENGINEERS

Jeff Bachiochi

John Gorsky

QUIZ COORDINATOR

David Tweed

EDITORIAL ADVISORY BOARD

Ingo Cyliax

Norman Jackson

David Prutchi

TASK

MANAGER

f you’re like me, you can’t wait to get Circuit

Cellar each month. The first thing I do is flip to the

back of the magazine and read Steve’s “Priority

Interrupt,” then I skip to the front and read Rob’s “Task

Manager,” before going on and reading the articles and browsing the adver-
tisements. You can imagine how honored I felt to have Rob ask me to fill in
for him this month.

As some of you know, until recently I was writing for

Circuit Cellar

and

Circuit Cellar Online

. A job change made writing two columns a little more

difficult, so I had to take a break. I’m currently working at a nuclear research
facility designing front-end electronics for a particle detector. As you may
have guessed, this has nothing to do with Java and embedded systems—
the topics I used to write about. But in a way, it does have to do with
Wireless Communications, this month’s theme.

One of the things that’s becoming quite obvious in almost all aspects of

electronics design is the availability of high-quality components that are
used by the wireless industry. For example, at my new job we rely on a fast
GaAsFet for critical function in a fast integrator circuit. This component is
actually a dual-gate FET, which is commonly used as a mixer in wireless
applications. Without these kinds of components, some of the integration we
desire in our projects is just not possible.

The downside, however, is that these components are normally not

available unless you want to order thousands, or less than five. It’s pretty
easy to get small sample quantities, and sometimes even for free. It’s when
you want to order somewhere in-between sample and production quantities
that these parts are not available. But not all is lost.

Have you ever wondered what happens to all the wonderful wireless

toys after the first year when the next model or new rate plan comes along?
The stuff ends up in the landfill in many cases. Well, where I live, we also
have a community recycling center where you can sometimes find goodies.
It turns out that this is an excellent source of parts for your high-tech proj-
ects and prototypes, if you like to play with surface mount parts and don’t
mind milling through some trash.

Of course, my day job project is going to be built in sufficient numbers to

warrant ordering new components, but scavenging parts for prototypes is
not unheard of even were I work. So head to your recycling center or land-
fill and see what kinds of electronic goodies you can find. You could also
inquire about putting up a box for consumer electronics at the community
recycling center. You can also just ask friends or relatives to notify you
before tossing any electronic devices or gadgets.

My dad used to tell stories about how he scavenged parts from aban-

doned military vehicles to keep the family business’s trucks running during
the post-WWII depression in Europe. I guess I must have inherited the
scavenger genes (along with some of the engineering genes) from him.

Ingo Cyliax

Cover photograph Ron Meadows—Meadows Marketing

PRINTED IN THE UNITED STATES

i

One Man’s Trash...

4

Issue 136 November 2001

Guest

cyliax@iucf.indiana.edu

background image
background image

6

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

READER

I/O

STATEMENT REQUIRED BY THE ACT OF AUGUST 12, 1970, TITLE 39, UNITED STATES CODE SHOWING THE OWNERSHIP, MANAGEMENT AND CIRCULATION OF CIRCUIT CEL-
LAR, THE MAGAZINE FOR COMPUTER APPLICATIONS, published monthly at 4 Park Street, Vernon, CT 06066. Annual subscription price is $21.95. The names and addresses of the
Publisher, Editorial Director, and Editor-in-Chief are: Publisher, Steven Ciarcia, 4 Park Street, Vernon, CT 06066; Editorial Director and Editor-in-Chief, Steven Ciarcia, 4 Park Street, Vernon,
CT 06066. The owner is Circuit Cellar, Inc., Vernon, CT 06066. The names and addresses of stockholders holding one percent or more of the total amount of stock are: Steven Ciarcia, 4
Park Street, Vernon, CT 06066. The average number of copies of each issue during the preceding twelve months is: A) Total number of copies printed (net press run) 26,022; B) Paid
Circulation (1) Mail subscriptions: 15,782; (3) Sales through dealers and carriers, street vendors and counter sales: 7,533, C) Total paid circulation: 23,315; D) Free distribution by mail (sam-
ples, and other free issues): 0; E) Free distribution outside the mail (carrier, or other means): 1,982; F) Total free distribution: 1,982; G) Total Distribution: 25,297; H) Copies not distributed: (1)
Office use leftover, unaccounted, spoiled after printing: 725; I) Total: 26,022. Percent paid and/or requested circulation: 92.16%. Actual number of copies of the single issue published nearest
to filing date is October 2001, Issue #135; A) Total number of copies printed (net press run) 27,999; B) Paid Circulation (1) Mail subscriptions: 18,488; (3) Sales through dealers and carriers,
street vendors and counter sales: 7,351; C) Total paid circulation: 25,839; D) Free distribution by mail (samples, complimentary and other free): 0; E) Free distribution outside the mail (carrier,
or other means): 1,126; F) Total free distribution: 1,126; G) Total Distribution: 26,965; H) Copies not distributed: (1) Office use leftover, unaccounted, spoiled after printing: 1,034; I) Total:
27,999. Percent paid and/or requested circulation: 92.28%. I certify that the statements made by me above are correct and complete. Daniel Rodrigues, Consulting Publisher.

MISSING LINKS

Editor’s Note: There were several URLs that were listed incor-
rectly in the October issue (135). The correct Web addresses
are listed below:

Universal Sensors, p. 37.
http://intel.ucc.ie/sensors/universal/index.html

Reference 6, p. 46.
http://www.eecs.umich.edu/~johannb/pos96rep.pdf

Data Design Corp., p. 53
www.datdesign.com

THE WHOLE TRUTH

I have been a long-time reader of

Circuit Cellar magazine and

Steve’s articles. I am a business man and an embedded design-
er and for me,

Circuit Cellar is the best!

I read Steve’s “Reset Registers” editorial in the August issue

and wanted to say thank you for being honest about your deci-
sions! I respect any business person who is secure enough to be
able to admit he or she makes errors. There is nothing wrong
with that. The problem arises when we try to blame others for
our decisions. Thanks for the magazine and the great staff!

R. LaRagone, VP/GM
FlowMatrix Inc.

background image

(510) 353-1800

OR FAX (510) 353-0990

To order, call

toll free:

M-F 10AM to 6PM PST

1-800-A DREAMER

1-800-237-3263

© November 2001

DreamTech

@

Call for a

custom quote

on your

Dream Computer

www.dreamtech.com

SINCE 1983

40950 Encyclopedia Circle

Fremont, California 94538

e-mail sales@dreamtech.com

DesignER DreamS

Pentium III

Pentium 4

• Intel Pentium 4 Processor

• 256MB PC800 RAMBUS

• 80GB 7200 RPM Hard Drive

• 3.5" 1.44MB Floppy Drive

• Plextor CDRW 40x16x10

• 1 Parallel, 1 Serial, 2 USB ports

• ATI Radeon Vivo 64MB DDR Video Card

• P4 Mid Tower Chassis & 300W PS

• Yamaha Sound Card & 120 WATT Speakers

• Windows 2000, Logitech Wheel Mouse

• Internet Keyboard

• Netgear 10/100 Ethernet Adapter

PROFESSIONAL FILE MANAGEMENT &
BUILT IN SECURITY WITH WINDOWS 2000 ~
A CORPORATE BUYER’S DREAM P4 WITH
80GB HD, ULTRA FAST CDRW, & 64MB VGA.

Dream Profile

800EB

PIII ITEM #2941

$289

866EB

PIII ITEM #2942

$309

933EB

PIII ITEM #3044

$329

1GHz

PIII ITEM #3072

$359

1.4GHz

P4 ITEM #3218

$409

1.5GHz

P4 ITEM #3219

$429

1.7GHz

P4 ITEM #3220

$499

DESIGN YOUR DREAM COMPUTER

FROM THE GROUND UP, OR UPGRADE AN EXISTING SYSTEM.
ASSEMBLED & TESTED UNIT INCLUDES PROFESSIONAL
TOWER CASE, POWER SUPPLY, MAIN BOARD, CPU, FLOPPY
DRIVE & KEYBOARD. ADD RAM, VIDEO, HD, & CD-ROM TO
COMPLETE YOUR CUSTOM DREAM.

Creative computing solutions

built on today’s dependable technology

• Intel Pentium 4 Processor

• 128MB PC800 RAMBUS

• 40GB ATA 100 Hard Drive

• 3.5" 1.44MB Floppy Drive

• Creative Labs 32x8x4 CDRW

• 1 Parallel, 1 Serial, 2 USB ports

• 17" .27 1280x1024 Monitor

• ATI Xpert 2000 32MB AGP Video Adapter

• P4 Mid Tower Chassis & 300W PS

• Yamaha Sound System & 120WATT Speakers

• Windows '98, PS/2 Mouse & Keyboard

• 56K v.90 Lucent PCI Modem w/Fax

Dream Producer 4

1.4GHz

ITEM #3170

$ 969

1.5GHz

ITEM #3171

$ 989

1.7GHz

ITEM #3195

$1069

CREATE, COMPILE & BURN IN A BLAZE ON THIS FAST,
POWERFUL DREAM P4. THE ULTIMATE DEVELOPMENT
SYSTEM AT AN AFFORDABLE PRICE. COMPLETE WITH
CDRW & 17” MONITOR.

Dream XP-

407

1.5GHz

ITEM #3235

$799

1.7GHz

ITEM #3236

$859

1.8GHz

ITEM #3273

$939

• Intel Pentium 4 Processor

• 256MB PC800 RAMBUS

• 40GB 7200RPM Hard Drive

• 3.5" 1.44MB Floppy Drive

• 52X CD-ROM

• 1 Parallel, 1 Serial, 2 USB ports

• 32MB AGP Video Adapter

• P4 Mid Tower Chassis & 300W PS

• Yamaha Sound System & 120WATT Speakers

• Windows 98, PS/2 Mouse & Keyboard

• 56K v.90 Lucent PCI Modem w/Fax

FAST PENTIUM 4 PROCESSOR, 256MB RAM, &
7200RPM 40GB HD MAKE THIS OUR MOST
POPULAR DREAM P4. THE WAIT IS OVER ~
EXPERIENCE THE POWER OF THE PENTIUM 4.

• AMD Athlon 4 Processor, 266MHz Bus

• 256MB DDR PC2100 RAM

• 60GB 7200 RPM ATA 100 Hard Drive

• 3.5" 1.44MB Floppy Drive

• 52X CD-ROM

• ATX Professional Tower Chassis

• 1 Parallel, 2 Serial, 2 USB ports

• 17" .27 1280x1024 Monitor

• ATI 32MB AGP Video Adapter

• Yamaha Sound System & 120WATT Speakers

• Windows 2000, PS/2 Mouse & Keyboard

• 56K v.90 Lucent PCI Modem w/Fax

1.2GHz

ITEM #3259

$ 899

1.3GHz

ITEM #3260

$ 929

1.4GHz

ITEM #3261

$ 949

Dream Venture

PRAISED AS ONE OF THE MOST POWERFUL
PROCESSORS IN THE WORLD, THE AMD ATHLON
IS COMBINED IN THIS COMPUTER SYSTEM WITH 256MB
RAM, 60GB HD, & WINDOWS 2000 TO DELIVER
UNPRECEDENTED COMPUTING POWER ON A BUDGET.

• AMD Duron Processor

• 128MB 133MHz SDRAM

• 20GB UDMA Hard Drive

• 3.5" 1.44MB Floppy Drive

• 52X CD-ROM

• Micro ATX Tower Chassis

• 1 Parallel, 2 Serial, 2 USB ports

• Integrated AGP Video Adapter

• Integrated Sound & 120 WATT Speakers

• Logitech PS/2 Mouse & Keyboard

• 56K v.90 Lucent PCI Modem w/Fax

750MHz

ITEM #3251

$339

800MHz

ITEM #3252

$349

850MHz

ITEM #3253

$369

900MHz

ITEM #3254

$389

Dream E-Series

‘E’ FOR ECONOMICAL - THIS COMPLETE
COMPUTER INCLUDES 128MB RAM, 20GB HD,
SOUND, MODEM, & MOUSE AT AN INCREDIBLY
LOW PRICE. PERFECT FOR RESELLERS.

• Intel Pentium III Processor

• 128MB 133MHz SDRAM

• 40GB UDMA Hard Drive

• 3.5" 1.44MB Floppy Drive

• 52X CD-ROM

• 1 Parallel, 2 Serial, USB & PS/2 Port

• Integrated AGP Video Adapter

• 17" .27 1280x1024 Monitor

• Integrated Sound System & 120 WATT Spkrs

• Windows 98, Logitech PS/2 Mouse

• 107 Enhanced Internet Keyboard

• 56K v.90 Lucent PCI Modem w/Fax

• Micro ATX Tower Chassis

800EB

PIII ITEM #3276

$659

866EB

PIII ITEM #3277

$689

933EB

PIII ITEM #3278

$709

1GHz

PIII ITEM #3279

$749

Dream V-Series

Add WIndows

installed & tested (with

CD & manual),

premier support,

& Logitech mouse

‘98

add

$139

ME

add

$149

2000

add

$169

DRIVES

20G IDE ATA100

$79

30G IDE ATA100

$89

40G IDE ATA100

$99

40G IDE 7200 RPM $109

60G IDE 7200 RPM $159

IOMEGA ZIP DRIVES

ZIP 100M Internal

$59

ZIP 250M Internal

$89

CD ROM DRIVES

CDROM 52X$45

CDRW 32x12x10

$109

CDRW 32x8x4

$89

Plextor CDRW

$169

DVD

$69

VIDEO CARDS

ATI AGP

32M Xpert2000

$59

64M Rage Fury

$119

ASUS

64MB Geforce 3

$389

MONITORS

15" .28 1024

$139

17" .27 1280

$169

19" .26 1600

$239

21" .26 1600

$479

15" LCD Display

$429

AS ABOVE WITH 256MB RAM, 40GB HARD
DRIVE, 32MB VGA & 52X CDROM.
A POWERFUL SYSTEM WITHOUT
UNNECESSARY EXTRAS. TESTED WITH
MOST MAJOR OPERATING SYSTEMS.

800EB

PIII ITEM #3152

$469

866EB

PIII ITEM #3153

$489

933EB

PIII ITEM #3154

$509

1GHz

PIII ITEM #3155

$559

PowerDesigner+

plus

MAIN BOARDS

• Up to 1.5GB using 3x168-pin SDRAM

• UltraATA/100, 2 IDE channels

• Flash Award BIOS

• 133MHz Bus

• 5 PCI, 1 ISA, 1 4X AGP slot

• 2 serial ports & 1 parallel port

• 2 USB interface & 1 PS/2 mouse port

• 305mm X 170mm ATX profile

Pentium

®

III 733EBMHz

#2884

$ 219

Pentium

®

III 800EBMHz

#2943

$ 229

Pentium

®

III 866EBMHz

#2944

$ 239

Pentium

®

III 933EBMHz

#3045

$ 259

Pentium

®

III 1GHz

#3074

$ 289

Components

Call for a quote

on your

Dream Computer

*Celeron &

AMD configurations available

online

SOFTWARE

OPERATING SYSTEMS

Windows 98 SE

$139

Windows ME

$149

Windows 2000

$169

Win 2000 Server(5) $799

APPLICATION

Office 2000 Prof.

$199

Office XP SmlBiz

$199

Office XP Prof.

$339

Adobe

$Call

Novell

$Call

SOUND

Yamaha X G

$29

Creative Labs

Live value

$49

X-Gamer

$99

Live Platinum

$189

NETWORKING

Netgear 10/100

$29

D-link 24Port Switch $299

Linksys

$Call

D-Link

$Call

3Com

$Call

WIRELESS

$Call

PENTIUM 4 POWERDESIGNER WITH 128MB PC800
RAMBUS MEMORY, 40GB HARD DRIVE, 32MB
VGA & 52X CDROM. BUILD YOUR DREAM ON THE
POWER OF INTEL’S PENTIUM 4 PROCESSOR.

1.5GHz

ITEM #3192

$ 599

1.7GHz

ITEM #3193

$ 699

1.8GHz

ITEM #3275

$ 739

2.0GHz

ITEM #3284

$1089

PowerDesigner 4

four

1.4GHz

ITEM #3270

$1279

1.5GHz

ITEM #3271

$1299

1.7GHz

ITEM #3272

$1349

*Celeron &

AMD configurations available

online

Receive

additional

information on

our products &

current

promotions by

fax or e-mail.

Call or

subscribe

online.

$969

$799

$1279

$659

$899

Dream Computers

DreamTech

by

$339

DREAMTECH’S VALUE PIII WITH 17” MONITOR,
128MB RAM, 40GB HD, SOUND, MODEM,
MOUSE & WINDOWS AT AN INCREDIBLY
LOW PRICE. OUR MOST POPULAR PIII
WORKSTATION.

background image

NEWS

8

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

NEW PRODUCT

PIC PROJECT BOARD

The

PIC Millennium Starter Kit has been developed

to broaden the range of PIC emulation tools. This proj-
ect board contains all the necessary components to start
learning the intricacies of the Microchip PIC. It is ideal
for both engineers and students. Students can use the
board to help form the core of their learning experience
and then use it for real world applications as they move
into industry. Experienced engineers will also find this
board very useful.

The board has evolved from numerous PIC training

workshops, the Microchip university training program,
and customer feedback. Most of the basic requirements

for starting PIC-based projects are covered and the
accompanying disk includes some worked examples
that can be used with this board.

The board is laid out in an uncluttered format with

component identification and pin function information.
None of the peripheral devices or I/O pins are dedicated,
which allows maximum flexibility for project develop-
ment. Standard components include a regulator and
reset components, 4- to 8-MHz oscillator modules to
drive the PIC, a prototyping block for project expansion,
and sockets for 40-, 28-, 18-, and 8-pin PICs. Also
included are an alphanumeric 2 × 16 LCD display mod-
ule, six LEDs, a 4 × 4 keypad for data input, dual RS-232
ports, a thermister and potentiometer, four switches and
four push buttons. Connectors are provided for an exter-
nal ICSP programmer (not supplied) for in-circuit pro-
gramming and an RJ45 connector can be connected for
use with Microchip’s ICD module.

In addition to the normal construction tools, you sim-

ply need a programmer such as the PICSTART Plus to
develop the software and program the PIC microcon-
troller. The starter kit is priced at

$195.

OKWelectronics
(412) 220-9244
Fax: (412) 220-9247
www.okwelectronics.com

COMPACTFLASH SOUND BOARD

The

DM2218A digital sound board is the fifth mem-

ber of the QuikWave family. Self-contained on a 3.0

×

4.2

circuit board, the DM2218A can play back up to

128 sound files stored on a CompactFlash card.
Windows

.wav files are digitized at 8-bit. Mono PCM

format in sampling rates of 6,
8, 11, 16, or 22 kHz are sup-
ported. The device accepts
cards of any size from 4 to
128 MB. Each megabyte stores
2 min. at the 8-kHz sampling
rate, or 45 s at the 22-kHz
sampling rate.

Either contact closures or

logic pulses can activate play-
backs. The built-in power
amplifier can deliver 1-W out-
put directly into a 4-W speak-
er, eliminating the need for
signal reprocessing. In the past,

sound files in standard formats must be re-digitized or
converted into a proprietary format with special equip-
ment or software. This process usually adds additional
noise and distortion to the sound. The DM2218A elimi-
nates this extra step and offers sound quality as good as

the original sound.

Applications include mes-

sage repeaters, talking displays
and exhibits, vending machine
and amusement equipment
audio output, and security
alarms. The DM2218A is
priced at

$85 in single quanti-

ty, the CompactFlash card is
not included.

Eletech Electronics
(626) 333-6394
Fax: (626) 333-6494
www.eletech.com

Edited by Rick Prescott

background image

NEWS

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

9

NEW PRODUCT

SURFACE MOUNT ADAPTERS

The TSOP2 is an OM-Adapt SMD prototyping

adapter PCB for common memory IC packages. The
miniboard incorporates three footprints, each a unique
pad pattern, which allows fitting of different body sizes
and pin counts. Two of the footprints are intended for
the connection of Type 1 or Type 2 TSOP packages, but
there is also a generic SOIC footprint that will accom-
modates SOJ type packages.

These breadboarding adapters

have a maximum pin count of
56, which allows their use with
most existing flash memory
devices. The adapters allow
engineers to use surface-mount
devices during circuit develop-
ment, yet still have the ability
to easily probe individual pins.
These miniature adapter PCBs
allow the use of ultrafine pitch
SMD components and track
these connections to a more
useful array of 0.1

spaced

holes. These holes allow for

direct wiring, single-in-line or dual-in-line pin headers,
PCB mount socket headers, or even wire-wrap pins to
be fitted. The adapters can be directly used in bread-
boards or development pin boards.

One-to-one pinout tracking allows logical circuit

probing during design and testing. A clever feature of
these adapters is that each unique miniboard is
designed to accommodate several different sized

devices, so fewer adapters need
to be stocked. By offering the
PCBs without connectors, the
parts are thus less expensive and
can be more flexible in their
application.

TSOP2 OM-Adapt adapters are

available from

$12.99 in quanti-

ties of 100.

Saelig Company
(716) 425-3753
Fax: (716) 425-3835
www.saelig.com

background image

f you could

acquire vehicle

identification and

timing information to

update a central database as the vehi-
cles pass the start/finish line at a race,
you would have a unique scoring sys-
tem. In this article, I will describe the
hardware and software implementa-
tion of an RF lap-scoring system to be
used in motorcycle racing and other
sporting events.

You may feel secure that this sys-

tem is reliable because I performed a
simulation of the proposed digital
wireless communication network to
determine the optimum timing
parameters. This project enables the
maximum number of vehicles to pass
simultaneously while still allowing
accurate time information to be
obtained from each one.

BACKGROUND

Motorcycle clubs com-

monly use volunteers to
record competitor progress
during a race. This is a
time-consuming process
subject to error when
many vehicles pass check-
points or cross the
start/finish line simulta-

neously. To complicate the problem,
motorcycle competitors and their
bikes are often caked in mud, making
identification of riders difficult. In
fact, at a recent event in Woodville,
New Zealand, a tight chicane had to
be installed so that physical contact
could be made with the bikes as they
went by. The first lap scorer wiped
the mud off so the second lap scorer
could record the number!

Interestingly, timing accuracy is not

too important in most events. The
main criterion is that the lap informa-
tion be consistently recorded.

High-performance race timing sys-

tems solve the lap-scoring problem.
The catch is, a typical professional
system costs about $15,000 (US$)
with around 60 transponders. They
also require extensive setting up and
are better suited for permanent instal-
lations rather than the ad hoc nature
of motor-cross course setting. Go-cart
systems cost about $4000, however,
they work only at slower speeds (up
to 40 km/h), and have a limited read
range of around 30 cm. I haven’t
found any other systems at a substan-
tially lower cost.

Therefore, a need exists for the

development of a low-cost, medium-
performance lap-scoring system. My
system is a scoring system rather
than a lap-timing system, because of
the limited performance required and
the need to keep the cost low.

For use in this environment, it’s

essential that no wires are placed
across the track and that setting up
the system is quick and simple. The
start/finish line at a motor cross
event is often setup in a different
place each day at short notice. In
addition, the line becomes muddy
as the bikes rip into wet ground.
Please keep this limitation in mind

10

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

FEATURE
ARTICLE

Pete Cross

An RF Lap-Scoring
System

Trying to determine
which mud-covered
vehicle is the first
across the finish line
can be a messy task.
If you can’t buy a scor-
ing unit, it’s time to find
a better solution. Pete
considered a variety of
technologies to keep
the information flowing.
In the end, RF came
out on top.

i

Photo 1—

This bare transmitter PCB is later completely encased in

epoxy for ruggedness and watertight capability.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

11

HOW THE SYSTEM WORKS

The vehicle transmits its unique

identification code on and off all the
way around the track. As it approach-
es the receiver situated at the
start/finish line, the signal gets rapid-
ly stronger. When it’s above a preset
threshold, the receiver assumes that a
vehicle is close to the start/finish
line. The receiver checks the accuracy
of the information received and passes
the ID number and time to the PC for
accumulation of race results.

Such a system imposes some

demanding requirements on the wire-
less network employed, made worse
by the fact that in a low-cost system,
you can use only a single RF frequen-
cy. There are three main problems
you have to consider.

Firstly, it is imperative that an

adequate number of ID transmissions
are received from each vehicle, even
though as many as eight or 10 vehi-
cles are passing the start/finish line
simultaneously. This level of process-
ing requires a robust, collision-toler-
ant, medium-access protocol.

Secondly, to record accurate times,

only vehicles near the start/finish line
should be recorded as they transit to
the pick-up zone. Put another way,

when considering how this system
was designed because it places major
restrictions on how you can go
about implementation.

As the project progressed, I wanted

to increase the timing accuracy to
make it time laps. A system capable
of logging vehicles to a resolution of
±0.1 s would qualify as a low-cost,
medium-performance, lap-timing sys-
tem. Obviously, accuracy depends on
transit speed. The ±0.1-s specification
applies to speeds of 50 km/h or faster.
Slower than that, the timing perform-
ance degrades, but ±1-s accuracy over
all speed ranges is a safe maximum.

To achieve the improved accuracy,

a timing simulation is required to
wring the best possible performance
out of the system. This simulation is
presented after the basic functionality
has been described.

SPECIFICATIONS

My list of specifications was pre-

cise. The transmitters had to cost no
more than $45 when sold in volume.
This was the most important design
parameter. The system has to handle
a minimum of 100 uniquely identifi-
able vehicles. The system’s signal
must be able to propagate through a
coating of mud for cross-country races.

In addition, I noted the transmitter

needs to be small and have a self-con-
tained power supply. It also must be
able to communicate over a distance
of more than 30 m (the width of typi-
cal racetrack). Importantly, the trans-
mitter must operate in accordance
with the rules for a restricted radia-
tion device (RRD) in order for it to be
used without a license. For my pur-
poses, this device must be able to last
a full day of racing, withstand vibra-
tion, and be watertight.

The system must receive informa-

tion correctly from all vehicles when
up to 10 vehicles are passing abreast. I
specified that the timing accuracy must
be better than ±1 s at the minimum
speed of 50 km/hr. The receiver could
cost no more than $1000 in volume
packaging and must identify vehicles
at speeds up to 150 km/h. Last on the
list, the lap-scoring device must not
be time-consuming to setup or involve
running wires across the track.

the transmitters must have limited
range. (It is better to reduce the sensi-
tivity of the receiver than to reduce
transmit power because this raises the
signal-to-noise ratio instead of lower-
ing it.) This requirement for a limited
read zone means that there is only a
second or two of opportunity to
receive a vehicle ID as it flies past.

Thirdly, multiple ID receptions are

required for accurate timing (I’ll come
back to this later). The requirement
for multiple receptions also gives con-
fidence that random ID receptions
generated by noise or transmissions
from far away do not lead to the false
triggering of a vehicle passing event.

A pessimistic summary of the

situation would be as follows: You
have only a short amount of time to
receive an adequate number of ID
receptions from many transmitters
in the pick-up zone simultaneously,
in a noisy environment where one or
two false triggers will occur at ran-
dom. Wireless data transmissions are
inherently error-prone at the best of
times with typical bit error rates as
high as 10–

3

or even 10–

2

. Compare

that with the bit error rate of an
fiber optic transmission system of
10–

9

or better. [1]

RF Power on/off

Unique ID code

Input port

pins

Output port

pins

Microcontroller

(AT89C2051-12PC)

Preamble and serial transmission of ID code

Driver

circuitry

Transmitter

Status LED

Power supervisory

and watchdog

Power switch

Battery

Recharge

circuit

Watchdog toggle

Watchdog reset

Figure 1—

The transmitter uses the Atmel AT89C2051, a popular 8051-based, low-cost microcontroller.

background image

possible. On/off keying
(OOK) is the modulation
scheme of choice for mini-
mum turn on time, how-
ever, this method is prone
to interference. Remember
that there is an internal
combustion ignition sys-
tem and alternator in oper-
ation less than 1 m from
the transmitter.

A more noise-tolerant

modulation technique is
frequency shift keying
(FSK), which proved to
work well. [2] It worked
fine within 1 m from the
spark plug with no shield-
ing, and within 10 cm
when shielding was used.

You may wonder why

noise at the transmitter is

a problem. Although FSK sys-

tems are resistant to amplitude noise,
they are prone to frequency noise.
Sources of noise generated or induced
in the delicate transmitter VCO or
PLL circuits on the transmitter get
amplified and can destroy the correct
output at the antenna port. This typi-
cally results in bit errors or an off-fre-
quency transmission outside the
pass-band of the receiver.

An added advantage of FSK is the

capture effect, whereby a single
strong transmission can be heard over
many weaker transmissions in the
background as long as there’s a signif-
icant difference in power levels. The
receiver locks onto the strongest
transmitter’s exact frequency, ignor-
ing the ones in the background.

Other modulation tech-

niques are superior, but
involve a complexity that
makes the transmitter
price excessive. Spread
spectrum techniques are
currently too expensive but
will be the best choice
within five years, as sys-
tems such as Bluetooth
reach critical mass. Not
only will they solve the
problem of noise, but cer-
tain spread spectrum cod-
ing techniques solve the

multiple access problems

The properties of the radio waves

depend greatly on the frequency used
and this is a critical design parameter.
Also, the nature of the RF channel as
a communication medium poses spe-
cial challenges to a digital data net-
work. The fading, attenuation, and
noise of the channel combined with
the limited bandwidth of the trans-
mission/reception process means that
channel encoding and other tech-
niques are required (as you’ll notice
throughout the article, these are
indeed problems).

MODULATION SCHEME

For a single channel system, it’s

imperative that the time to transmit
for each transmission is as short as

12

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

COMMUNICATION CHANNEL

I evaluated a variety of common

low-cost methods of communication
including infrared, ultrasound, induc-
tive/capacitive coupling, and RF. Let
me explain what I discovered.

My specification called for a device

capable of working through a layer of
mud. Mud is opaque to infrared and is
therefore unsuitable.

Cheap ultrasonic transponders will

not tolerate being submersed through-
out a race and their frequency of oper-
ation would be affected even if not
permanently damaged.

Inductive/capacitive coupling has

short-range effects used effectively
over a distance of only 3 m or so at
most with miniaturized circuits,
unless sophisticated equip-
ment is employed. [2]

Last, RF electromagnetic

waves in the radio frequen-
cy spectrum can penetrate a
thin layer of mud and water
if they are the correct fre-
quency. Cheap transmit-
ters are commonly used in
such applications as car
alarm deactivation keys and
garage door openers. I
explored the RF avenue to
find a suitable communica-
tion protocol to use with
this medium.

RSSI

Data out

Receiver 1

ADC1

*INT1

P6.1

256-byte RAM

8-KB EPROM

(not used)

1-KB SPRAM

Battery

Recharging

circuit and

power switch

DC to DC

isolator

Optical isolation

and RS-232

conversion

DB9

PC comm

port

Main

power

Microcontroller

(DS87C550-QCL)

INT3

UART 0

(115,200 bps)

ADC

TX

RX

Three 16-bit

timers

Watchdog and

power fail

detector

ADC2

*INTO

P6.2

INT2

32 KB

Flash ROM

Data bus

Address bus

Data ready 2

Data ready 1

DUART

(PC16552D)

Buffer

RSSI 1

Preamble for sync 1

RX Enable 1

RSSI

Data out

Receiver 2

Buffer

RSSI 2

Preamble for sync 2

*RX Enable 2

Baud rate
generator

(57,600)

Recharge
connector

Data 1

Data 2

–1

–0.75 –0.5 –0.25

0 0.25

0.5

0.75 1

Time (s)

1.6

1.4

1.2

1.0

0.8

0.6

0.4

0.2

0.0

RSSI (V)

Figure 3—

The messy received signal strength from the vehicle passing the start/fin-

ish line at first looks useless as a means of obtaining accurate timing information.

Figure 2—

The two separate receive channels in the receiver are effectively multiplexed by the external DUART.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

13

directly, allowing more than
one transmitter to be
received simultaneously.

TRANSMITTER HARD-
WARE

The transmitter shown in

Figure 1 uses the ubiquitous
8051-based AT89C2051
microcontroller from Atmel
to control an RF2512 FSK
transmitter from RF
MicroDevices. [3, 4]

Each transmitter has a

unique ID assigned to it.
The method of generating
this unique ID is fixed for
the life of the transmitter.
There are 65536 codes,
some of which are reserved
for testing purposes. Every few mil-
liseconds, the microcontroller powers
up the transmitter and transmits a
preamble code and cyclical redundancy
check (CRC), which takes 2 ms. (I’ll
discuss the exact timing of this process
later.) Manchester encoding of the
data is required to maintain minimum
run length and attain DC balance.

The transmitter shown in Photo 1

is completely sealed in epoxy, includ-
ing the antenna, batteries, and off/on
reed switch. The housing is a thin
shell of plastic that has been filled
with epoxy. There is a slot at each
end and an indention along the top of
the body where the mounting Ty-
Wrap sits. A clip-in magnet turns on
the transmitter when removed. There
are no external connections for bat-
tery recharging because an inductive
pick-up couples energy through the
thin plastic housing to the energy at
the recharging station. This provides
a 100% sealed unit. The transmitter
board is 40 × 60 mm.

RECEIVER

The receiver illustrated in

Figure 2 uses another 8051-
based microcontroller, the
DS87C550 from Dallas
Semiconductor, in conjunc-
tion with an RF2917 FSK
receiver IC from RF
MicroDevices. [5, 6] There
is a receiver IC for each
channel (see Photo 2).

Timing cannot be simply deter-

mined by when ID bytes arrive at the
serial port on the PC. Variable latency
necessitates a more sophisticated
approach. A clock with millisecond
resolution is provided on the receiver
board so that the time can be sent
along with the ID code. A push-but-
ton input and relay interface to an
automated start gun resets the clock
when the race starts

The receiver’s overall duty is to per-

form packet conversion. The received
packets containing the ID number are
Manchester decoded and checked for
errors. If no errors are found, the ID is
sent to the PC along with the channel
number the ID was received on, the
signal strength of the reception, the
time at which the transmission was
received, and a CRC checksum gener-
ated for this new packet.

In effect, the receiver acts as a mul-

tiplexer, receiving on more than one
serial RF channel, and passing this

along to the PC on one RS-
232 link. Queuing is neces-
sary to handle peak demand.

SOFTWARE DESIGN

As described in the trans-

mitter section, short packets
consisting of preamble, ID,
and CRC are constantly
arriving at the receiver
antennas. Treat the RF sec-
tion as a black box for now,
and picture these packets of
digital values appearing
intermittently at the DATA
OUT pin of each receiver.
Simultaneously, the received
signal strength of the trans-
mission is represented by an
analog signal at the RSSI pin

of each receiver:

For each transmission, the receiver

carries out preamble synchronization
to find the start of the first ID byte
frame in the packet. What remains
are packets of information that
require further processing constructed
as follows: 16 bits of ID (Manchester
encoded, 4 bytes of data) and 8 bits of
CRC checksum (Manchester encoded,
2 bytes of data).

As the individual byte frames are

being received, the RSSI level is sam-
pled and averaged. If the CRC checks
out, the 24-bit counter is read for tim-
ing information, the channel number
is noted, and a new 16-bit CRC cover-
ing the transmit packet payload is
calculated. This payload is almost
ready to be placed into the output
queue, but first, additional bytes are
added for the transmission protocol.

There is no input queue for the

received packet byte frames. The
packets are processed on all channels

simultaneously in real
time. These received pack-
ets are Manchester-decod-
ed one byte at a time, and
a transmit packet is con-
structed and ready to be
placed in the output queue
to the PC.

A separate process runs

for each channel, meaning
that the output queue sim-

ply sends completed pack-
ets of data to the PC one at

Received

signal

strength

Time

Received

signal

strength

Time

RSSI output antenna placed

12 m before start/finish line

RSSI output antenna placed

12 m after start/finish line

Cross-correlation accurately predicts time

at which vehicle crossed start/finish line

Start/Finish line

Figure 4—

Cross-correlation of received signal strength from two antennas

improves timing accuracy.

A

B

C

D

E

Frames

T

ransmitting

nodes

Figure 5—

In this example of the aloha medium access method, transmissions from

B, C, and E have suffered collisions.

background image

wouldn’t. In the unlikely
event that this is the case,
the incorrect transmitter
ID will indicate that a
phantom bike has passed
the start/finish line. The
probability of this affect-
ing the race results is
reduced to a negligible
value by requiring that a
minimum of three cor-
rectly interpreted ID
codes be received from a
transmitter on each pass.

Ten ID receptions are

required for an accurate
timing estimate, but this
information still will be
used if between four and

nine are received. These
results are flagged to indi-
cate that they represent a
less accurate estimate.

Because of the pseudo-

random spacing of transmitter trans-
missions, the probability of collisions
producing the same incorrect ID with
a valid checksum three times within
a short space of time is practically
zero. In addition, there are 65,356
possible ID codes, but only about 40
vehicles in a race. The application on
the laptop would reject any requests
to update the database if the trans-
mitter ID was not in the current race.

SIMULATION

Because all transmitters use a

common channel, simultaneous
transmissions from other transmit-
ters in range interfere with one
another. The result is that none of
the transmissions are successful if
they overlap in time. When this hap-
pens, a collision is said to have
occurred (see Figure 5). [7]

A scheme to allow more than one

device to share a common communi-
cations medium is termed a medium
access method. For this protocol,
transmission timing rules are set up
for each transmitter to obey. The aim
is to make the most of the available
capacity of the medium.

The aloha medium access method

achieves this by letting the transmit-
ters on air for only a brief amount of
time. But, they can still transmit many

14

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

a time (i.e., output packets
are not interleaved with
other output packets). If an
exception occurs before a
correctly assembled packet
is placed in the output
queue, it is simply discard-
ed. There are three excep-
tions. First, if a new pre-
amble is detected before
the current packet is fin-
ished receiving a complete
number of byte frames. In
this case, the new trans-
mission can be decoded as
if no collision for it had
occurred, and the inter-
rupted packet is dropped.
Second, if time between
preamble detection and
when the last byte frame
should occur expires.
Third, if CRC fails.

RANGE FINDING

The base station estimates the

range of the transmitter as it goes by,
based on received signal strength.
Unfortunately, the raw output from
the received signal strength indicator
at the receiver is useless as a means
of accurate range determination. It’s
useless primarily because of the
multi-path effect, which cancels one
part of the received signal with the
rest of the signal.

The problem lies in the fact that

the signal can take more than one
path. Different paths have different
path lengths, so these signal compo-
nents arrive out of phase with one
another, sometimes canceling, some-
times reenforcing. The result is a
messy looking signal strength graph
in which time equals zero corre-
sponds to the instant that the vehicle
crosses the start/finish line. You can
see the graph in Figure 3.

To overcome this limitation, start

by assuming that the net multi-path
effect is zero and the multi-path effect
is, on average, the same before and
after the start/finish line. Using two
antennas, a cross-correlation is per-
formed as illustrated in Figure 4 to
provide the statistically best predic-
tion of when the vehicle passed. The
information sent to the PC for each

transmission already includes the ID
code, channel received on, received
signal strength, and time. All of this
higher level processing is carried out
on the PC.

First, the data points are streamed

into separate processes based on the
ID number. For each ID stream, the
data points are interpolated and up-
sampled to a constant sampling peri-
od. Then, you may perform the cross-
correlation. The cross-correlation also
helps determine the speed at which
the vehicle passed.

And of course, this two-channel

system adds complexity to the design
because now two receivers are added
to the list of requirements.

ERRONEOUS ID CODES

It is extremely unlikely that colli-

sions will result in producing invalid
race results. First of all, the preamble
can’t occur in the data, so if part of a
later transmission were cleanly over-
lapped on a slightly earlier one, the
receiver algorithm would look only at
the second one.

However, it might be that an inter-

fering transmitter merely alters mul-
tiple bits in the dominant signal
being received. Normally the cyclic
redundancy check (CRC) would pick
this up, but there is a small chance it

Repeating

ID3

Repeating

ID4

Transmitter 1

Transmitter 2

Transmitter 3

Transmitter 4

Repeating

ID2

Repeating

ID1

RF Link

Receiver

Figure 6—

Each repeating ID message source in the Comnet III simulation model out-

puts a representation of the messages being sent to the receiver. The timing of the
message sources is automatically swept through a range of values to provide informa-
tion about how the link will perform with different settings.

background image
background image

16

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

times per second to allow
enough receptions to be
used in lap scoring.

An adequate number of

successively received trans-
missions must arrive per
transmitter per second to
ensure that accurate vehicle
information is gathered dur-
ing the short period of time
when vehicles are in range
of the receiver. My experi-
ments determined this
number to be 10.

The goal of my simula-

tion was to find out how
best to structure the timing
of the transmissions, given
that I want as many vehi-
cles to be able to pass the start/finish
line simultaneously and still have
their time accurately recorded.

If the number of transmissions per

second is too few, collisions are rare,
but not enough transmissions are
received from each vehicle to guaran-
tee that its pass has been recorded
with accuracy. If the rate of transmis-

initially rises with increas-
ing load, but then decreas-
es when the load reaches
the network saturation
point. [1] The difference
here is that the transmit-
ters cannot listen to the
channel, so they can’t
check to avoid other trans-
missions. If a receiver
function was implemented
on the vehicle, a check
could be made for a clear
channel before transmis-
sion helping to avoid colli-
sions. Unfortunately, this

is too expensive to imple-
ment, so the penalty is
using a reduced link.

COMNET III MODEL

The model shown in Figure 6

shows four transmitters using a single
link to talk to a receiver using the
aloha medium access method. Each
transmitter spends approximately 2 ms
transmitting its identification number
and CRC. It then waits a fixed amount

sions is set too high, excessive colli-
sions occur with only a moderate
number of vehicles passing abreast;
and again, there are not enough trans-
missions received correctly from each
vehicle to guarantee that its pass has
been accurately timed.

The situation can be compared to

an Ethernet LAN where throughput

Photo 2—

The ground plane of the receiver PCB is split into analog and digital sec-

tions. The vertical split is one-third of the way from the left of the board.

3

MotorMind B

Adjust Speed and/or Direction
Easy Serial Interface
Tachometer/Counter Input

DC Motor Control Module

More powerful than a...

Solutions Cubed (530) • 891-8045 phone • www.solutions-cubed.com

Solutions

background image

ZZZPLFURFKLSFRPDQDORJ

0&80&+3Ċ

&DOORUYLVLWRXUZHEVLWHWRUHFHLYHPRUHLQIRUPDWLRQ

7KH0LFURFKLSQDPHDQGORJRDQG3,&DUHUHJLVWHUHGWUDGHPDUNVDQG$QDORJIRUWKH'LJLWDO$JHLVDWUDGHPDUNRI0LFURFKLS7HFKQRORJ\,QFLQWKH86$DQGRWKHUFRXQWULHV63,LVD

WUDGHPDUNRI0RWRUROD,



&LVDWUDGHPDUNRI3KLOOLSV&RUSRUDWLRQ‹0LFURFKLS7HFKQRORJ\,QF$OOULJKWVUHVHUYHG

0LFURFKLSKDVLQWHJUDWHGDQDORJ

WHFKQRORJ\SHULSKHUDOVDQG

IHDWXUHVWRPHHWWRGD\·V

GHPDQGLQJGHVLJQUHTXLUHPHQWV

2XUEURDGVSHFWUXPRIRYHU

VWDQGDORQHDQDORJGHYLFHVDGGUHVV

WKHUPDOPDQDJHPHQWSRZHUPDQDJHPHQWPL[HG
VLJQDOOLQHDUDQGLQWHUIDFHVROXWLRQV&RPELQHGZLWK
,QWHOOLJHQW$QDORJ0LFURFRQWUROOHUV0LFURFKLS
RIIHUVDQH[WHQVLYHDQDORJSRUWIROLRIRUWKRXVDQGV
RIKLJKSHUIRUPDQFHGHVLJQDSSOLFDWLRQVLQWKH
DXWRPRWLYHFRPPXQLFDWLRQV ZLUHOHVV FRQVXPHU
FRPSXWLQJDQGLQGXVWULDOFRQWUROPDUNHWV

:KHWKHUVWDQGDORQHRUHPEHGGHG0LFURFKLSKDV
WKHDQDORJVROXWLRQVDQGWRROVWRPDNH\RXUMRE
HDVLHU9LVLWRXUZHEVLWHWROHDUQPRUHDERXWRXU
H[SDQGLQJDQDORJSRUWIROLR

3,&&

,QWHOOLJHQW$QDORJ

0LFURFRQWUROOHU

7&
7HPSHUDWXUH
6HQVRU

background image

18

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

of time during which it is guaran-
teed not to transmit. It then ran-
domly selects a time to wait before
transmitting again.

The transmitters are unaware of

other transmitters using the channel,
and most likely have been turned on
at different times anyway. This means
that they will be out of sync and that
collisions will happen at random. The
simulation models this by creating a
transmitter entity and getting it to
transmit at times picked from a uni-
form probability distribution.

The distribution is:

Uniform [N, (3N)]

where N is a scaling factor in mil-
liseconds. N is varied between five
and 60 in the simulation to deter-
mine the optimum value. If N = 10,
the inter-transmission time would be
a value chosen from a uniform distri-
bution function with 10 ms as the
lower limit and 30 ms as the upper
limit. The mean time to transmit
would be:

Besides finding the optimum mean

time to transmit, it would be useful
to know how the system behaves
with a varying number of transmit-
ters. To this end, the number of trans-

mitters is varied between
three and 15 for each mean
time to transmit.

SIMULATION RESULTS

Mathematically, you have

a function of two independ-
ent variables, so you can
graph this as a surface.
Figure 7 shows the surface
that has a height above the
horizontal plane equal to
the number of successfully
received transmissions per
transmitter per second. That
is, it counts only the trans-
missions that arrive that
weren’t involved in a colli-
sion. This factor is the
measure of system perform-
ance—the higher the better.

Figure 7 looks complicated, but it’s

only the result of a simple principle
in action: As the number of transmit-
ters increase for any fixed mean time
to transmit, the number of transmis-
sions correctly received per transmit-
ter always diminishes. This is because
of the increase in collisions that are
to be expected.

Looking orthogonally now, as the

mean time to transmit increases, the
number of transmissions correctly
received generally decreases. This is
expected because of the fact that
there are fewer transmissions ema-
nating from each transmitter. The
exception is the right-hand rear cor-
ner. At this point, the
number of transmitters
is at its greatest, and
they are transmitting
the most often.

This area of the

graph reverses the pre-
vious trend. To be sure,
the transmitters are all
transmitting as often as
possible with the hope
that they will be heard
more often.
Unfortunately this is
counterproductive
because all of the oth-
ers are doing the same
thing. The network is
so clogged with trans-
missions that hardly

any transmissions make it through.

Figure 8 offers a different perspec-

tive on the same surface. It’s clear
now that the optimum mean time to
transmit is 30 ms. At this setting, the
most number of successful transmis-
sions make it through for a large
number of transmitters operating at
once. In fact, there is a 100% safety
margin over the minimum allowable
number of 10 successfully received
transmissions per transmitter per sec-
ond. This is just as well considering
the surface actually represents the
average number of transmissions
taken over a finite time interval.
There always will be a nonzero proba-
bility of complete blocking caused by
collisions, however, the chosen sys-
tem settings make this occurrence
extremely remote.

DRIVING IT HOME

Problems encountered when

designing the lap-scoring system were
overcome during the design phase
with a mixture of practical experi-
mentation and simulation. The simu-
lation proved useful in determining
how to structure the inter-transmis-
sion time of the vehicle transmitters
to make the best use of the commu-
nication medium in this situation.

This system is a work in progress.

I’m currently searching for financial
backing from investors to refine and
commercialize this system into a
mature product.

I

100

90
80
70

60
50
40
30

20
10

4

6

8

10

12

14

110

100

90

80

70

60

50

40

30

20

10

Number of

transmitters

Mean time to

transmit (ms)

Successful transmissions

per transmitter per second

Figure 7—

As the number of vehicles passing simultaneously increas-

es, the number of transmissions that make it through without collision
for each transmitter always decreases. No surprises there!

110 100 90 80 70 60 50 40 30 20 10

15

10

5

100

90

80

70

60

50

40

30

20

10

Mean time to transmit (ms)

Number of

transmitters

Successful tr

ansmissions per tr

ansmitter per second

Figure 8—

The result of the simulation shows that when 15 vehicles pass

abreast, a 30-ms mean time to transmit provides the highest number of suc-
cessfully received IDs from each vehicle. Longer, and rate of transmissions
being generated is not enough; shorter, and there are too many collisions.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

19

Pete Cross is a research engineer at
Sensortec in Hamilton, New Zealand
where he enjoys dreaming up new
and exciting ways to apply wireless
data technology to any application he
can imagine. His current projects
include exploring the implementation
of a Bluetooth data network for an
online sensing and control applica-
tion. You may reach him at
pete.cross@clear.net.nz.

SOURCES

AT89C2051-12PC

Microcontrollers, AT29C010A-
90JC Flash memory

Atmel Corp.
(408) 441-0311
Fax: (408) 436-4200
www.atmel.com

DS87C550-QCL
Dallas Semiconductor (now Maxim

Integrated Products, Inc.)

(408) 737-7600
(800) 998-8800
Fax: (408) 737-7194
www.maxim-ic.com

PC16552DV DUART
National Semiconductor Corp.
(408) 721-5000
www.national.com

RF2512 FSK Tx/Rx
RF Micro Devices, Inc.
(336) 664-1233
Fax: (336) 931-7454
www.rfmd.com

RESOURCES

J. Anthes, “Unique Considerations

For Data Radio UARTs,” RF

Monolithics, Dallas, Texas, 1999.

———, “OOK, ASK and FSK
Modulation in the Presence of an
Interfering signal,” RF
Monolithics, Dallas, Texas, 1999.

K. Smith, “Antennas For Low

Power Applications AN36A-
070898,” RF Micro Devices,
Greensboro, North Carolina,
1998.

Linx-Technologies Inc.,

“Modulation Techniques for
Low-Cost RF Data Links,” AN-

REFERENCES

[1] L. W. Couch, Digital and

Analogue Communication
Systems

, Prentice Hall, 1997.

[2] J. Dunlop and D. G. Smith,

Telecommunications
Engineering,

Thompson Press,

1984.

[3] Atmel Corp., “AT89C2051: 8-Bit

Microcontroller with 2K Bytes
Flash,” rev. 1001A, February
1998.

[4] RF Micro Devices, Inc., “RF2512

433/868/915MHz FM/FSK
Transmitter,” rev A3, 980328,
1998.

[5] Dallas Semiconductor,

“DS87C550: EPROM High
Speed Micro with A/D and
PWM,” rev. 091698, 1998.

[6] RF Micro Devices, “RF2917

433/868/915MHz FM/FSK
Receiver,” rev A3, 980328, 1998.

[7] CACI Products Co., COMNET

III Reference Guide Release 2.0,

1998.

00130, Linx-Technologies Inc.,
1998.

background image

20

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

pdating the

electronics of a

classic Hero I robot is

a new experience for

me, because most of the old electron-
ics are still functional. This is a testi-
monial to Heathkit, a company that
used to manufacture great electronics
kits for stereos, TVs, computers, and
even robots. Heathkit’s step-by-step
instructions with associated diagrams
were well-known for their clarity, and
even a novice like me could put
together a 15-W stereo receiver and
have it work the first time.

This kit was my introduction to

electronics and soldering. The Hero I
robot kit was a gift from my father to
my brother and I. I immersed into the
world of robotics when I built the
robot with my brother. We spent
weeks working day and night to finish
it. It was a great pleasure to see the
LEDs light up and hear the Hero I say
“Ready!” with its built-in SC-01 voice
synthesizer (see Photos 1a and b). I
even completed the home Heathkit
Robotics course, which taught me a
lot about the subject.

One of the programming challenges

was to make the robot travel around a
room without running into any objects.
My brother was able to accomplish

FEATURE
ARTICLE

this feat using 6808 assembly lan-
guage and a Hero I robot interpreter
language. This was quite a feat back
in the 1980s. Thousands of these
robot kits were sold until sadly
Heathkit (now known as Zenith)
stopped making them. You may still
find one offered from an individual on
the Internet or on eBay. If you’re
interested, there’s also a web site ded-
icated to Hero I (hero.dsavage.net).

I hope this article will inspire you

to dust off your Hero I (if you’re lucky
enough to own one) or look out for
one at yard sales, flea markets, or the
’Net and get it running again. New
robot kits such as the Boe-Bot sold by
Parallax are a good introduction to the
field of robotics, but I still wish
Zenith would bring back the Heathkit
division and start making great elec-
tronics kits again to inspire the next
generation of hobbyists.

My current plans to upgrade the

Hero I include integrating the sensor
controller board described in Part 1
(Circuit Cellar 135) and the six Sharp
GP2D12 IR ranger sensors shown in
Photo 2 with the original electronics,
using the serial interface and the
Hero I experimental board. I will care-
fully place these sensors at strategic
locations around the robot’s body.

The next step will be to replace the

archaic 6808 with a new PIC18C452-
based main controller while leaving
the original electronics still function-
al. This is similar to a surgeon perform-
ing heart bypass surgery. Taking over
the Hero I main drive circuitry will be
the trickiest part of this operation.
Fortunately, the risk is minimal because
I still have all the original schematics
to help me out with this task.

The main reason I need the I

2

C

interface for this project so I can route
signals without disturbing the original

Daniel Ramirez

Robot Sensor
Controller Board

Like many electronics
enthusiasts, Daniel cut
his teeth on a Heathkit
project. Building the
Hero I was a learning
experience the first
time around, now he’s
going back to upgrade
the robot and update
the hardware. With his
board, some IR sen-
sors, and a PIC, he
limits the intrusion.

u

Part 2: How the Brain Works

Sensor ID

Raw sensor value

Checksum

Figure 1—

A similar USART or I

2

C raw sensor packet

with its checksum will be transmitted from the board to
the master controller or host PC.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

21

Motorola’s linear addressing is respon-
sible for making many C compilers
available for its 68HCxx micros.

The main problem with this com-

piler is its high price of $495. I would
like to see a lower cost version with-
out all the bells and whistles that
would be marketed to hobbyists in a
similar fashion to Borland’s original
Turbo C compiler for about $100.
This would encourage the average
embedded hardware engineer to try
new PIC processor products using C
development tools, which would in
turn mean increased PIC sales.

FLOATING POINT SUPPORT

Microchip provides the equivalent

of a board support package (BSP) for
its PIC18Cxxx microcontrollers that’s
similar to those commonly available
for high-end 32-bit platforms such as
those based on PC or Pentium proces-
sors. I coined the name chip support
package (CSP) for this level of sup-
port. It covers the Microchip C
libraries that support all of the inter-
nal PIC18Cxxx hardware. This
includes C functions to support the
A/D converters, timers, USART,
PWM, I

2

C, SPI, and capture registers.

The Microchip C library also pro-

vides IEEE 754-compliant floating
point support, which is handy for
implementing the sensor processing
algorithms covered in this article. [1]
Now, real number crunching algo-
rithms may be executed on this chip
without having to worry too much
about fixed-point scale factors, under
flow, or overflow.

developing, testing, and debugging the
C software and burning the code into
the PIC (see “Programming the
PIC18C452” sidebar). Finally, I’ll add
a list of various interesting experi-
ments and areas to be researched
using the sensor controller board.

MICROCHIP C COMPILER

The Microchip C compiler fully

supports the PIC18Cxxx microproces-
sor family. It optimizes and generates
reasonably tight code for a first gener-
ation compiler. Although Microchip
has supported previous C compilers
for their PIC16xxx and PIC17Cxxx
devices, these processors don’t have
the architectural features to support a
C compiler that produced tight code.
This is mostly because of a limited
number of registers, SRAM and
EPROM, or flash limitations. In par-
ticular, there is the memory banking
scheme that forces the compiler to
generate extra instructions when
accessing register or memory loca-
tions that were in another bank.

The new PIC18Cxxx device has up

to 4 MB of linear addressing for pro-
grams and up to 4-KB SRAM for data.

electronic boards and creating a rat’s
nest of wiring. When all of the
upgrades are completed, I should have
a great experimental platform for
robotics experiments. Photo 3 shows
a prototype serial RS-232 interface
card connected to the Hero I experi-
mental board.

In Part 1, I described the construc-

tion of a sensor controller board, how
it worked electrically, and what can
be done with it in terms of robotics,
automation, and data collection. I
also described some sensor processing
algorithms that may be executed on
the sensor controller board. I
explained how the board’s small size,
modular construction, and USART
and I

2

C interface allow it to be used

with almost any robot platform,
including my Hero I. The next chal-
lenge, writing all the required embed-
ded software to make the board work,
is the topic of this article.

Now, the focus is on issues regarding

software development, in particular
using Microchip C to develop advanced
sensor-processing algorithms that
require the PIC18C452’s floating point
capabilities. I’ll describe the main sen-
sor controller application (

sensor.c),

which enables the sensor controller
to communicate with the main Hero
I controller and allows you to cali-
brate and read any analog or digital
sensor connected to the board.

In addition, I’ll include a working

version of an obstacle detection algo-
rithm that will be used by the Hero I
to avoid hitting objects. For extra
information, there’s a tutorial on

Command

Description

Bxx

Send interrupt counts for port B bit xx, where the bit ID range (04…07) is in a two-digit hex byte format

Cxx

Calibrate the selected sensor xx by computing its gain and offset calibration values. The sensor ID range (00…FF) is in a two-digit hex byte format.

Exx

Execute sensor algorithm xx, where the algorithm ID range (00…FF) is in a two-digit hex byte format

Fxx

Select filter xx, where the filter ID range (00…FF) is in a two-digit hex byte format

Ixx

Read a port (00=>A…04=>E). Send value read for port xx, where the port ID range (00…04) is in a two-digit hex byte format.

Sxx

Send calibration data from sensor xx, where the sensor ID range (00…FF) is in a two-digit hex byte format

Wxx

WindowMin,WindowMaxAccept window data used to scale the sensor xx commands, where the sensor ID range (00…FF) is in a two-digit hex byte for
mat and the two 16-bit hex words that follow represent integer values for the minimum and maximum window coordinates

Rxx

Read the analog port and send a raw sensor value and switch/interrupt status data from sensor xx, where the sensor ID range (00…FF) is in a two-digit
hex byte format

Pxx

Read the analog port and send a scaled sensor value and switch status (interrupts) data from sensor xx, where the sensor ID range (00…FF) is in a two-
digit hex byte format

Txx

Test the selected sensor xx by reading it and displaying the values, where the sensor ID range (00…FF) is in a two-digit hex byte format

Z

Reset the sensor controller

Table 1—

You enter the sensor processing commands via HyperTerminal or Procomm using the serial RS-232 interface. Another PIC or Stamp microcontroller would work,

too. Currently only the USART interface is supported, however, I am working on an I

2

C version.

Figure 2—

Here you see the USART or I

2

C scaled

sensor packet with its checksum. The sensor controller
board has already scaled the data, which is ready for
use by the master controller or host PC.

Sensor ID

Raw sensor value

Scaled sensor value

Checksum

background image

buffer. But I shouldn’t complain,
because Microchip provides this tool
for free, and it already performs many
wonderful debugging tasks.

When used with the ICE-2000

Emulator or the MPSIM simulator,
the MPLAB simulator enables you to
view IEEE 754 floating point num-
bers. However, this is of limited use
for the everyday number crunching
required for signal processing, data
analysis, and robotics algorithms.

22

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

The one inexcusable omission from

the C library is the

stdio library,

which means it doesn’t provide sup-
port for the

printf function. Instead

Microchip provides low-level I/O
functions that use the USART but do
not format the I/O. This lack of sup-
port makes it hard to interpret and
display the IEEE 754-compliant float-
ing point numbers. Another missing
feature is a small, embedded, real-
time kernel, or RTOS, that would
allow minimal multitasking support
for PIC18Cxxx devices.

I’m currently developing software

that addresses these I/O issues by
using my version of

printf, dec,

hex2, and hex4 functions. Eventually
these functions will be included in
my

stdio library. I’m also working on

adding floating point I/O functions
similar to ANSI C functions (

printf,

scanf, getc, and putc) that include
the standard character, integer, and
floating point formatting specifica-
tions (

%c, %d, %f, etc.). These func-

tions will make use of the USART
and I

2

C hardware.

Microchip offers extensive applica-

tion notes that cover everything from
simple alarm clocks to fuzzy logic
and fast Fourier transforms. Most of
these notes were developed for low-
end and mid-range PICs and are usual-
ly written in assembly (MPASM).
However, they’re still useful for
gleaning formulas, hardware designs,
and algorithms that you may convert
to C easily. On the company’s web
site (www.microchip.com), you may
find some more recent applications
written in C, as well.

MPLAB SIMULATOR

The MPLAB simulator, which is

provided free by Microchip, is super.
It works in a similar manner to the
ICE-2000 emulator. With it, you can
accomplish many tasks including set
breakpoints, dump memory locations
set variable watches, single step
through C and assembly code, step
over function calls, and count cycles
using the stopwatch function.

By first simulating your applica-

tion, you can find out if the C code
will run as expected without having
to burn a single PIC. You are required

to eliminate functions that actually
address the application’s hardware,
unlike the ICE-2000, which allows
you to run a PIC18Cxxx device in
real time with the application hard-
ware connected.

Again, the only weak point with

this tool is the lack of support for the
stdio library and USART. You also
don’t have the ability to read data
from a file on the PC’s local hard
drive or to write data to a log file or

Listing 2—

To use the I

2

C interface to write a 0.31 ramp to a 24LC16 serial EEPROM and read the values

back, follow this model.

******************************************************************

AverageSensor reads the raw sensor value from the selected A/D

channel for a number of samples and filters it uses as an averag-

ing filter.

******************************************************************

int AverageSensor(byte SensorID)

{

float

AverageSensorValue; // Averaged sensor value

int i; // Loop index

AverageSensorValue = 0.0;

for (i = 0; i < NumberOfSamples; i++)

{

AverageSensorValue = AverageSensorValue + (float)

ReadSensor(SensorID);

}

AverageSensorValue = AverageSensorValue / (float) NumberOf

Samples;

return ((int) AverageSensorValue);

}

Listing 1—

Wondering how to read up to eight analog sensors that are connected to the board’s analog

input terminals? Here’s the answer you’ve been looking for.

while (TRUE)

{

for (i = 0; i < NumberOfSensors; i++)

{

// Read sensor value from selected A/D channel

SensorValue = ReadSensor(i);

// Send reading back to host

printf("i = ");

dec(i);

printf(" SensorValue = ");

dec(SensorValue);

printf("\r\n");

}

}

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

23

including the sensor controller appli-
cation I provided (

sensor.c). I also

used the RS-232 (USART)

printf and

dec functions throughout the applica-
tion. See the “Programming the
PIC18C452” and “Debugging and
Running the Application” sidebars for
a tutorial on developing software
using Microchip’s tool suite.

The ’18C452 has extensive process-

ing capabilities that are needed to
handle many common sensor-related
algorithms used for robotics. These
algorithms include averaging sensor
readings in order to filter out noise,
determining the maximum and mini-
mum readings for calibration, and
performing digital filtering, FFTs, and
fuzzy logic algorithms.

Finally, the results from the processed

sensor data are sent to the main appli-
cation currently executing on the

host PC or to the main
robot controller (Hero I)
in the form of filtered
and scaled sensor read-
ings and digital I/O sta-
tus words via the USART
or I

2

C interface. The

main controller has all
the sensor data it requires
so that it can act on the
data using control, robot
behavior, or data reduc-
tion algorithms.

The sensor controller

application is a demon-
stration application that
has most of the common

I have not had the opportunity yet

to try Microchip’s new ICE-2000
emulator. After checking out what’s
stated on the company’s web site, it
looks like embedded systems develop-
ers who want to work with Microchip
products will greatly benefit from it. I
hope that Microchip plans to support
the in-circuit debugging technology
(ICD) that it currently provides for
the PIC16Fxxx family, especially
because the new PIC18F455 seems to
follow the migration path set by the
PIC16F877. As an additional plus,
using it would be a lower cost alter-
native to the ICE-2000.

BOARD SOFTWARE

I took advantage of a demo version

of the C compiler to develop most of
the related sensor processing algorithms
and experiments used for this board,

a)

b)

Photo 1a—

My Heathkit Hero I still has its rugged plastic outer shell in place. The hex keypad and motion detector

sensors are clearly visible in front.

b—

The arm pivots about the shoulder and extends. The wrist pivots and rotates

and gripper is capable of grasping small objects such as soda cans.

Photo 2—

The six Sharp GP2D12 IR ranger sensors are ready to be

attached to the robot.

background image

24

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

sensor processing functions
required to handle sensor collec-
tion, calibration, and analysis.
Although these functions work
with serial communication soft-
ware such as HyperTerminal, to
be useful a software application
needs to be developed by the
user on the host PC, laptop, or
master controller that will col-
lect and process sensor data. The
application will issue the neces-
sary commands to the sensor
controller board to read the sen-
sors, scale the values, or cali-
brate the sensors. To write such
an application, you must be
familiar with serial programming
on a PC using Visual C++, Visual
Basic, or PBASIC on a Parallax Stamp
BSX/BSP microcontroller.

The functions I just described for

the slave application also may be used
for other custom sensor algorithm
development. The sensor controller
board software is still under develop-
ment and currently represents only a
snapshot in time. Although it works,
it’s still missing functionality and
may even hang up.

In particular, the asynchronous seri-

al communications are not entirely
reliable, which is why I want to use a
synchronous protocol such as I

2

C. I’m

also considering using the PIC watch-
dog timer to reset the controller if it
reaches an undesirable state.

I

2

C NETWORK

The sensor controller application

currently supports writing data to a
serial I

2

C EEPROM and reading it

back again. You’ll find this capability
useful for storing and retrieving sen-
sor calibration constants or for log-
ging data and events.

Right now, I’m in the process of

developing an I

2

C electronic network

for communications among the vari-
ous Hero I electronic modules; it will
use simple data packets for messages.
The sensor board will act as a slave to
the host or master microcontroller.

Sensor readings then will be

processed and transmitted to the cur-
rent recipient in the form of small
data packets similar to those shown
in Figures 1 through 5. The data

integrity of each packet received will
be assured by checking a CRC or
checksum. A CRC or checksum also
should be computed and stored in the
packet header every time a message is
sent. If the message is corrupted, it
will be retransmitted.

USART INTERFACE

Currently, these functions are

available to the host or master con-
troller using only the USART inter-
face. I plan to provide these same
commands via the I

2

C interface in the

future. At this time, sensor process-
ing doesn’t handle the execute (Exx),
and filter (Fxx) commands, except for
the E00 (executes an object detection
algorithm) and F00 (averaging filter)
commands.

An example of a command to read

an individual sensor involves sending
a

R01; string to the sensor controller

to read a raw sensor from sensor one,
where R is the calibration command
and 01 is the sensor ID. Sending the
T01; command causes the sensor con-
troller to read sensor one continuous-
ly so that the readings then can be
logged with HyperTerminal (in this
case, used as a data logger).

The remaining options, E01…FF

and F01…FF, are only stubs, which I
encourage you to develop using the
references at the end. Table 1 lists the
sensor processing commands avail-
able on the sensor controller board.
Listing 3 demonstrates how to read
and write to the serial I

2

C EEPROM.

Photo 3—

A top view of the classic Hero I robot shows the hex

keypad and LED. I’m going to use this experimental board to
interface the sensor controller board in order to read and
process the IR ranger sensors.

background image
background image
background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

27

SOFTWARE TOOLS

Back in August, I detailed the soft-

ware development tools needed to
develop code in C for the PIC18C452
(“Optimize Your PIC,” Circuit Cellar
133). The software included tools
such as MPLAB, MPSIM, MPASM,
and MPLINK along with the MCC18

they also can be viewed on your com-
puter using Visual C++ or Borland
C++. This feature allows you to work
from a PC or laptop when developing
and debugging algorithms.

Sensor data collected by the sensor

controller board also may be analyzed
and plotted using PC software such as

C demo compiler that Microchip pro-
vides for free. In addition to these, I use
other tools such as Visual C++, Visual
Basic, HyperTerminal, Excel, Mathcad,
and Matlab for data collection, reduc-
tion, visualization, and analysis.

Because the Microchip floating point

libraries are compliant with IEEE 754,

Programming the PIC18C452

This section is a step-by-step tutorial for using the

Microchip software development tools to compile, link,
simulate, debug, and burn an application on the
PIC18C452. This information should help you perform
the experiments and is also a good introduction to the
Microchip tools suite.

On your PC or laptop, install MPLAB according to the

instructions that appear after clicking the Setup icon
from the installation file download from the Microchip
web site or the CD-ROM. During the setup process,
select PIC18C452 as the target processor.

After that task is complete, install the MCC18 C com-

piler in a similar manner. Finally, install the software
that came with the WARP-13 or Microchip programmer.
At this point, all of the software tools required to start
using the PIC18C452 should be ready for use. For con-
venience you can create shortcuts for these programs to
your Windows desktop.

The first task is to create an MPLAB project for the

test application. It will contain all the files associated
with the test program, including the C source code and
listing, map, and hex files that you need to burn the
application into the PIC18C452. Now, let’s look at the
steps required to create this project for the first time.
Note: Throughout this sidebar, “click” means clicking
on the left mouse button; “->” means that a new dialog
box or window will appear.
• Step one: Run MPLAB by clicking on the MPLAB icon

or Start icon (by clicking Start -> Programs ->
Microchip MPLAB).

• Step two: Create an MPLAB project file by clicking

New->Project-> test1.prj.

• Step three: Now it’s time to set the development mode

parameters. Click the Change button and select
“MPLAB-SIM18C452” from the processor scroll win-
dow list.

• Step four: Click on the Clock tab and select “HS” from

the oscillator type and set the desired frequency to
20 MHz.

• Step five: Click on the Configuration tab and select the

None and Microcontroller diamonds, then click on the
OK button.

• Step six: Click on the Tools tab, select the MPLAB-SIM

Simulator diamond, and then click OK.

• Step seven: Select “Microchip” from the Language Tool

Suite list box.

• Step eight: Save the project by clicking on Project->

Save Project.

The second task is to create a test C program (file

name

test1.c) that you can burn into the PIC. It’s a

simple program that displays the message “I am
Alive!!!”. This task includes creating the C file, saving it
to disk, using the MCC18 C compiler and linker to com-
pile and link

test1.c into a hex file.

• Step one: Click File->New and a window panel should

appear with “Untitled1” in the title bar.

• Step two: Type or copy the test program available to

download from Circuit Cellar’s web site.

• Step three: Click File->Save as -> test1.c to save the

program you have entered.

The procedure to compile a program for the first time

is as follows:
• Step one: Click Project->Edit Project
• Step two: Select test1 [.hex] from the Project Files pane.
• Step three: Click on Node Properties
• Step four: Select MPLINK from the Language Tool list

box, then click OK.

At this point, you’re ready to add the necessary files,

like C files, C libraries, and linker control files.
• Step one: Click on Add Node and select test1.c, which

should be listed in the File Name dialog list box, then
click OK. The file name

test1 [.c] should now

appear inside the Project Files pane.

• Step two: Click on

test1 [.c], and then on Node

Properties->Language Tool. Select MPLAB-C18 from
the Language Tool dialog list box, and click OK.

• Step three: Click on Add Node->Drives, and then select

“c:”.

• Step four: Click Folders and select the directory that

the MCC18 compiler was installed under. I used the
mcc18 directory.

• Step five: Click List files of type, select Linker Scripts

[*.lkr], and then select 18c452.lkr. You can use the find
function to find this file if it isn’t there.

• Step six: Enter “c:\mcc18\h” in the Include Path text

box.

• Step seven: Enter “c:\mcc18\lib” in the Library Path

text box, click OK, and then click Cancel.

Now you’re prepared to compile and link the

test1.c

file. If there are no syntax errors, the build should create
all of the necessary files required to burn the PIC. Here’s
the final step: Click on Project->Build All.

background image

28

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Excel, Mathcad, Matlab, or any other
PC analysis tool. This is great for
characterizing sensors, calibrated
them, computing gains and offsets,
determining thresholds, and so on.

DEBUGGING AND INTEGRATION

The hardware integration phase is

the most complicated and time-con-
suming part of embedded software
development. The duration of this
phase won’t take as long if the appli-
cation software has been well simu-
lated and tested as explained in the
“Debugging and Running Your
Application” sidebar.

Normally, you have a plethora of

tools—hardware emulators, logic ana-
lyzers, oscilloscopes, function genera-
tors, etc.—to help you along. Most of
these tools may be too expensive.

Although I won’t jump into the

details about ICE here, note that
Microchip provides the MPLAB-ICE

By connecting the USART of the

’18C452 to a MAX233 driver, a com-
munication path is established
between the PIC and host. Debug out-
put and results now may be commu-
nicated between the host and target.

This tried and true technique for

embedded debugging has been around
for a long time, well before ICE hard-
ware emulators were developed. The
idea is to use

printf, dec, hex2, and

hex4 statements that are similar in
functionality to the Stamp BS2/BSX
debug and serout commands to gener-
ate debug output and results.

The

printf debug statements are

inserted in critical test point loca-
tions within the C source code and
the only output from the embedded
application will be captured with a
HyperTerminal serial RS-232 terminal
emulator or from DOS using a com-
munications package such as PRO-
COMM. Or it may be captured using

2000 hardware emulator; read MPLAB
ICE Emulator User’s Guide

for more

information. Instead I provide a more
modest approach that is easier for all
of our budgets. My approach is simi-
lar to that used by the Parallax
BS2/BSX Stamp, using the RS-232
serial port for embedded debugging.

Debugging and Running the Application

The procedure explained in this sidebar is used to run

the program or application on MPLAB using the built-in
simulator MPSIM. The first debugging task is to set a
break point inside the application’s source code. Next,
you’ll see the single-step instruction. After that, you’ll
see the PIC registers and the complete assembly language
listing with the C source interleaved. Also included are
the watch command and system reset of the simulation.
Check out the Microchip user’s guide for more informa-
tion. [1] Note: Throughout this sidebar, “click” means
clicking on the left mouse button; “->” means that a new
dialog box or window will appear.
• Step one: Run MPLAB by clicking on the MPLAB icon

or the Start button (by clicking on Start->Program->
Microchip MPLAB).

• Step two: To start your application inside MPLAB, first

click on the Yes box if it appears, otherwise click File->
Open…->test1.pjt.

• Step three: Set a break point inside

test1.c by click-

ing File->Open and selecting “test1.c” from the File
Name dialog box.

• Step four: Move the cursor to the “printf(“I am

alive!\r\n”)” statement and click the right mouse
button, then select Break Points from the list box. The
printf statement should highlight red.

• Step five: Click on the green light on the tool bar above

and MPSIM will execute the code up to the highlighted
printf statement. Now, the highlighted text will
become black.

• Step six: To examine the PIC registers, click on the

SFR button located on the tool bar. All available PIC reg-
isters should appear on the screen in a small window.
• Step seven: To look at the

test1.lst assembly

language listing generated by the C compiler, click
Window->Absolute Listing. This detailed listing shows
the PIC assembly along with the original C source code.

• Step eight: In order to single step through code, click on

the footprint symbol (without the orange stripe) located
on the tool bar a few times.

The watch command allows you to examine the con-

tents of C variables in various output formats. The steps
required to set a watch on a C variable are as follows:
• Step one: Select the test1.c window by clicking on the

blue selection bar located on the top of the window.

• Step two: Highlight the C statement

dec(I) and set a

break point there by clicking on the right mouse

button and selecting break point. The

dec(I) state-

ment should now be highlighted in red.

• Step three: Click on the green light on the tool bar and

MPSIM will execute the code up to the

dec(I) state-

ment. The statement will now be highlighted in black.

MPSIM has simulated the application to this location.

Now it is time to look at the contents of the C variable
(I) using the watch function.
• Step one: Click on the green Eyeglass button, then

select or type “I” and click the Add button. The I sym-
bol should appear inside the watch window in hex.

• Step two: In order to save the Watch window for later

reference, click on the small box at the left corner of
the blue select bar and select Save Watch. Then type

Figure 3—

A proposed USART or I

2

C combination raw

and scaled sensor packet with its checksum is shown
here. The data is presented in its raw and scaled
states for diagnostic applications.

Sensor ID

Scale

Offset

Raw sensor value

Scaled sensor value

Minimum sensor value

Maximum sensor value

Window minimum

Window maximum

Checksum

background image

an application written in Visual C++
or Visual Basic. All data that is cap-
tured can be saved to log files for later
processing or viewing.

EXPERIMENTS

Now it’s time to put all this infor-

mation to practical use. You can test
with the following experiments. I pro-
vided most of the functionality with
the code available on Circuit Cellar’s
web site. In fact, if you want to, you
can burn the main application (

sen-

sor.hx8) into a PIC18C452 directly
using the Warp13 programmer. Then,
you could use it as is without the
demo C compiler.

These experiments use functions

from the Microchip C libraries,
including those involved with the
USART, Timer, I

2

C, and I/O func-

tions. Also included are the object
code files for some utility functions
that may be linked to an application.

to use the board to read up to eight
analog sensors that are connected to
the board’s analog input terminals.
Various types of sensors that may be
interfaced to the board are noted in
Sensors for Mobile Robots: Theory
and Application

. [2]

The sensor averaging experiment

demonstrates how to scale and aver-
age the sensor readings to increase the
dynamic range and reduce noise (see

The experiments demonstrate a fea-
ture of the PIC18C452 that is not
available with the BSX nor many 8-
bit micros; this application uses the
PIC C floating point libraries to
process sensor algorithms.

The USART is used extensively

during the experiments for serial I/O
and debugging, using the

printf

function that I developed, which is a
simpler version of the ANSI C
printf. It prints text only to the
serial port. For printing numeric and
hex data, I developed the

dec, hex2,

and

hex4 functions that are identical

in function to the BSX functions.

You may have to modify the board

to perform some of these experi-
ments. I provided source code for
only the first three experiments. You
may use the hardware changes and
remaining experiments as exercises.

The read analog sensor experiment

shown in Listing 1 demonstrates how

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

29

“test1.wat” in the File Name: dialog box and click OK.

• Step three: Click on the green icon six times and you

will see the I symbol count from zero to five.

Now, you should see a system reset that allows you to

restart the simulation in a similar manner to an actual
microprocessor hardware reset.
• Step one: To restart from scratch, select Debug ->

Power-On-Reset.

• Step two: Select the “Fill all RAM locations with

Value:” diamond and enter “00” in the text dialog box.

• Step three: Click on the Power On Reset button inside

the dialog box.

• Step four: Click on the Cancel button to dismiss the

dialog box.

Most of the basic MPSIM debugging instructions have

been covered at this point, but I
encourage you to pursue advanced
debugging concepts such as step over,
step into, trace points, code profiling
(using the stop watch) by reading the
selections in the References section.
Use the algorithms in these works to
test your application.

After the application performs as

expected in simulation, it’s time to
use real hardware. This process is
known in the embedded world as
burning the EEPROM. The following
procedure shows how an application
is first burned into an EEPROM, in
this case, the sensor controller board.

Before beginning the process, make sure the WARP-13
has been connected to the host as the instructions suggest.
• Step one: Insert a blank or recently UV erased

PIC18C452 into the DIP ZIF socket. Note the position
of pin 1.

• Step two: Run MPLAB by clicking on the MPLAB icon

or Start button (by clicking on Start->Program->
Microchip MPLAB).

• Step three: To start your application inside MPLAB,

first click on the Yes box if it appears, otherwise click
on File->Open…->test1.pjt.

• Step four: Make sure

test1.pjt has been recently

been compiled and linked by using the build command.

• Step five: Click on Enable Programmer. The message

“Establishing communications with PICSTART Plus”

should appear on the screen in an
information dialog box. After a few
seconds a new Configuration Bits
dialog box should appear. Table s1
shows how the bits should be con
figured.

• Step six: Click on Blank to perform

a blank check of the ’18C452. If it
isn’t blank, put it through another
erase cycle in the UV eraser and
repeat this step.

• Step seven: Click on Program to

program the PIC.

• Step eight: Click on Verify to verify

that the PIC has been correctly
programmed.

Bit

Status

Oscillator

HS

Watchdog tmer

Disabled

Watchdog post scale

1:128

Power-up timer

Enabled

Code protect

Disabled

Brownout detect

Enabled

Brownout voltage

2.5 V

OSC Switch enable

Disabled

CCP2 Mux

RC1

Stack overflow reset

Enabled

Table s1—

You need to make sure the Code

Protect bit is disabled, otherwise the PIC18C452
may be permanently programmed.

Figure 4—

The data contained in the I

2

C sensor cali-

bration packet is enough to calibrate almost any sen-
sor. It allows a host PC or laptop to perform the sen-
sor calibration procedure.

Sensor ID

Raw sensor value

Scaled sensor value

x Position

yPosition

Checksum

background image

30

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Listing 3—

Now you know how to detect objects using the GP2D12.

*******************************************************************

AvoidBehavior detects objects within the range of the IR rangers

by comparing the distances to possible objects to a threshold dis-

tance. If the distance is less than the threshold value, it

reports the range.

*******************************************************************

void AvoidBehavior(void)

{

int i;

while (TRUE)

{

for (i = 0; i < 6; i++)

{

// Display the latest interrupt counts

printf(“PortBCount4 = ");

dec(PortBCount4); // Write value to USART

printf(" ");

printf("PortBCount5 = ");

dec(PortBCount5); // Write value to USART

printf(" ");

printf("PortBCount6 = ");

dec(PortBCount6); // Write value to USART

printf(" ");

printf("PortBCount7 = ");

dec(PortBCount7); // Write value to USART

printf("\r\n");

printf("\r\n");

// Read averaged sensor value from selected A/D channel

SensorTable[i].AverageSensorValue = AverageSensor(i);

printf("trace 0: i = ");

dec(i);

printf(" Avg. Sensor = ");

dec(SensorTable[i].AverageSensorValue);

printf("\r\n");

// Check to see if an obstacle is within the current

sensor’s detection range

if (SensorTable[i].AverageSensorValue >

SensorThreshold[i])

{

// Report that an object was detected by the current

sensor

// Send reading back to host

printf("trace 1: Sensor");

dec(i);

printf("Has detected an object at a distance");

dec(SensorTable[i].AverageSensorValue);

// Convert to string

printf("\r\n");

// Send carriage return

}

}

}

}

background image
background image

32

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Listing 2). Execute this experiment by
selecting the F00 command in the
sensor controller board software.

Listing 3 shows the object detec-

tion experiment, which demonstrates
how to read and process data from up
to eight GP2D12 analog IR ranger
sensors. The sensor values are aver-
aged and then compared to thresholds
to determine the presence of an obsta-
cle. Any objects within range are
reported to the host or master micro-
controller via the USART or I

2

C inter-

face (this shows up as a ring of blue
fire when IR rangers are seen through
a video camera). The E00 command
executes this experiment.

The sensor calibration experiment

performs light and dark calibration on
readings obtained from a CDS and
photo cells and saves the calibration
data to serial EEPROM for future ref-
erence using the I

2

C interface. You

can also use it to compare light read-
ings with various thresholds to deter-
mine if it’s light or dark outside.

The digital I/O experiment is used

to read and process up to eight digital
inputs using port B (switches,
bumpers, proximity sensors, etc.).

The data logger experiment reads

temperature sensor data, calibrates it,
and logs the scaled readings to a serial
I

2

C EEPROM along with a time and

date stamp using the analog analog-
to-digital port and a Philips PCF8583
I

2

C real-time clock.

In addition, you can try filtering

and compressing voice data digitized
by the PIC18C452 ADC using IIR,
FIR, and FFT algorithms. For more
information regarding this experi-
ment, you should read an excellent
article by Robert Lacoste titled “PIC
Spectrum Audio Spectrum Analyzer”
(Circuit Cellar 98).

Next, use the USART and MAX233

to send RS-232 data back to the host
for analysis with Excel or Matlab.

There are numerous other sources

for experiments to try, as well. For
fuzzy logic and sensor fusion algo-
rithms, Edwin Wise describes a C-like
fuzzy language called Fuzbol that uses
an Atmel microprocessor in his book
Applied Robotics

. [3] Another option

is John Iovine’s introductory fuzzy
logic experiments using a PIC. [4]

You may find an interesting test

for advanced robotic behaviors such
as looking at light (moth), follow, and
avoid by using algorithms in Joseph
Jones’s Mobile Robots: Inspiration to
Implementation

or Build Your Own

Robot!

by Karl Lunt. [5, 6]

INTEGRATING THE PARTS

Throughout this series, I have

shown how applications may be
developed in Microchip C using a
PIC18Cxxx device using cost effective
tools that are freely available on the
’Net. I described how the PIC18Cxxx
architecture lends itself to a high-
level language such as C. Microchip’s
extensive CSP package and its float-
ing point support were covered.

Additionally, you now have a list

of interesting experiments that you
may carry out on the sensor con-
troller board. I described an I

2

C elec-

tronic network for communications
among the various Hero I electronic
modules; it uses simple data packets
for messages that I intend to imple-
ment in the future. For a simple step-
by-step guide, included are two short
tutorials on using Microchip embed-
ded development tools.

I reached one of my primary goals

for the sensor controller board with
the successful completion of the
object detection experiment, which
provides the means to detect objects
near the Hero I robot in time to pre-
vent a collision. Another goal was
reached when I used my laptop with a
stand-alone version of the PIC18C452
as a mobile data collection platform
while I was testing it.

I have plans to perform some of

the remaining experiments men-
tioned here and to integrate this
board with some of my other robot
designs as time permits. Hopefully

Figure 5—

The I

2

C display sensor packet used for a

real-time sensor display includes the x and y coordi-
nates for a given sensor so that they may be displayed
on the PC screen or an attached LCD.

Sensor ID

Scaled sensor value

Checksum

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

33

REFERENCES

[1] Microchip Technology Inc.,

“MPLAB-CXX Reference
Guide,” DS51224B, 2000.

[2] H. R. Everett, “Sensors For

Mobile Robots: Theory and
Application,” AK Peters, Ltd.,
Natick, MA, 1995.

[3] E. Wise, “Applied Robotics,”

Prompt Publications,
Indianapolis, IN, 1999.

[4] J. Iovine, “Robots, Androids, and

Animatrons: 12 Incredible
Projects You Can Build,”
McGraw-Hill, New York, New
York, December 1997.

[5] J. Jones, “Mobile Robots:

Inspiration to Implementation,”
2nd ed., AK Peters, Ltd., Natick,
MA, November 1999.

[6] K. Lunt, “Build Your Own

Robot!” AK Peters, Ltd., Natick,
MA, 2000.

RESOURCE

Microchip Technology Inc.,
“MPLAB IDE Simulator Editor
User’s Guide,” DS251025E, 2001.

SOURCES

GP2D12 IR Ranger sensor
Sharp Electronics Corp.
(201) 529-8200
Fax: (201) 529-8425
www.sharp-usa.com

PIC18C452 Microcontroller
Microchip Technology Inc.
(480) 786-7200
Fax: (480) 899-9210
www.microchip.com

Daniel Ramirez is currently a senior
software engineer with more than
10 years of experience working on
real-time embedded systems. His
hobbies include travel, golf, treasure
hunting, and robotics.

SOFTWARE

The source code is available on
Circuit Cellar

’s web site.

you’ll find this information useful to
get started developing your own inter-
esting PIC18Cxxx applications that
deal with various sensors.

I

background image

n the Midwest,

the main topics of

conversation include

the local football team

or how the crops are doing. Inevitably
though, the conversation always leads
to the weather. Most of us take the
weather for granted. But, in states like
Kansas, Oklahoma, and Texas, weath-
er is spelled with a capital “W” and is
closely monitored by both the average
person and the media. Weather is
thunderstorms, tropical depressions,
tornados, blizzards, squall lines, sta-
tionary fronts, cold fronts from
Canada, warm, moist Gulf air, and
hurricanes. The onset of any one of
these events can be detected by moni-
toring a few basic conditions.

When you check the weather

on the television or radio, you
get the conditions at the airport
or some other remote location.
But what are conditions like in
your backyard? To address this,
I embarked on the design of my
Wireless Weather Station. I
meant to do this project many
years ago, but two bits of tech-
nology finally spurred me into
action: a low-cost, solid-state
humidity sensor and small,
monolithic RF transceivers.

THE DESIGN

The Wireless Weather Station is

composed of a remote station and
base station. The former is solar-pow-
ered and wakes up once per minute
to collect and transfer data. The base
station receives and buffers the
incoming data and then transfers it
via an RS-232 connection to a PC for
processing. Within each of the sta-
tions is a dedicated circuit card as
well as a separate RF circuit card.

I’ll start our discussion with the

remote station design.

REMOTE STATION

The remote station consists of four

functional sections, including the
sensors, PIC16F873 microcontroller,
RF circuit, and power supply. The
schematic in Figure 1 shows the sen-
sor and microprocessor areas.

For humidity sensing, I opted for

the Humirel HS1101 capacitive sen-
sor. This device, when combined
with a CMOS 555 timer operating as
a stable multi-vibrator, produces a
signal with a humidity-dependent fre-
quency. To minimize temperature
effects, it’s important to use the
Texas Instruments TLC555 in this
design. (Refer to the HS1101
datasheet if you use a different
device). Also note that care must be
taken at the node of the HS1101 and
555. Stray capacitance values will
lead to erroneous and unpredictable
measurements. I soldered this node
above the circuit card.

Figure 2 demonstrates the relation-

ship between the output frequency of
the 555 and relative humidity. A first
order equation that relates relative

34

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

FEATURE
ARTICLE

Jerry Wasinger

Build a Wireless
Weather Station

Whether mother
nature sends you run-
ning for the root cellar
regularly or you just
like knowing what’s
happening in your
backyard, Jerry’s
weather station can
help. With a PIC micro,
sensors for tempera-
ture, humidity, and
pressure, and a VB
program, you’re all set.

i

Photo 1—

With the control panel, you may gain access to all of

the features of the weather station.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

35

To determine the temperature in
degrees Fahrenheit, use the equation:

°F = 1.8 × °C + 32.2
= 1.8 × (100 × V

OUT

– 273) + 32.2

[5]

= 180 × V

OUT

– 459.2

At room temperature, this device out-
puts about 3 V.

Pressure sensing is provided by a

Motorola MPX5100A,
which operates from 0
to 16 psi. However,
you’re interested in
only a small portion of
the available range.
Barometric pressure
readings fall between
28

and 32

of mercury.

This translates to
13.75 to 15.72 psi. To
increase the dynamic
range of the output, I

humidity to frequency is:

R.H. = 565.1 – 0.0767 × f

[1]

For improved accuracy, a second

order equation can be used:

R.H. = –6.4790E – 06 × f

2

+

1.0047E – 02 × f + 2.7567E + 02

[2]

Temperature sensing is straightfor-

ward with the LM335. The output of
this device is equal to the absolute
temperature in degrees Kelvin divided
by 100, or:

[3]

To determine the temperature in
degrees Celsius, use the equation:

°C = 100 × V

OUT

– 273

[4]

added an amplifier circuit (U4), which
subtracts about 3.7 V from the sensor
output and then multiplies the differ-
ence by four. Because the MPX5100
can require as much as 10 mA, I
added Q1 to provide microprocessor-
controlled switching.

I chose the PIC16F873 because it

has the right mix of program and data
memory, a 10-bit ADC, and three

Figure 1—

Each sense circuit has been outlined in this schematic of the sensor electronics and microprocessor circuit for the remote station.

120

100

80

60

40

20

0

6000 6200 6400

6600 6800

7000 7200 7400

Figure 2—

This graph shows the relationship between the output frequency

of a Humirel sensor connected to a 555 timer and the relative humidity. You
may use a first-order approximation, however, note that a second order pro-
duces more accurate results.

background image

the 5-v outputs of the microprocessor
because the transmitter circuit oper-
ates at 3.3 V. Note that pin 14 of the
74HC4066 needs to be connected to 5
V and pin 7 needs to be grounded. JP1
is a six-pin header that connects to
the RF circuit card.

Figure 3 illustrates the power sup-

ply for the remote station. When the
sun is shining on the solar panel
(SC1 part no. 980-1045 at Radio
Shack), enough power is generated to
drive the 50-mA current source
formed by Q1, U1, and R1. This cur-
rent acts as a trickle charger for three
AA NiCaD batteries.

The batteries power U2, a switch

mode regulator that provides the 5 V
for the microprocessor and sensors.
This is followed by U3, which is a
linear regulator that provides 3.3 V
for the RF circuitry. L2 and C5 were
added to reduce the switching noise
from U3. D2 isolates the solar panel
from the rest of the circuit when it’s
dark. Note that C3 and C5 should be
6.3-V low ESR capacitors.

The RF section was built around

the TX5002 and RX5002 chips from
RF Monolithics (see Figure 4). I had
to design a small PCB because of the
footprint of these devices. Fortunately,
the chips have pin-outs that allow a
single board to be used for both the
transmitter and receiver.

I was able to get all the traces on a

single layer, hence fabrication was
greatly simplified. I drilled the four

timers. Timer2 measures the period of
the humidity signal. The ADC meas-
ures the temperature and pressure
sensors and monitors the battery volt-
age. To maximize accuracy, I used an
external 4.096-V, 0.1% reference
from National Semiconductor. With
the 10-bit ADC, this provides a reso-
lution of 4 mV/count.

The interface to the RF link consists

of an enable line and data output. I
used analog switches to translate from

36

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

Figure 3—

The heart of the remote station’s power supply circuit is U2—the boost mode switch mode regulator IC.

The solar panel, SC1, is available at Radio Shack.

Table 1—

This table contains the list of components

loaded on the transceiver circuit board. Depending on
which set of parts is used, the board will be either a
transmitter or receiver.

Reference

Transmitter value

Receiver value

C1,C4

100 pF

100 pF

C2

10 µF

10 µF

C3

Not used

0.015 µF

JP1

Used

Not used

JP2

Not used

Used

JP3

Not used

Used

JP4

Not used

Used

JP5

Used

Used

JP6

Used

Used

JP7

Used

Used

J1

BNC

BNC

J2

6-pin header

6-pin header

L1

56 nH

56 nH

L2

220 nH

220 nH

L3

Bead

Bead

R1

Not used

270 k

R2

Not used

330 k

R3

Not used

27 k

1%

R4

Not used

100 k

1%

R5

Not used

30 k

R6

47 k

47 k

R7

8.2 k

Not used

R8

10 k

Not used

U1

TX5002

RX5002

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

37

corner holes to allow mounting with
4-40 screws. The antenna is connect-
ed via a BNC jack on the left side.
However, you may connect a length
of coax to this pad in order to use a
panel-mount connector.

It’s necessary to use solder paste to

connect the RFM modules to the

PCB. Carefully apply the paste to the
pads of U1 on the board. Next, posi-
tion the module onboard, and then
heat it with a hot air gun until the
solder melts. Except for C2, the
remaining components are in 0603
SMT packages. C2 is a tantalum
capacitor in an A package.

Connection of the RF board is

through header J2, which plugs into
socket JP1 on the remote station.

Again, the same board is used for

the transmitter and receiver. Which
parts are used is determined by the
function of the board. Table 1 sum-
marizes which uses what.

Figure 4—

The transceiver circuit was designed to support both transmitter and receiver modules from RFM. Stuffing options control the mode and operation of the circuit.

AD422 (Requires 9VDC) $79.00
AD422-1 for 110VAC

89.00

AD422L signal powered

84.00

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;
no software changes of any type are
necessary.

RS232/RS422/RS485 Converters

• Converts an RS232 port for

use with RS422 or RS485
devices

• Supports up to 40 RS485 or

RS422 multidrop devices

• Adds multidrop capability to

RS232 devices

• Automatically determines

data direction.

RS232 TO RS485

4 wire

• Makes your RS232 port an

RS485 port

• Supports up to 40 RS485

devices

• Automatically determines

data direction.

• Signal powered version

available

RS232 TO RS485

2 wire

ADA425 (requires 9VDC) $89.00
ADA425-1 for 110VAC 99.00

Mention this ad when you order and deduct 5%

Use Visa, Mastercard or company purchase order

WWW.2CMC.COM Fax:(203)775-4595

code

CC83

PO BOX 186, Brookfield,CT 06804

(203)740-9890

Connecticut microComputer, Inc.

• Converts bi-directionally

between RS232 and RS422

• Use as a short haul modem
• Plug in and go. No software

changes required

RS232 TO RS422

background image

To maximize range, I used

λ

/4 stub

antennas over

λ

/2 ground planes for the

transmitter and receiver. The antenna
length can be calculated from:

[6]

The construction details for the
antennas are shown in Figure 5.

BASE STATION

The base station is also built

around the PIC16F873 (see Figure 6).
For this application, I used the second

onboard oscillator to generate a real-
time clock and configured the MSSP
as a UART for asynchronous commu-
nication with the host PC.

RS-232 buffering and level transla-

tion is accomplished through the
MAX232. A standard DB25 connector
connects to the PC. J3 provides con-
nectivity to the RF receiver board,
which I assembled with the compo-
nents specified in Table 1. Note that
no voltage conversion is required
between the DATAIN pin of the RF
receiver and the microprocessor
because the minimum high-voltage
input for the PIC is 2.0 V.

Power is provided via a 9-VDC,

wall-mounted power supply driving a
78L05 regulator for 5 V and an

38

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

0.048 Aluminum

sheeting

36

36

18

12-Gauge copper wire

BNC panel mount

connector

Antenna (top view)

Antenna (side view)

All dimensions are in centimeters

Figure 5—

This sim-

ple mechanical draw-
ing shows the assem-
bly details of the
antennas. Solid 12-
gauge copper wire is
available in local
hardware stores.

Listing 1—

This psuedo-code describes the operation of the remote station software.

Loop

Sleep for 1 minute
Turn on Pressure Sensor
Perform A/D conversion on Temp Sensor

Average four readings
Add Hamming codes to data

Measure pulse width of humidity sensor circuit

Measure period of 555 oscillator / 16
Compress data to fit into 10 bits
Add Hamming codes to data

Perform A/D conversion on battery

Average four readings
Add Hamming codes to data

Delay additional 20msec for Pressure Sensor Stabilization
Perform A/D conversion on Pressure Sensor

Average four readings
Add Hamming codes to data

Turn Off Pressure sensor
Transmit Data

Turn on transmitter and wait two bit times for settling
Send Preamble of eight 1’s and eight 0’s
Send 14 bits of temperature data
Send 14 bits of pressure data
Send 14 bits of humidity data
Send 14 bits of battery data
Turn off transmitter

Repeat Loop

background image

LT1121 for 3.3 V. A single
green LED provides a
power indicator. When the
microprocessor detects the
reception of a valid data
packet, additional current
is injected into the LED,
causing it to pulse.

MICROPROCESSOR
CODE

The code for the remote

station is simple and can
be explained easily with
the psuedo-code given in
Listing 1. Read the
“Ensuring Data Integrity
with Hamming Codes”
sidebar for more details.

The firmware in the

base station performs
seven functions. It detects
and decodes data from the
RF receiver; performs error
correction on the received
data; encodes the received
data into ASCII format;
transmits the ASCII data
to the RS-232 port; per-
forms hourly data logging on received
data for a total of 24 h of data; detects
and responds to RS-232 requests for
the latest and historical data

The base station firmware relies on

interrupts to detect and collect
incoming data as well as to maintain
the 1-h clock for data logging. After
these events occur, flags are set that
inform the main loop that either new
data is available or it’s time to store a
reading in memory.

The main loop monitors the flags

set by the ISR. If the Received Data
flag is set, the RS-232 transmitter
routine is called. If the Log Data flag
is set, the last received data block is

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

39

Photo 2—

In this view of the base station circuit, you

notice the RF transmitter circuit card on the left and
the humidity and pressure sensors along the bottom.

Figure 6—

The base station is a simple design based on the PIC16F873. A MAX232 provides the RS-232 interface and linear reg-

ulators provide the 5- and 3.3-V power supplies.

background image

40

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Ensuring Data Integrity with Hamming Codes

In critical applications in which there is only

one opportunity to exchange data, it’s common to
use forward error correction, or FEC. This tech-
nique is often often applied to the data sent from
satellites; because of the time delays inherent with
the great distances between a space probe and
ground station, it’s more efficient to encode the
transmitted data with forward error correction
than to request a retransmission. FEC is accom-
plished by transmitting extra bits with an n bit
sequence so that errors can be detected and correct-
ed by the receiver. One common implementation
of FEC is Hamming codes.

In this application, the basic data block consists

of a 10-bit A/D value. By adding four parity bits for
the Hamming code, you increase the block size to
14 bits but with the added benefit of being able to
detect and correct a single bit error. Consider the
data arrangement in Figure s1.

P1, P2, P3, and P4 are your parity

bits and D9–D0 are the A/D reading.
To calculate each of the parity bits,
use modulo –1 arithmetic. With
modulo 0 – 1 arithmetic, the sum of
an even number of ones results in a
zero; the sum of an odd number of
ones results in a one.

Each of the parity bits is calculated using the

equations below:

P1 = D9 + D8 + D6 + D5 + D3 + D1
P2 = D9 + D7 + D6 + D4 + D3 + D0
P4 = D8 + D7 + D6 + D2 + D1 + D0
P8 = D5 + D4 + D3 + D2 + D1 + D0

On the receive side, the Check bits are calculated
from:

C1 = P1 + D9 + D8 + D6 + D5 + D3 + D1

C2 = P2 + D9 + D7 + D6 + D4 + D3 + D0
C4 = P4 + D8 + D7 + D6 + D2 + D1 + D0
C8 = P8 + D5 + D4 + D3 + D2 + D1 + D0

If there are no errors in the data, the value of the

nibble formed by C8 – C4 – C2 – C1 will be zero. If
there is an error, the value of C8 – C4 – C2 – C1
will contain the bit location that requires correc-
tion. To correct the bit, just invert its value!

For example, let’s assume that you have an ADC

value of 3A8h, or 1111001000b. Your transmitted
Hamming code for this block becomes Figure s2a.
On the receive side you might receive what’s
shown in Figure s2b.

When the data is received correctly, the code val-

ues are:

C

8

= 1 + 0 + 0 + 1 + 0 + 0 + 0 = 0

C

4

= 1 + 1 + 1 + 1 + 0 + 0 + 0 = 0

C

2

= 0 + 1 + 1 + 1 + 0 + 1 + 0 = 0

C

1

= 0 + 1 + 1 + 1 + 0 + 1 + 0 = 0

Thus, the check code, C

8

C

4

C

2

C

1

, is equal to 0000b

for error-free data.

When an error occurs in the ninth bit, the check

code values are:

C

8

= 1 + 1 + 0 + 1 + 0 + 0 + 0 = 1

C

4

= 1 + 1 + 1 + 1 + 0 + 0 + 0 = 0

C

2

= 0 + 1 + 1 + 1 + 0 + 1 + 0 = 0

C

1

= 0 + 1 + 1 + 1 + 1 + 1 + 0 = 1

C

8

C

4

C

2

C

1

= 1001 indicates the

erroneous bit position of 9.

Finally, if an error occurs in the

third bit, you get:

C

8

= 1 + 0 + 0 + 1 + 0 + 0 + 0 = 0

C

4

= 1 + 1 + 1 + 1 + 0 + 0 + 0 = 0

C

2

= 0 + 0 + 1 + 1 + 0 + 1 + 0 = 1

C

1

= 0 + 0 + 1 + 1 + 0 + 1 + 0 = 1

C

8

C

4

C

2

C

1

= 0011 confirms the

erroneous position of bit 3.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Position

P1

P2

D9

P4

D8

D7

D6

P8

D5

D4

D3

D2

D1

D0

Contents

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Position

P1

P2

D9

P4

D8

D7

D6

P8

D5

D4

D3

D2

D1

D0

Contents

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Position

P1

P2

D9

P4

D8

D7

D6

P8

D5

D4

D3

D2

D1

D0

Contents

0

0

1

1

1

1

1

1

0

0

1

0

0

0

No error

0

0

1

1

1

1

1

1

1

0

1

0

0

0

Error in bit 9

0

0

0

1

1

1

1

1

0

0

1

0

0

0

Error in bit 3

0

0

1

1

1

1

1

1

0

0

1

0

0

0

Value

Figure s1—

Check out the arrangement of data in a 14-bit Hamming code. Take note of the insertion

and position of the four parity bits.

Figure s2a—

For the example in this article, these are the correct positions and values of each bit of the

transmitted Hamming code.

b—

There are three possible sets of received Hamming codes. The Hamming

codes used in this project can detect and correct a single bit error for each character sent.

a)

b)

background image

T

H E

W

O R L D

L

E A D E R

I N

D S P

A N D

A

N A L O G

The red/black banner is a trademark of Texas Instruments. 45-5216R

© 2001 TI

Mixed-Signal Controllers

Choose, don’t compromise. The MSP430F12x from Texas Instruments is the latest addition to

the expanding portfolio of Flash-based 16-bit RISC MCUs. From $0.99 to 60 kB, the MSP430

family provides a range of exceptional cost/performance solutions to meet the rigorous

requirements of low-power applications. See for yourself: order your development tool today.

TI MSP430: the choice in
ultra-low-power Flash MCUs.

Contact us for the

MSP-FET430P120 Flash

emulation tool for

only $99 or a free

MSP430F12x data sheet.

www.ti.com/sc/f12x

MAB

MDB

ACLK

SMCLK

RISC

CPU

16-bit

JT

AG/DEBUG

FLASH

4/8 kB

Watchdog

15-bit

Timer A3

16-bit

Comp_A

Port 2

USART0

SPI/UART

RAM

256 B

Power-On

Reset

Port 1

Port 3

8-MHz

Basic

Clock

MSP430 Road Map

Flash
LCD Driver

Flash

OEM ROM

LCD Driver

1998

2000

2002

Performance

F12x

Applications:

Ideal for battery-powered applications such

as utility metering, intelligent sensing and
portable measurement

Features:

Ultra-low power consumption –

250-µA active mode, 0.8-µA standby mode
at 2.2 V (typ.)

Integrated analog peripherals

ideal for precision data conversion

16-bit RISC CPU enables new

applications at a fraction of the code size

In-system programmable Flash allows

last-minute code changes and remote
field upgrades

P120

Flash RAM I/O WDT Comp_A Timer_A USART Timer_B

ADC MPY Price

MSP430F1101 1 kB 128 14

X

X

X

$0.99

MSP430F1111 2 kB 128 14

X

X

X

$1.34

MSP430F1121 4 kB 256 14

X

X

X

$1.74

MSP430F122 4 kB 256 22

X

X

X

X

$2.39

MSP430F123 8 kB 256 22

X

X

X

X

$2.51

MSP430F1222* 4 kB 256 22

X

X

X

10-bit

$2.62

MSP430F1232* 8 kB 256 22

X

X

X

10-bit

$2.79

MSP430F133

8 kB 256 48

X

X

X

X

X

12-bit

$2.96

MSP430F135

16 kB 512 48

X

X

X

X

X

12-bit

$3.55

MSP430F147

32 kB 1024 48

X

X

X

X

X

12-bit

X

$4.95

MSP430F148

48 kB 2048 48

X

X

X

X

X

12-bit

X

$5.65

MSP430F149

60 kB 2048 48

X

X

X

X

X

12-bit

X

$5.95

† Suggested 10KU resale
* Available 1Q02

MSP430F12x

background image

buffered. In addition, the main loop
monitors the RS-232 receiver. If the
character “L” is received, the last
reading is transmitted to the serial
port. If the character “H” is received,
the last 24 hours of logged data are
sent to the serial port.

The serial data is transmitted at

9600 bps using an 8N1 format. The
ASCII encoded measurement data

stream looks like:

T:ttt, P:ppp,
H:hhh, B:bbb

where T is temperature, P
is pressure, H is humidi-
ty, and B is battery volt-
age. ttt, ppp, hhh, and
bbb

are the 10-bit read-

ings in hexadecimal for-
mat. This data has been
error corrected but not
calibrated. It’s the appli-
cation software’s job to

convert the hex values
and perform the calibra-
tion corrections.

To convert the temperature and

pressure, the measured voltage equals
the hex code multiplied by 0.004, in
other words:

Vtemp = ttt × 0.004

[7]

Vpres = ppp × 0.004

The conversion of battery voltage is
similar to the former equation:

Vbat = 2 × bbb × 0.004 =
bbb × 0.008

[8]

The frequency of the humidity sensor
circuit can be derived from:

[9]

Again, relative humidity is derived from
the circuit frequency via Equation 2.

CALIBRATION

The temperature sensor is typically

accurate to within 2°C before calibra-

42

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Photo 3—

Put together, this is how the complete remote system

appears. From left to right, you see the solar panel, remote station, and
part of the antenna ground plane.

Photo 4—

The base station is a simple assembly. The

receiver circuit is visible in the upper left corner.

background image

support multiple remotes. This
would allow monitoring the climate
inside, outside, in the attic, etc. The
second improvement would be the
addition of an anemometer. If time
had permitted, I would have
designed one based on ultrasonic
transducers. This would have allowed
measurements of wind speed, direc-
tion, and, when combined with tem-
perature, wind chill.

But, I’ll get to those projects later.

According to my data, it’s too nice of
a day to be inside.

I

tion. To improve accuracy, you need
an extension cable between the cir-
cuit board and sensor, as well as an
ice water slurry. Place the sensor in
the slurry and measure its output
voltage using a voltmeter. Use the
measured value in the following cor-
rection factor:

[10]

Then, multiply your raw A/D read-
ings by this correction factor to
improve the precision of your temper-
ature measurements.

Your pressure sensor will require

calibration, and there are two possible
methods to use. The first method
requires that you monitor your local
weather channel for a couple weeks
and the second method necessitates
specialized equipment.

If you choose the first method, cre-

ate a table and label the first column
“Pressure sensor,” and the second
column “Actual.” Next, for about
two weeks, monitor and record your
local weather channel for the actual
pressure. At the same time, measure
and record the voltage across the pres-
sure sensor. You’ll have to connect
the emitter and collector of Q1 so
that power is routed to the sensor.

After these steps, enter your data

into Excel and use a linear interpola-
tion function to derive the following
equation:

Actual = K × measured + offset

[11]

If you decide to use the second

method of calibration, use the next
series of steps. For step one, acquire
some flexible tubing, a vacuum pump
(available at places like Pep Boys), and

a manometer or vacuum gauge.
Again, short the emitter and collector
of Q1 to provide power to the pres-
sure sensor. After that, for step three,
record the initial voltage across the
sensor as V0.

Fourth, get the local barometric

pressure (in inches of mercury, typi-
cally around 30) and record it as P0.
For the next step in the process, con-
nect the vacuum gauge and vacuum
pump to the sensor, using Figure 7 as
a guide. Squeeze the pump until the
gauge indicates a vacuum of 1

of

mercury for the sixth step. And, sev-
enth, record the voltage across the
sensor as V1. After that, perform the
following calculations:

[12]

Using the terms in Equation 12,

barometric pressure can be calculated
from the sensor voltage as:

Pressure = m × voltage + b

[13]

I found the humidity sensor to be

pretty accurate and to not require cal-
ibration. However, be sure to follow
the construction tips I suggest to
ensure good performance.

MONITOR APPLICATION
PROGRAM

To take full advantage of the

remote weather monitor, I wrote a
simple program in Visual Basic to col-
lect data from the base station, per-
form calibration corrections and data
conversions, and display the informa-
tion on the screen (see Photo 1).
Buttons are provided to display the
basic data using a small window or to
plot the data for the last 24 h.

ROOM TO IMPROVE

An engineer’s work is never com-

plete; there’s always room for
improvement. There are a couple
things you could do to further
embellish this design. First and fore-
most, the protocol for the remote and
base stations could be modified to

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

43

Jerry Wasinger received his BSEE
from University of Oklahoma and
his MSEE from Colorado State
University. Currently, he is vice pres-
ident of research and development at
PRE Solutions. Jerry runs a web site
for electrical engineers called WebEE
(www.web-ee.com) and still enjoys
designing and assembling electronic
circuits. You may reach him at web-
master@web-ee.com.

SOURCES

PIC16F873 Microcontroller
Microchip Technology Inc.
(480) 786-7200
Fax: (480) 899-9210
www.microchip.com

HS1101 Humidity sensor
Humirel
+33 0 5 611 945 43
Fax: +33 0 5 611 945 53
www.humirel.com

MPX5100A Pressure sensor
Motorola, Inc.
(847) 576-5000
Fax: (847) 576-5372
www.motorola.com

TX5002/RX5002 RF design
RF Monolithics, Inc.
(800) 704-6079
(972) 233-2903
Fax: (972) 387-8148

980-1045 Solar panel
Radio Shack
www.radioshack.com

SOFTWARE

The code is available on Circuit
Cellar

’s web site.

Figure 7—

After the sensor is calibrated as shown it will

provide extremely accurate results.

Vacuum gauge

Vacuum pump

Tubing

Pressure sensor

background image

n embedded

products, RF tech-

niques are becoming

pervasive. Wireless tech-

nology manages to end up in every-
thing from LANs and PDAs to
telemetry systems. Sometimes
embedded developers need tools for
measuring RF. What if you wanted to
make relative field strength measure-
ments with ±3 dBm of accuracy?
What if you wanted a broadband RF
meter with a simple tuning arrange-
ment? What if you wanted a battery-
powered measurement tool that plugs
into your hand-held voltmeter?

Better yet, what if you could put

this handy gadget
together for less than
$100? Well, if that’s
something you could
really use on your
bench top, read on.

In this article, I’ll

describe a portable
inexpensive relative
field strength meter.
This gadget doesn’t
have the accuracy of
more expensive RF
tools on the market.
However, when tied
into a DVM or data

acquisition system, it can be a useful
and flexible front-end building block
to a more sophisticated instrument.

BACKGROUND

Recently, I’ve been working on

wireless projects. When I invest time
learning and building hardware for a
project, I intend to come away with
tools and techniques that can be
reused in future projects. The idea is
to accumulate building block tools.

One project that comes to mind

required the measurement of field
strength emitted from various small
transmitters. The frequencies to be
measured ranged from 300 to 450 MHz.

The application required the meas-

urement of relative field strength for
different transmitters distributed
throughout a household. My employ-
ers wanted to determine a suitable
transmitter for an indoor wireless
appliance. They also wanted to char-
acterize a living room environment as
it affects path loss from the transmit-
ter to a receiver.

By measuring signals at known

distances, path loss for a given envi-
ronment can be characterized. The
goal was to capture experimental
data. This new data then would be
used for the design of a portable
product that could determine the
proximity of a transmitter relative to
a base station receiver.

MEASUREMENT TOOL

RF field strength is measured in

decibels. If you have an idea of the
transmitter’s output power, you can
calculate path loss directly from the

44

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

FEATURE
ARTICLE

SE Nickols

Measuring RF
Field Strength

With RF techniques
being used in more
and more embedded
products, often devel-
opers need to be able
to measure RF field
strength. With less
than $100 in the budg-
et, building your own
direct decibel-reading
device just might be
the best way to moni-
tor the situation.

Antenna

1

AD8307

Battery

1

2

Voltmeter

*Bandpass filter

*Optional filter

i

Figure 1—

Here’s a block diagram of the RF meter.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

45

Analog Devices offers excellent

broadband log amps; the AD8307
looked ideal for my project. The com-
pany’s web site offers a useful
datasheet about the AD8307. [1] This
log amp has a dynamic range of 92 dB,
2.7- to 5-V at 7.5 mA operation, DC
operation to 500 MHz, SO 8, and
eight-pin DIP packages.

I credit Ian Hickman for giving me

the idea to use the AD8307 logarith-
mic amplifier for my RF meter
approach. [2] His article, “How Strong
is Your Field,” describes an RF meter
for measuring antenna radiation pat-
terns. He recommends the AD8307
with a dipole antenna arrangement for
more exacting measurements.

My approach is similar, however,

the circuitry is more simplistic.
Analog Devices can supply you with

RF field strength as measured at the
receiver. Path loss is the attenuation
(reduction) of field strength caused by
distance or interference.

With a direct decibel reading device

you can correlate path loss and esti-
mate proximity. RF field strength
from a source is reduced at a rate
based on the square of the distance
involved. This is true for free space
transmission loss with no reflections,
obstacles, nor interference.

I needed a simple, portable, decibel

meter to measure field strength with-
out a complex tuning arrangement. It
became obvious that this was the job
for a broadband logarithmic amplifier.
Log amplifiers convert a voltage sig-
nal input to a logarithmic equivalent
voltage output on a decibel scale.

There are logarithmic amplifiers

that offer a great range of sensitivity,
with flat response across a wide band
of frequencies. I knew a log amp
attached to an antenna was the tick-
et; change the antenna and you tune
the sensitivity to the wavelength/fre-
quency of interest (see Figure 1). By
adding a filter network following the
antenna, you can improve sensitivity
at a frequency of interest.

FINDING THE IDEAL LOG AMP

Simplicity, cost, and availability of

parts are always important considera-
tions when trying to build hardware.
For this project, the requirement was
a device with a flat response from
100 to 450 MHz. In addition, I wanted
80 dBm of dynamic range.

the hardware. Evaluation boards are
even better. Great datasheets help
development as well.

Figure 2 shows the internal work-

ings of the AD8307. [1] The AD8307
is composed of a cascade of six non-
linear amplifier elements. The nonlin-
ear amplifiers perform a logarithmic
conversion of wide dynamic range sig-
nals. Logarithmic amplifiers compress
signals ranging from microvolts to
volts into the decibel equivalent volt-
age. In radio work, log amps are well
suited for measurement applications.

RF signal strength tends to vary

widely from weak signals at a dis-
tance, to strong signals that are near-
by. As such, RF signal strengths have
wide dynamic range.

In the case of the AD8307, it meas-

ures signals as low as –75 dBm. That
means a sine wave voltage amplitude
of ±56 µV. The upper end of the
AD8307 is 17 dBm, which means it
converts a sine voltage of ±2.2 V.

Notably, the AD8307 has about 0-

to 500-MHz uniform bandwidth
response. The log conformance at dif-
ferent frequencies shows uniform
response. [1] Figure 3 displays the per-
formance of the AD8307 at 10, 100,
and 500 MHz. This device also can be
used at frequencies in the audio range
to 900 MHz with reduced performance.

BUILD A MEASUREMENT TOOL

Upon inspection of the AD8307

datasheet, you’ll find circuit examples
that can be tailored to this applica-

7

8

1

2

SUPPLY

+INPUT

–INPUT

COMMON

6

5

4

3

ENABLE

INT. ADJ

OUTPUT

OFS. ADJ.

Bandgap reference

and biasing

Mirror

1.15 k

INM

INP

VPS

7.5 mA

COM

Six 14.3 dB, 900 MHz

Amplifier stages

AD8307

Input-offset

compensation loop

3

2

OUT

COM

OFS

2µA/dB

12.5 k

ENB

INT

Nine detector cells

spaced 14.3 dB

Figure 2—

Check out the internal workings of the AD8307.

FC (MHz)

ZIN (W)

C1 (pF)

C2 (pF)

LM (nH)

Voltage gain (dB)

10

45

160.0

150.0

3300

13.3

20

44

82.0

75.0

1600

13.4

50

46

30.0

27.0

680

13.4

100

50

15.0

13.0

330

13.4

150

57

10.0

8.2

220

13.2

200

57

7.5

6.8

150

12.8

250

50

6.2

5.6

100

12.3

500

54

3.9

3.3

39

10.9

10

103

100.0

91.0

5600

10.4

20

102

51.0

43.0

2700

10.4

50

99

22.0

18.0

1000

10.6

100

98

11.0

9.1

430

10.5

150

101

7.5

6.2

260

10.3

200

95

5.6

4.7

180

10.3

250

92

4.3

3.9

130

9.9

500

114

2.2

2.0

47

6.8

Table 1—

Filter values for narrowband sensitivity.

background image

Figure 3 shows ideal readings versus
RF power at the RF meter antenna. I
could test to 0 dBm with my RF gen-
erator. My readings were linear and
in agreement with Figure 3. This setup
should output about 25 mV/dBm.

An alternative, more accurate cali-

bration technique is to attach the RF
meter to the RF generator through a
variable attenuation block. The meter
is very sensitive. After I came out of
the shielded room, the meter showed
levels of signal detection based on
location. For example, the testing
that was done at an apartment near a
cell site antenna indicated about 1 V
of signal. This was a –50-dBm signal
as measured as ambient signal
strength. Using a front-end tuning
arrangement will improve immunity
to stray signals and sensitivity to
desired signals.

DECIBEL SCALE EXPLAINED

Before going further, let’s first

review some basics. The decibel scale
is convenient for quantifying signal
strength. Table 2 states the common
decibel unit expressions. Decibels
are a logarithmic way of represent-
ing relative power levels. The basic
unit is the bel (10 decibels). Two
power levels, P

1

and P

2

, are said to

differ by bels (B):

[1]

For example, consider two power

levels, P

1

= 6 W, and P

2

= 3 W. Using

this equation, you can say that:

[2]

where P

1

is 3 dB greater than P

2

.

to-banana plugs.) I used
a collapsible antenna
mounted on a BNC
connector for the input
to the circuit in Figure 4.

You can modify the

circuit illustrated in
Figure 4 by removing
R1 and adding an
inductor, LM, across
pins 1 and 8 of the
AD8307. Table 1 shows
filter values for narrow-
band filtering. Modify
components C1, C2,
and LM in Figure 4 to
filter values in Table 1
when you need peak

response to a given frequency.

CALIBRATING THE RF METER

Adjustment was simple with a sig-

nal generator calibrated
in decibels greater than
1 mW (dBm). It is best to
calibrate in an environ-
ment that has a low RF
ambient background. I
had access to a shielded
room for initial testing.

For reference signal

input, I used a 300-MHz
sine wave that isn’t
modulated as a starting
point (see Figure 5). I soldered a 9.8

piece of 16-gauge wire to a BNC con-
nector, and then attached it to the out-
put of the RF generator. Using an RF
signal generator calibrated in decibels

greater than 1 mW, I set
the initial output to
10 dBm, or 10 mW of RF
output power. This
method is similar to the
calibration technique
used by Hickman.

On the RF meter, I

adjusted the whip anten-
na’s length to 9.8

, which

is the quarter wavelength
for 300 MHz. Next, I
removed jumper LK2 in
Figure 4. Jumper LK1
should be to position A.
LK1 connects pin 6 to +V

S

.

At close range, with

antennas nearly touch-

ing, I read about 2.52 V.

46

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

tion. Figure 4 is a good place to start
when it comes to taking a closer look
at the AD8307. [1] Analog Devices
makes working with the AD8307
easy. And, note that you can buy an
AD8307 evaluation board for $50
(excluding shipping).

I went ahead and purchased the

AD8307 evaluation board, and later
put it in a box. Metal boxes improve
immunity to stray signals, however,
plastic boxes are easier to work with.
I used BNC connectors for the anten-
na connection and log voltage output.
The evaluation board has SMA con-
nectors at the input and output. I used
an SMA-to-BNC converter to make
things easy. Three 1.5-V AA batteries
in series provide 4.5 V for +VS.

It is prudent to use a coaxial cable

for the connection to the VOM. (coax-

3

2.6

2

1.5

1

0.5

0
–80

–70

–60

–50

–40

–30

–20

–10

0

10

20

Input level (dBm)

Output v

oltage (V)

10 MHz

100 MHz

500 MHz

Figure 3—

Compare the log voltage output versus power input of the AD8307.

Figure 4—

The schematic of RF meter shows all the details.

Table 2—

Log terms and notations are displayed here.

Unit

Definition

dBV

dB change relative to a volt

dBW

dB change relative to a watt

dBmv

dB change relative to a millivolt—common in CATV

dBm

dB change relative to a millwatt— common in RF

dBK

dB change relative to a kilowatt—common in broadcast

dBu

dB change relative to a microvolt—common in broadcast

dBc

dB change relative to carrier (voltage or power)

background image

INTERPRET VOLTAGE READINGS

Using a test setup, you can move

away from the RF source and measure
power at a distance. Let’s say you get
a 1-V reading from the RF meter. The
frequency setting of the RF source is
300 MHz. And the power setting is
adjusted to 10 dBm (10 mW).

Referring to Table 3, 1 V represents

–50 dBm, or 10 nW. Now, you can
conclude that the path loss, or attenu-
ation, from the transmitter to the
receiver is –60 dBm.

The current circuit configuration

gives about 25 mV/dB. Perhaps I’ll
design a microcontroller to convert
the AD8307 voltage output to direct
decibels greater than 1-mW readings.

The hand-held RF meter gives you

the ability to measure RF power at
distance. Now that you have an
understanding of the decibel scale,
converting decibels back to watts can
be useful when you want to know
how much power you are receiving at
what distance.

Figure 7 shows a model for a RF

power source attached to an antenna.
The antenna has a gain (G) based on

length. This source, separated
by distance r from the receiver,
will emit an electromagnetic
field. The receiver will convert
the field to power.

For the RF meter, the anten-

na length is selected to be a
quarter of the wavelength of
the RF signal to be measured.
Portable antennas are most
efficient when they are at quar-
ter, half, or at full length of the
wavelength involved.

Wavelength (in air) in cen-

timeters can be calculated as
30,000/frequency in megahertz.
For example, with 300 MHz,
you get 30,000/300 = 100 cm.

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

47

For measuring power in communi-

cations systems, a reference level is
established and all measurements are
compared to that reference level.
One milliwatt is a convenient num-
ber to use. Now, you may use the
dBm scale. If you used 1 W as a refer-
ence, it would be dBw. For any value
you want to compare to this refer-
ence, divide the value to be com-
pared by 1 mW. [3]

For example, let’s suppose the

transmitter emits about 1 mW of RF
power. Dividing 1 mW by 1 mW
equals 1.This is called a log ratio of
one. Using the next formula, you
may convert 1 mW to its equivalent
on the decibel scale:

dBm =10 (log10 × 1) = 0 dBm

Going back to Figure 3, you now

have a means to compare the voltage
output of the RF meter to the decibel
scale. You can relate this to received
power at the antenna on the decibel
meter. Figure 6 is a simple look-up
table for comparing relative values on
the decibel scale.

RF signal
generator

Distance

1

Antenna

1

Antenna

Volt meter

RF meter

Coax

F

F

Figure 5—

To set up your test, follow this example diagram.

V(p-p)

10

V (rms)

dBV

dBm

mW

+10

+1

0.1

0.01

0.001

0.01

0.1

1

+20

+10

0

–10

–20

–30

–40

–50

–60

+20

+10

0

–10

–20

–30

–40

–50

+30

1000

100

10

1

0.1

0.01

0.001

0.0001

0.00001

Figure 6—

You can get the necessary information from the log

scale look-up table.

background image

FINAL NOTES

I recommend you read more infor-

mation to get the full picture. Antenna
theory is not a trivial subject. I’ll
keep the topic open and perhaps write
another article in the future.

A possible follow-up article would

include more details about antenna
design and system modeling. Mathcad
or Matlab would be ideal for such a
model. An important question to
answer is how modulation affects the
reading from the RF meter.

Until then, have fun with the

AD8307!

I

AD8307) diminishes as
a square root of the
distance from the
transmitter.

Because you can

actually measure
power at the RF meter,
you can rearrange the
Friis formula as fol-
lows to solve for r:

[4]

Suppose the transmit power is 1 mW

and the RF meter reads 1 V. According
to Figure 6, –50 dBm is 0.00001 mW
at the RF meter. Calculating for r
tells you that the RF source is approx-
imately 6.25 meters from the RF
meter (line of site). Of course, this is
an example; results may change given
the broad band sensitivity of the RF
meter results may change.

To achieve this reading in free

space, you would need prefect condi-
tions. Any extra RF source would
have to be less than –50 dBm. Also,
you would assume you have no
multi-path (reflections of the original
source) signals to interfere with the
reading.

I found that measuring decent prox-

imity is achievable if a 1-mW trans-
mitter is no more than 30

away and

there are no metals objects at quarter
wavelengths or longer than the wave-
length of transmission frequency. For
short-range applications such as RF
tags, garage door openers, and wire-
less networks, the RF meter can
determine path loss from the source.

Note that the

meter performs
to theory when
the source is
constant and
not modulated.
And, decibel
readings appear
to go down
when the RF
source signal is
modulated
instead of being
on constantly.

r = Gain

×

wavelength

4

π ×

Ptransmit

Preceiver

48

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

REFERENCES

[1] Analog Devices, “Low Cost DC—

500 MHz, 92 dB Logarithmic
Amplifier, rev. A.3, 1999.

[2] I. Hickman, “How strong is

your field?” Electronics World,
November 1998.

[3] R. Boylestad, “Introductory

Circuit Analysis.” Prentice
Hall, Saddle River, New Jersey,
August 1999.

[4] D. Rutledge, “The Electronics of

Radio,” Cambridge University
Press, Cambridge, England,
August 1999.

Author’s Note: I would like to thank
Analog Devices for the use of the
graphics from its datasheets.

SE Nickols earned a BS in Applied
Science from Thomas Edison State
College. He is an independent engi-
neer/researcher who helps inventors
bring IP to market. He has 20 years of
experience in electronics design, DSP,
precision motion, optics, patenting,
and business start-up.

SOURCE

AD8307 Evaluation board
Analog Devices, Inc.
(800) 262-5643
(781) 329-4700
www.analog.com

RESOURCE

C. Scott, “How to cheat with dBs...
an intuitive approach,”
www.scott-inc.com/html/dbtalk.
htm, 1999.

1

Antenna

1

Antenna

1

Antenna

1

Antenna

r

Ptransmit

Preceiver

Area

Gain

Figure 7—

This model demonstrates the transmitter and receiver system.

The quarter wavelength is 25 cm. A
simple formula quarter wavelength in
centimeters is 7500/frequency, and of
course, in megahertz.

The receiver has an antenna area. It

is conceptually easier to consider this
as the length of antenna and area of
the ground plain under the antenna.
In this case, I used an antenna length
of 9.8

= 25 cm. For simplicity I

ignored the ground plane. I used the
antenna area as its width multiplied
by its length. And, 1 cm × 25 cm
determines the antenna area value. In
this case, you get 25 cm

2

(0.25 meters

2

).

Because I used a quarter wavelength

of the RF generator used in calibra-
tion, the transmit antenna gain is
estimated at 0.25.

The Friis formula is useful for mod-

eling antenna gain, area, path length
(r), and power levels. [4] This formula
calculates probable proximity from
the transmitter to receiver. If you
know the transmitted power and
receiver gain, you can estimate the
approximate distance in meters.

[3]

Received power (in decibels with the

Voltage from RF meter

Log ratio

Wattage

dBm

(–60 dBm pathloss)

0.00001

0.00000001

–50

1

0.0001

0.0000001

–40 1.25

0.001

0.000001

–30

1.5

0.01

0.00001

–20 1.75

0.1

0.0001

–10 2

1

0.001 0 2.25

10

0.01 10 2.5

Table 3—

Values for path loss/attenuation can be tabulated as shown.

background image
background image

50

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

n embedded

Ethernet tidal

wave has been sighted

from shore. Reports of

Ethernet-enabled power strips, facto-
ry-floor process controllers, and KVMs
(keyboard, video, and mouse switches)
are rolling in daily. The nerve of these
guys, using Ethernet like you would
use serial and parallel I/O ports.
Could it be that these renegade engi-
neers have happened on the advan-
tages of using Ethernet instead of tra-
ditional serial/parallel techniques?

Implementing Ethernet in an

embedded design used to be difficult
for the small-time engineer
who didn’t have access to
the ears of an Ethernet IC
factory rep. Adding insult to
injury, that same small-
time, small-shop embedded
engineer had to write the
code as well as design the
hardware. If that’s not
enough to turn an embed-
ded designer back toward
serial interface land, throw
in a requirement for TCP/IP.

To combat this type of

embedded engineering frus-
tration, companies like
National Semiconductor,

APPLIED
PCs

Cirrus Logic, Realtek, SMC, and Intel
have done for Ethernet what they did
for serial and parallel: put the com-
plexity inside an IC. The problem is
that the hardware is relatively easy to
obtain but the documentation needed
to apply some of these parts is not as
easily collected and assembled.

For instance, have you tried to put

together the documentation to apply
the Realtek RTL8019AS lately? If
you’re a regular reader of my columns,
you know my affinity for Ethernet.
Also, if you’ve read my Circuit Cellar
Online

ramblings, you know I’ve gone

on walkabout with the Cirrus CS8900
Ethernet IC. Well, this time around I
intend to find the elusive RTL8019AS
documentation and show you how to
easily apply it the embedded way.

Think of this article as an archaeo-

logical dig and I’m the mad archaeolo-
gist in search of Noah’s ark. We know
the ark was enormous, and if it really
existed, it’s still out there buried in the
mud somewhere. The same goes for
knowledge concerning the RTL8019AS.
It’s enormous, you know it exists, and
all of the data needed to implement it
is buried in Internet mud.

Honestly, I got tired of begging my

engineering colleagues for information
on the RTL8019AS. So, I decided to
write this article to spare you the same
kind of work. My idea was to acquire
the RTL8019AS data and give you what
you need to make your own working
RTL8019AS gadget. In addition, I’ll
provide all of my finds via a set of
files you can download conveniently
from the Circuit Cellar web site.

Fred Eady

PICing a Place
on the LAN

a

The buzz is that
Ethernet capability is
creeping into every-
thing. If you’ve tried to
join the trend but hit a
wall when trying to col-
lect the necessary
documentation, you’re
not alone. Equally frus-
trated, Fred trekked
across the ’Net to dig
up what you need, and
compiled a guide book.

Photo 1—

This is just what you would expect from a PIC-based

embedded computer, no frills, just clean, logical circuitry that is easily
manipulated by firmware.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

51

TOOLS FOR THE DIG

So far as archaeologists, you’re bat-

ting a thousand. Your dig has a rea-
sonable purpose and according to the
first page in your notebook, you’ve
chosen ground that will certainly
yield some finds. On this expedition,
there will be no picks, shovels, bull-

Unlike my supposed link to Mozart,

the need for historical closure is espe-
cially true for the RTL8019AS because
it evolved from National’s DP8390.
Fortunately, the first page of our Indy-
style notebook is the beginning page
of “DP8390 Network Interface
Controller: An Introductory Guide.” [1]

ARCHAEOLOGY 101

You can take a lesson from Indiana

Jones

. Both the younger and elder Jones

have little books of knowledge that
you see them pull out and use when
they find something. The ragged
books help them find the object or
place and then decipher what’s found.
The notebooks are important and, of
course, desired by everyone involved
with the Joneses, including the bad
guys and some leading ladies.

Our little notebook is crucial to our

adventures, as well. It’s a collection of
datasheets and professional observa-
tions. Like the fictional notebook, the
datasheets will point you to knowl-
edge-based finds, which will lead you
to the ultimate find: success. Success
means using an RTL8019AS in a real,
useful embedded control application.

We believe that knowledge of man’s

history will help us understand what
we are and where we came from. I
already know where I came from. In
my former life, I’m convinced I
played with Mozart. My love for good
music and partying with the musi-
cians who produce it puts me right in
there with Wolfgang Amadeus.

Figure 1—

Compared to the CS8900, the Realtek RTL8019AS is much simpler to put on a PC board. The CS8900 requires four additional resistors, a capacitor on the IC side

of the isolation magnetics, and three more bypass caps on the IC power rails. As for LED placement and function, my PICDEM.net is the fourth version.

No (hex)

Page 0

Page 1

Page 2

Page 3

R

W

R/W

R

R

W

00

CR

CR

CR

CR

CR

CR

01

CLDA0

PSTART

PAR0

PSTART

9346CR

9346CR

02

CLDA1

PSTOP

PAR1

PSTOP

BPAGE

BPAGE

03

BNRY

BNRY

PAR2

CONFIG0

04

TSR

TPSR

PAR3

TPSR

CONFIG1

CONFIG1

05

NCR

TBCR0

PAR4

CONFIG2

CONFIG2

06

FIFO

TBCR1

PAR5

CONFIG3

CONFIG3

07

ISR

ISR

CURR

TEST

08

CRDA0

RSAR0

MAR0

CSNSAV

09

CRDA1

RSAR1

MAR1

HLTCLK

0A

8019ID0

RBCR0

MAR2

0B

8019ID1

RBCR1

MAR3

INTR

0C

RSR

RCR

MAR4

RCR

FMWP

0D

CNTR0

TCR

MAR5

TCR

CONFIG4

0E

CNTR1

DCR

MAR6

DCR

0F

CNTR2

IMR

MAR7

IMR

10–17

Remote DMA port

18–1F

Reset port

Table 1—

Although most of this looks important, the majority of it is set at initialization and then forgotten. The

registers responsible for counts, error checking, and data moving will generate most of the action. Note that
CURR is in page 1 of the control register.

background image

didn’t want to pull the PIC out for
every spin of code I want to test, so
my first thoughts were to modify the
board to allow either LVP (low-volt-
age programming) or standard HV
(high voltage) program modes.

LVP mode requires that RB3 be

dedicated to the process. Looking at
Figures 1 and 2, moving the line that
occupies RB3 would break up the
continuity of the address lines. I
could code around it, but I thought it
would not translate well to you in
print. We’re here to decode hiero-
glyphics, not create them. I wrote off
HV programming as well, because it
would require too many modifications.

The Microchip ICD module is sup-

ported by PICDEM.net and would be
perfect if I was working with PIC reg-
isters, but RTL8019AS registers are
the focus. Although the ICD is a good
way to go, I prefer using a bootloader
resident in the PICDEM.net’s
PIC16F877. Using a bootloader allows
me to show you the play-by-play
using screen shots from a standard
terminal emulator. Also, with a resi-

than sift through the rubbish to get to
the point, I’ll use a much simpler car-
rier for the RTL8019AS, Microchip’s
PICDEM.net demo board.

The PICDEM.net comes loaded

with an Iosoft TCP/IP stack and a pre-
programmed PIC16F877 ready to serve
web pages. A Microchip 24LC256
stores the web pages and there’s a
MAX232 RS-232 IC ready to support
any serial activity I may wish to initi-
ate. A six-pin RJ-11 jack provides a
portal for the MPLAB ICD (in-circuit
debugger), and a familiar eight-pin
RJ-45 is the door to the RTL8019AS
and Ethernet connectivity.

An assortment of pots, switches,

LEDs, and an LCD are included on
the board. As you can see in Figures 1
and 2, the PICDEM.net is a classic
implementation of the PIC16F877 and
RTL8019AS. The clean layout of the
PICDEM.net (see Photo 1) provides a
potentially uncluttered view into the
operation of the RTL8019AS.

The PICDEM.net with all of its

accessories doesn’t provide a means to
program the PIC16F877 onboard. I

52

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

dozers, or dedicated pupils dusting
bones for days with fine brushes.
Instead, your tools will consist of
compilers, Ethernet Sniffers, an IDSL
dedicated Internet connection, and a
couple embedded computing platforms.

Did I see your eyebrows rise? You’re

curious about why I said a couple
embedded devices, aren’t you? Well,
that’s simple. If things go as planned,
eventually they’re going to talk to
each other and use Ethernet and
maybe an Internet protocol or two to
control external devices. At that
moment, you will have successfully
completed your archaeological dig.

My local cable company is now dis-

tributing Ethernet cards loaded with
the RTL8019AS for use in home PCs
tied to its high-speed Internet connec-
tion. With a passive back plane and a
matching embedded SBC, I could use
the RTL8019AS-based Ethernet card
approach to explore the inner work-
ings of the RTL8019AS. That’s just
not close enough to the ground level;
the Ethernet card is most likely con-
figured for Bill’s plug-and-play. Rather

Figure 2—

No real surprises here. Microchip forewent any connections between the NIC and CPU that would simulate having an external serial EEPROM attached to the NIC.

Instead, the extra pins are used to allow experimentation with the ADC features of the PIC16F877.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

53

******************************************************************

DriverInitialize Initializes the NIC for a typical network system.

Receive Buffer Ring = 2600h to 4000h, PICDEM 4600 TO 6000

Transmit Buffer = 2000h to 2600h, PICDEM 4000 to 4600

Entry: none

Equates for NIC Registers

******************************************************************

COMMAND

equ 300h

#define CMD

0x00

PAGESTART

equ COMMAND+1

#define PSTART 0x01

PAGESTOP

equ COMMAND+2

#define PSTOP

0x02

BOUNDARY

equ COMMAND+3

#define BNRY

0x03

TRANSMITSTATUS

equ COMMAND+4

#define TSR

0x04

TRANSMITPAGE

equ COMMAND+4

#define TPSR

0x04

TRANSMITBYTECOUNT0

equ COMMAND+5

#define TBCR0

0x05

NCR

equ COMMAND+5

#define NCR

0x05

TRANSMITBYTECOUNT1

equ COMMAND+6

#define TBCR1

0x06

INTERRUPTSTATUS

equ COMMAND+7

#define ISR

0x07

CURRENT

equ COMMAND+7

#define CURR

0x07

REMOTESTARTADDRESS0

equ COMMAND+8

#define RSAR0

0x08

CRDMA0

equ COMMAND+8

#define CRDA0

0x08

REMOTESTARTADDRESS1

equ COMMAND+9

#define RSAR1

0x09

CRDMAL

equ COMMAND+9

#define CRDAL

0x09

REMOTEBYTECOUNT0

equ COMMAND+0ah

#define RBCR0

0x0A

REMOTEBYTECOUNT1

equ COMMAND+0bh

#define RBCR1

0x0B

RECEIVESTATUS

equ COMMAND+0ch

#define RSR

0x0C

RECEIVECONFIGURATION

equ COMMAND+0ch

#define RCR

0x0C

TRANSMITCONFIGURATION equ COMMAND+0dh

#define TCR

0x0D

FAE_TALLY

equ COMMAND+0dh

#define CNTR0

0x0D

DATACONFIGURATION

equ COMMAND+0eh

#define DCR

0x0E

CRC_TALLY

equ COMMAND+0eh

#define CNTR1

0x0E

INTERRUPTMASK

equ COMMAND+0fh

#define IMR

0x0F

MISS_PKT_TALLY

equ COMMAND+0fh

#define CNTR2

0x0F

PSTART

equ 46h

not used

PSTOP

equ 80h

not used

CGroup group Code

Code segment para public 'Code'

assume cs:CGroup, ds:CGroup, es:nothing, ss:nothing

rcr db 0 ;value for Recv config. reg

#define rcrval 0x00

tcr db 0 ;value for trans. config. reg

#define tcrval 0x00

dcr db 58h ;value for data config. reg

#define dcrval 0x48

imr db Obh ;value for intr. mask reg

#define imrval 0x00

******************************************************************

DriverInitialize proc near

public DriverInitialize

mov al,21h

;stop mode

mov dx,COMMAND

out dx,al

mov al,dcr

mov dx,DATACONFIGURATION

;data configuration register

out dx,al

mov dx,REMOTEBYTECOUNT0

xor al,al

out dx,al

;low remote byte count

mov dx,REMOTEBYTECOUNT1

out dx,al

;high remote byte count

mov al,rcr

mov dx,RECEIVECONFIGURATION ;receive configuration register

out dx,al

mov al,20h

mov dx,TRANSMITPAGE

;transmit page start

out dx,al

mov al,02

mov dx,TRANSMITCONFIGURATION

Listing 1—

This is the real McCoy, pulled right out of the National DP8390 datasheet. [4] Everything following

the #defines is the PIC C code equivalent. [3]

(

continued)

background image

all you have to do is twiddle some bits
into an

.exe file and send the exe-

cutable code to the Netsock/100 via
HyperTerminal and a serial port.

The software tools consist of NAI’s

Sniffer 4.5 Basic for tracing the Ethernet
packets and a PCW C compiler from
Custom Computer Services to drive
code development for the RTL8019AS.
Either Borland C or Visual Basic 6.0
will be used to put the Netsock/100
TCP/IP stack to work.

BREAKING GROUND

Rather than describe the DP8390 in

detail and then do the same for
the RTL8019AS, it would be
easier to use the DP8390 to
describe the internals of the
RTL8019AS. Both parts were
designed to be a self-standing
go-between for a CPU and
IEEE 802.3 CSMA/CD net-
work. The basic difference

between the original DP8390,
original 8019, and the newer
RTL8019AS is that the AS ver-

sion has 16 KB of on-chip RAM. Other
than that, a 16-byte FIFO sits between
the transmit serializer, receive deseri-
alizer, and RTL8019AS local DMA
channel. The other side of the FIFO
feeds the 16 KB of on-chip NIC RAM.

This arrangement implies that the

NIC RAM holds incoming and outgo-
ing packets. As for the RTL8019AS
remote DMA channel, it too directly
interfaces to the NIC RAM. The CPU
cannot directly address the NIC RAM
area and uses the services of the NIC
remote DMA to move data between
the NIC RAM and CPU registers.

If the CPU is isolated from the

RTL8019AS internal functional
blocks, you’re probably wondering
how data flows through the
RTL8019AS NIC. Figure 3 shows the
details except the control registers.
Consider this your first find. A good
understanding of the control registers
is essential; you’ll use this knowledge
to write the NIC driver code.

I should let you know that there is

a lot of boilerplate code for the
RTL8019AS under the guise of
“NE2000 drivers.” One reason is that
the original Novell NE2000 NIC used
the DP8390 chip set. The NE2000-
compatible moniker remained as the
DP8390 register set became the stan-
dard to which NE2000 drivers were
written. The RTL8019AS datasheet
states that the NIC is compatible
with NE2000 software. [2] AN-874 (in
the notebook) contains example
DP8390 code that will guide you
when assembling your NE2000-com-
patible RTL8019AS driver. [3]

Table 1 is an overall view of the

control register set. The plug-and-play
aspects aren’t important here, so I’ll
concentrate on the NE2000 registers
as a means of initializing the NIC and
passing data between the Ethernet
interface and the CPU data bus.

Note that the control registers are

broken down into four pages each
containing 16 registers. Some of the
registers are not original NE2000 reg-
isters, rather they are enhancements
offered by the RTL8019AS. Figure 1
shows the RTL8019AS external
address lines are setup at the NE2000
standard base address of 0x300. Each
control register is accessed according

54

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

dent bootloader, I can easily load the
new spins via the serial interface of
the PICDEM.net.

Ethernet packets to and from the

PICDEM.net’s RTL8019AS will bounce
off a Micro Systems SBC1190 equipped
with an Embedded NetSock TCP/IP
stack (see Photo 2). The modified
SBC1190 is aptly named Netsock/100.
It is an 80C188 SBC with ample RAM
and flash memory (512 KB of each) to
run TCP/IP and UDP applications
written in C or Visual Basic. The
TCP/IP stack and OS are loaded and
ready to go on the Netsock/100. So,

out dx,al

;temporarily go into Loopback mode

mov al,26h

mov dx,PAGESTART

;page start

out dx,al

mov dx,BOUNDARY

;boundary register

out dx,al

mov al,40h

mov dx,PAGESTOP

;page stop

out dx,al

mov al,61h

;go to page 1 registers

mov dx,COMMAND

out dx,al

mov al,26h

mov dx,CURRENT

;current page register

out dx,al

mov al,22h

;back to page 0, start mode

mov dx,COMMAND

out dx,al

mov al,0ffh

mov dx,INTERRUPTSTATUS

;interrupt status register

out dx,al

mov al,imr

mov dx,INTERRUPTMASK

;interrupt mask register

out dx,al

mov dx,TRANSMITCONFIGURATION

mov al,tcr

out dx,al

;TCR in normal mode, NIC is now

ready for reception

ret

DriverInitialize endp

Code ends

end

Listing 1—

continued.

Packet

buffer

RAM

Remote

DMA

Local

DMA

Control

registers

16-byte

FIFO

Receive

de-serializer

Transmit

serializer

Figure 3—

Everything you see here is contained within the

RTL8019AS. The CPU uses the control registers to push and
pull data through this layout.

background image

addition, You would have to manually
take care of the RTL8019AS reset and
writing to the respective I/O control
pins IOW and IOR.

The best way to implement this is

by using input and output functions
to emulate the original in, mov, and
out instructions. With that, head over
to Circuit Cellar’s web site and check
out my additional code listing (noted
throughout this article as Listing 2).

The beginning of Listing 2
looks a lot like the top
code area of Listing 1 with
the exception of the CCS C
stuff. As with any embed-
ded program, the first thing
to do is set up the physical
interfaces and pins.

In the process, I kicked

off a hard reset using the
RTL8019AS reset pin, as
well. The 2-ms delay is
long enough to allow any
normal frame operation to
complete. This delay is
there in case the NIC is
reset while attached to a
live network. In addition,
it ensures that the length
of the reset pulse is greater
than 800 ns (any reset
pulses shorter than 800 ns
are ignored).

A soft reset is then initi-

ated by simply reading the
reset port’s contents and
writing them back to the
reset port. I gave the soft
reset plenty of time to

Here’s the difference, packets are
removed from the buffer ring under
program control.

Basically, the

rcrval, tcrval, and

dcrval definitions tell the
RTL8019AS NIC how to format, send,
and receive data. The

imrval defini-

tion disables the following interrupts:

• Receive error
• Overwrite warning
• Counter overflow
• DMA complete

And enables the following interrupts:

• Packet received
• Packet transmitted
• Transmit error

After the configuration register vari-

ables are loaded with the desired val-
ues, the next step is to push that
information into the control register
stack. You may still follow the logic
and flow of Listing 1, but the C
implementation of the original source
at this point in the process will differ
in variable content and syntax. In

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

55

to the states of address lines A0
through A3, which puts the control
register set in the 0x300 to 0x30F
range. Address line A4 allows access
to the NIC remote DMA port (0x310
to 0x317) and the NIC Reset port
(0x318 to 0x31F).

READING HIEROGLYPHS

If you do traffic analysis on the

control register pages, page 0 looks to
be the busiest. Listing 1 is the off-the-
shelf listing from AN-874, “Writing
Drivers for the DP8390 NIC Family
of Ethernet Controllers.” [3] Let’s
move through Listing 1 and find out
if my assumption about page 0 is true.

The driver code begins with defini-

tions of the page 0 register set. Offset
0x00 in all pages of the control regis-
ter stack always hosts the command
register (CR). Control register pages
are accessed using bits 6 and 7 of the
CR. In addition to selecting register
pages, the CR enables/disables the
remote DMA operation and issues
commands. The rest of the page 0 CR
definitions follow their Table 1 coun-
terparts. Instead of calling the play-
by-play for the four config-
uration register values in
Listing 1, the meaning of
their bit patterns is
described in Table 2.

Using the

rcrval break-

down as a guide, you can
then say that the

tcrval

definition appends a CRC
to the outgoing transmis-
sion (see Table 3). The
loopback and auto trans-
mit disable are disabled.
And, the back-off algo-
rithm is normal.

The

dcrval definition

for PICDEM.net is slightly
different from the original
as 0x58 configures the
remote DMA to automati-
cally remove packets from
the buffer ring. There are
byte-wide DMA transfers,
a dual 16-bit DMA mode,
and a 4-byte FIFO thresh-
old. The byte order on the
address lines is 80x86
(LSB first, A7 to A0). And,
loopback is disabled.

Photo 2—

This SBC is busier than PICDEM.net but the

Netsock/100’s ease of use and high degree of network-
ing functionality it provides will be tremendously helpful
on your engineering dig. A SMSC LAN91C94 supports
the Ethernet interface of Netsock/100.

4

3

2

1

n

n – 1

n – 2

256 Bytes

4

3

2

1

n

n – 1

n – 2

256 Bytes

Buffer 1
Buffer 2
Buffer 3

Buffer n

Page stop

address

Page start

address

Buffer RAM

(Up to 64 KB)

Page stop

register

Page start

register

Current page

register

Boundary

pointer

Figures 4a—

In a logical ring, this is how the receive buffer contiguous memory area is

defined. In (

b

)

, you see a register-based view of how it all begins. The boundary pointer

follows the current page pointer around the ring.

a)

b)

background image

56

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

complete and then checked the reset
status by reading and testing the RST
bit in the ISR register.

Now that the RTL8019AS has suc-

cessfully reset, I can step back into the
logical flow of Listing 1 and load the
control registers with the proper values.
As I was researching this process, I
found a blurb with the same logic flow
describing how to initialize the NIC in
section 11 of the datasheet, “DP83902A
ST-NIC Serial Network Interface
Controller for Twisted Pair.” [4] I also

found the control register descriptions
given in the DP83902A datasheet to
be more detailed than the references
in the RTL8019AS datasheet.

If you guessed that the DP83902A

datasheet initialization blurb began by
stopping the NIC, aborting any DMA
operation, and setting the CR page bits
to point at page 0 of the control regis-
ters, you’re right. Following suit, the
mov and out for Stop mode instruc-
tions in Listing 1 are replaced by the
write_creg function in Listing 2.

There’s nothing fancy here. A quick
look at Table 2 shows the stop bit
and abort DMA bits (bit 0 and bit 5
respectively) are set with the page
select bits configured for page 0.

You already know what’s happen-

ing behind the loading of the data,
receive, and transmit configurations,
interrupt mask control registers. Also,
you know that the physical load
process for each register is logically
identical. There was no on-chip buffer
memory on the original DP8390 IC.

Number

Name

Type

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

00H CR

R/W

PS1

PS0

RD2

RD1

RD0

TXP

STA

STP

01H

CLDA0

R

A7

A6

A5

A4

A3

A2

A1

A0

PSTART

W

A15

A14

A13

A12

A11

A10

A9

A8

02H

CLDA1

R

A15

A14

A13

A12

A11

A10

A9

A8

PSTOP

W

A15

A14

A13

A12

A11

A10

A9

A8

03H

BNRY

R/W

A15

A14

A13

A12

A11

A10

A9

A8

04H

TSR

R

OWC

CDH

0

CRS

ABT

COL

PTX

TPSR

W

A15

A14

A13

A12

A11

A10

A9

A8

05H

NCR

R

0

0

0

0

NC3

NC2

NC1

NC0

TBCR0

W

TBC7

TBC6

TBC5

TBC4

TBC3

TBC2

TBC1

TBC0

06H

FIFO

R

D7

D6

D5

D4

D3

D2

D1

D0

TBCR1

W

TBC15

TBC14

TBC13

TBC12

TBC11

TBC10

TBC9

TBC8

07H

ISR

R/W

RST

RDC

CNT

OVW

TXE

RXE

PTX

PRX

08H

CRDA0

R

A7

A6

A5

A4

A3

A2

A1

A0

RSAR0

W

A7

A6

A5

A4

A3

A2

A1

A0

09H

CRDA1

R

A15

A14

A13

A12

A11

A10

A9

A8

RSAR1

W

A15

A14

A13

A12

A11

A10

A9

A8

0AH

8019ID0

R

0

1

0

1

0

0

0

0

RBCR0

W

RBC7

RBC6

RBC5

RBC4

RBC3

RBC2

RBC1

RBC0

0BH

8019ID1

R

0

1

1

1

0

0

0

0

RBCR1

W

RBC15

RBC14

RBC13

RBC12

RBC11

RBC10

RBC9

RBC8

0CH

RSR

R

DFR

DIS

PHY

MPA

0

FAE

CRC

PRX

RCR

W

MON

PRO

AM

AB

AR

SEP

0DH

CNTR0

R

CNT7

CNT6

CNT5

CNT4

CNT3

CNT2

CNT1

CNT0

TCR

W

OFST

ATD

LB1

LB0

CRC

0EH

CNTR1

R

CNT7

CNT6

CNT5

CNT4

CNT3

CNT2

CNT1

CNT0

DCR

W

FT1

FT0

ARM

LS

LAS

BOS

WTS

0FH

CNTR2

R

CNT7

CNT6

CNT5

CNT4

CNT3

CNT2

CNT1

CNT0

IMR

W

RDCE

CNTE

OVWE

TXEE

RXEE

PTXE

PRXE

00H

CR

R/W

PS1

PS0

RD2

RD1

RD0

TXP

STA

STP

01H

PAR0

R/W

DA7

DA6

DA5

DA4

DA3

DA2

DA1

DA0

02H

PAR1

R/W

DA15

DA14

DA13

DA12

DA11

DA10

DA9

DA8

03H

PAR2

R/W

DA23

DA22

DA21

DA20

DA19

DA18

DA17

DA16

04H

PAR3

R/W

DA31

DA30

DA29

DA28

DA27

DA26

DA25

DA24

05H

PAR4

R/W

DA39

DA38

DA37

DA36

DA35

DA34

DA33

DA32

06H

PAR5

R/W

DA47

DA46

DA45

DA44

DA43

DA42

DA41

DA40

07H

CURR

R/W

A15

A14

A13

A12

A11

A10

A9

A8

08H

MAR0

R/W

FB7

FB6

FB5

FB4

FB3

FB2

FB1

FB0

09H

MAR1

R/W

FB15

FB14

FB13

FB12

FB11

FB10

FB9

FB8

0AH

MAR2

R/W

FB23

FB22

FB21

FB20

FB19

FB18

FB17

FB16

0BH

MAR3

R/W

FB31

FB30

FB29

FB28

FB27

FB26

FB25

FB24

0CH

MAR4

R/W

FB39

FB38

FB37

FB36

FB35

FB34

FB33

FB32

0DH

MAR5

R/W

FB47

FB46

FB45

FB44

FB43

FB42

FB41

FB40

0EH

MAR6

R/W

FB55

FB54

FB53

FB52

FB51

FB50

FB49

FB48

0FH

MAR7

R/W

FB63

FB62

FB61

FB60

FB59

FB58

FB57

FB56

Tables 2a and b—

This is a bit-by-bit breakdown of pages 0 and 1. Think of these register banks as simple forms that you fill in to tell the RTL8019AS how to handle your data.

(

a)

is page 0 (PS1 = 0, PS0 = 0)) and (

b)

is page 1 (PS1 = 0, PS0 = 1).

a)

b)

background image

Thus, buffer memory was carved out
of system memory. The RTL8019AS
defines the start and end points of its
on-chip buffer memory as 0x4000 and
0x6000 in 8-bit mode. This is only half
of the advertised 16 KB of buffer RAM.

The RTL8019AS datasheet states

that in 8-bit mode the upper memory
limit is 0x6000. [2] So, to satisfy the
buffer area distribution set forth at the
top of Listing 1, following a command
to put the NIC in Loopback mode, the
TPSR register will be set at 0x40,
PSTART will be loaded with 0x46, and
PSTOP will be initialized with 0x60.

Why, you ask? PSTART and PSTOP

define an area of buffer memory called
the receive buffer ring (see Figure 4a).
In this case, the receive buffer ring
consists of 26 256-byte pages. The
transmit buffer memory is not referred
to as a ring and is a contiguous area of
six 256-byte pages. That’s just enough
transmit buffer area to hold a com-
plete Ethernet frame.

You must manage the receive buffer

ring in such a way to make it effec-
tive. Figure 4b includes the current

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

57

Fred Eady has more than 20 years of
experience as a systems engineer. He
has worked with computers and com-
munication systems large and small,
simple and complex. His forte is
embedded-systems design and com-
munications. Fred may be reached at
fred@edtp.com.

SOURCES

PICDEM.net Evaluation board
Microchip Technology Inc.
(480) 786-7200
Fax: (480) 899-9210
www.microchip.com

DP8390 Controller
National Semiconductor Corp.
(408) 721-5000
www.national.com

RTL8019AS Ethernet IC
Realtek Semiconductor Corp.
886 3 578 0211
Fax: 886 3 577 6047
www.realtek.com.tw

SOFTWARE

Additional code is available on
Circuit Cellar

’s web site.

REFERENCES

[1] National Semiconductor Corp.,

“DP8390 Network Interface
Controller: An Introductory
Guide,”AN-475, May 1993.

[2] Realtek Semiconductor

Co., Ltd., “ISA Full- Duplix
Ethernet Controller with Plug
and Play Function(RealPNP),”
May 10, 2001.

[3] National Semiconductor Corp.,

“Writing Drivers for the DP8390
NIC Family of Ethernet
Controllers,” AN-874, July 1993.

[4] ———, “DP83902A ST-NIC

Serial Network Interface
Controller for Twisted Pair,”
TL/F/11157-1, November 1995.

page register (CURR)
and the boundary
pointer register (BNRY)
into the receive buffer
ring scheme. These
two registers assist in
the management oper-
ations of the receive
buffer ring. The current
page register points to
the first buffer used to
store a packet. It also
comes in handy as a
reference pointer when
a receive error occurs.
The boundary register
pointer points to the

first packet in the receive buffer ring
that has not been read by the host. Thus,
the CURR is a write pointer and the
BNRY is a read pointer for the ring.

The ring is considered empty when

the boundary and current page regis-
ters are equal in value. So, because
you’re starting with a fresh ring, the
code writes the PSTART value to both
the boundary and current page regis-
ters. Following the boilerplate code in
Listing 1, the PSTART, PSTOP, and
BNRY registers are initialized and the
interrupt flag and mask registers are
cleared before moving to page 1.

Entering page 1, you have to enter

an Ethernet hardware or MAC address
in the PARX registers. Normally this
address is bought and paid for so that
it can be registered and kept unique.
But I won’t be going any further than
the Sniffer, so I’ll make up one for now.
To be safe and not imply a broadcast
address, I’ll go with 00CCINK.

That pretty much gets the job done

as far as initialization goes. All that’s
left to do is to set the CURR register
and return to page 0. When back to
page 0, the code will service the inter-
rupt registers and set the transmit
control register for normal operation.

MORE PACKETS TO COME

I’ve reached the end for this month,

but this story isn’t finished. There are
Ethernet transmission, reception, and
IP protocol issues to cover to make
this a complete reference document.
Also, you have yet to assemble the
Netsock/100 code and do some real
control work via Ethernet.

Photo 3 indicates that I added code

to Listing 2 to fling some Ethernet
packets out on the Florida-room
LAN. I’ll explore that code segment
and all of the loose ends next time as
I will prove that embedded Ethernet
control based on the RTL8019AS isn’t
complicated, it’s embedded.

I

Photo 3—

In the screen shot of the Sniffer, you can see the NIC register val-

ues as seen from a Tera Term terminal emulator screen.

Reserved bit

Definition

0

Reject error packets

1

Reject runt packets (>8<64 bytes)

2

Reject broadcast packets

(destination address all ones)

3

Reject multi-cast packets

4

Promiscuous mode off

5

Packets buffered to memory

(Monitor mode off)

6

Reserved

7

Reserved

Table 3—

The

rcrval

definition breaks down like this.

background image

nfrared technol-

ogy has always

been my favorite

choice for short-range

remote control and embedded wire-
less communications. The relative
simplicity and low cost of an infrared
data communications link makes it
easily adaptable to many different
types of embedded applications. In
addition, infrared is a convenient
communications medium with many
advantages over more expensive and
restrictive wireless technologies.

As more and more of the electro-

magnetic frequency spectrum is allo-
cated to business and communications
equipment, implementing an RF wire-
less link becomes even more of a chal-
lenge. Infrared offers an inexpensive
and less frustrating design option for
anyone looking to eliminate wired
communications connections. The
advantages of RF technology are clear
for some applications, but restrictions
and sometimes “hard to decipher”
FCC regulations governing the use and
application of RF equipment can deter
even the most determined designer in
search of wireless solutions.

Embedded applications could take

advantage of IRDA high-speed data
communications, but the limited

operating distance (often only a few
meters) for most IRDA communica-
tions components can be limiting for
some types of embedded applications.

Infrared seems less glamorous, and

certainly doesn’t receive media atten-
tion like emergent wireless technolo-
gies such as Bluetooth, but the appli-
cations for infrared are growing rapid-
ly. IR is a well-established, proven
technology that’s been around for a
long time. Unlike communicating
with radio frequencies where data
transmissions radiate in all direc-
tions, infrared offers a design option
with direct line-of-sight for a point-
to-point wireless connection between
two or more devices.

Getting a reliable optical through-

the-air communications link setup is
easier than it first appears, and con-
siderably less expensive than many
alternate wireless options.

Infrared LEDs and IR detector mod-

ules come in many various types, and
careful selection of components can
have a significant effect on the per-
formance of the IR link. As you’ll see,
component selection is highly
dependent on the actual application.
This article will show how careful
selection of key components will
help optimize reliability and operat-
ing distance of an IR communications
link. In the process, I’ll show you sev-
eral circuits for creating an effective
yet inexpensive optical through-the-
air IR communications link.

IR DETECTOR MODULE

In the past, most IR detectors were

designed primarily for use in pulse
code modulated remote control sys-
tems such as those used for television
and stereo remote controls, but man-
ufacturers are now producing IR
detectors with enhanced capabilities
well suited for serial IR data commu-
nications links in embedded systems.
If you’ve ever tried to design an effec-
tive IR detector circuit with an
infrared pin diode and tune the cir-
cuit to perfection, you may appreciate
the simplicity and cost effectiveness
of a simple IR detector module.

Most IR detectors can interface

directly to microcontrollers with lit-
tle or no external component require-

58

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

FEATURE
ARTICLE

Bruce Reynolds

Successfully Choosing
IR Technology

When looking for a
wireless communica-
tion solution, the IR
route can be your best
bet. However, you’re
challenged to make
sure your device
meets the current
requirements and
restrictions. As Bruce
shows us, finding the
right IR solutions is
well worth the effort.

i

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

59

spectral sensitivity to the wavelength
of the IRLED you plan to use. Also
check for low settling times and a
band-pass filter matching the carrier
frequency you plan to use. Keep in
mind, minimum burst length require-
ments define the minimum number
of carrier cycles required inside the
data bit envelope for the detector to
properly recognize each data bit. I’ll
give you a couple examples.

A minimum burst length requirement

of

six cycles with a carrier frequen-

cy of 40 kHz would be 6 × 25 µs for
150 µs per data bit time (see Figure 2).
You can determine the maximum
reliable data rate for a given detector
by knowing the minimum burst
length requirements of the detector. To
determine the bit rate for different
data rates, divide the data rate by one.

For the second example, the bit rate

for a 2400-bps serial datastream is:
1/2400 bps = 416 µs. The bit width for
a 2400-bps data bit is therefore 416 µs,
which is within the minimum burst
length requirements shown in Figure 2.
Table 1 shows data rates with corre-
sponding bit rates.

Maximum burst length will deter-

mine the lowest reliable data rate.
Most of the Panasonic brand detectors
specify 200 µs minimum, 400 µs typi-
cal, and 600 µs
maximum. As
shown in Table 1,
the optimum data
rate for these detec-
tors is 2400 bps
(4800 bps nearly
violates minimum
burst length
requirements and
1200 bps exceeds
the maximum).

ments. Some are suited for reliable
serial communications at 2400 bps,
and a few can even reach data rates
up to 4000 bps. If you’ve ever had to
pull miles of communications cable
through attics, basements, and other
incredibly nasty places, you’ll like
this simple detector module and an
easy through-the-air IR wireless link
for that next embedded chat-line.

Closer inspection of the module

quickly reveals why they are becom-
ing increasingly popular with embed-
ded designers. The benefits are obvi-
ous in Figure 1. A detector module
includes an internal IR pin diode,
transimpedance amplifier, gain-con-
trolled amplifier, AGC, band-pass fil-
ter, automatic threshold control, and
integrator with Schmitt trigger.

I base my infrared detector module

preference on cost and convenience.
Designing an efficient IR detector cir-
cuit from scratch requires several
components, and the cost of buying a
manufactured IR detector is often con-
siderably less than the components
required to roll your own. A good
quality detector will have a lens
impregnated with visible light cutoff
resin. The resin is designed to block
visible ambient light sources, as well,
making the choice even more enticing.

Panasonic and Vishay Telefunken

manufacture IR detector modules that
work well for receiving serial data. I
most often use the Panasonic 40-kHz
PNA4613M, however, both manufac-
turers products are excellent choices
for reliable data rates up to 2400 bps.

Some properties to look for when

selecting an IR detector module for
wireless communications in your
project are minimum/maximum burst
length requirements and maximum

Device specifications presented in

detector datasheets are most often
derived under optimum laboratory
conditions, and thus will vary in real-
world applications. I have successfully
used 1200- to 2400-bps rates with
excellent results under varying condi-
tions, with various detector modules.

SPECTRAL SENSITIVITY

The spectral sensitivity characteris-

tics of the IR detector module are
important to know. A detector that
has optimum relative sensitivity to
infrared radiation at a wavelength
(color) of 940 nm (nanometers) will be
highly sensitive to transmissions
received by an IRLED with a peak
wavelength of 940 nm. The response
curve shown in Figure 3 illustrates
the effect of an IRLED with a peak
wavelength matching that of the
detector module.

Two popular types of IRLEDs are

GaA (gallium arsenide), at 940 nm,
and GaAlA (gallium aluminum
arsenide), at 880 nm.

As shown in Figure 3, it’s clear that

even something simple like selecting
the appropriate IRLED or the correct
IR detector module for the IRLED you
plan to use will be an important fac-
tor in sensitivity of the IR communi-
cations link. The sensitivity of the IR
detector would be approximately 50%
less than optimum with an IRLED of
880 nm being used with the transmit-
ter. At 940 nm it will be 100%.

An IR receiver that’s highly sensi-

tive to transmissions from the data
source with the ability to reject ambi-
ent infrared noise sources is critical
for extended, reliable operation of the
wireless IR communication link. The
carrier frequency also plays a key role,
which I’ll discuss later.

Bias

Automatic

gain

control

Integrator and Schmitt trigger

Transimpedance

amplifier

Controlled

gain

amplifier

Automatic

threshold

control

GND

Out

+V

S

Band-pass filter

Figure 1—

Designed for plug-and-play operation, the IR detector module contains all of the required circuitry for

reliable infrared data communications in a tiny three-pin housing.

One byte in RS-232
2400 bps

0

0

Stop

1 1

1

0 0

1

Start

Figure 2—

The timing diagram shows a 2400-bps serial datastream modulated at

40 kHz. If you want to figure out the data rate, you have to determine the detec-
tor’s minimum burst length requirements.

background image

The PIC16F876 CCP (capture/com-

pare/PWM) module contains a 16-bit
register that can operate as a 16-bit
capture register, 16-bit compare regis-
ter, or PWM master/slave duty cycle
register. For this application, you’re
only interested in PWM mode.

In PWM mode, CCP1 pin 13 (RC2)

can provide up to 10-bit resolution
PWM output with invisible back-
ground operation. Writing to the PR2
register period specifies the PWM
period. The PWM period required to
generate a 40-kHz signal can be calcu-
lated as 1/40 kHz, or 25 µs. The fol-
lowing formula may be used to calcu-
late the value to load into the PR2
register [1]:

A oscillator frequency of 4 MHz

will produce a 4-MHz PWM signal if
PR2 = 24 and TMR2 prescale = 1. Also
note, the PWM period will equal
0.000025 s, or 25 µs.

Before calculating the duty cycle,

you need to find your maximum duty
cycle resolution in bits. Maximum
PWM duty cycle resolution (bits) for a
given PWM frequency can be calculat-
ed by using [1]:

log

Fosc

Fpwm

log 2

The detector module’s band-pass fil-

ter is an important part of the detec-
tor circuit, and provides maximum
performance in disturbed environmen-
tal conditions. The band-pass filter
rejects infrared signals outside the
center (band-pass) frequency to elimi-
nate or reduce interference from ambi-
ent IR sources considered as noise.

As shown in Figure 4, optimum

sensitivity for the PNA4612M IR
detector module is obtained from a
carrier frequency of 38 kHz. Being as
close as possible to the band-pass fil-
ter center frequency of the detector
with the carrier will increase system
performance considerably. Notice
how even at 37 kHz, the IR detector’s
relative sensitivity to the carrier fre-
quency drops to approximately 80%.

CARRIER FREQUENCY

Various oscillator circuits are avail-

able such as 555 timer circuits and
crystal circuits. I’ve found, however,
that 555 timer circuits are picky and
hard to adjust. They have large
amounts of drift, dependent on the
quality of components used to con-
struct the oscillator circuit and
changes in ambient temperatures.

Crystal circuits, on the other

hand, are much more precise, but
will also experience frequency drift
because of ambient temperature fluc-
tuations and external components.
Not to mention, crystals in this fre-
quency range are often difficult to
find. My favorite choice of oscillator
for this type of application is the
onboard hardware PWM feature of the
PIC microcontroller.

The hardware PWM feature of the

PIC has several advantages. After the
hardware has been configured, the
PIC will continue to generate the
PWM carrier signal without software
intervention; it continues in the back-
ground, completely invisible to code
performing other tasks. This is true
multitasking. Set it up, turn it on, and
walk away. It will continue to operate
until instructed to do otherwise.

Adjustments to the carrier frequen-

cy or PWM duty cycle in the software
can be accomplished without user
intervention or hardware manipula-
tion as with other oscillator circuits.

60

Issue 136 November 2001

www.circuitcellar.com

CIRCUIT CELLAR

®

LOW SETTLING TIMES

The settling time is the time period

required by the detector module to
stabilize when power is first applied.
Most IR detector modules consume
approximately 1.5 to 3 mA. For typi-
cal battery-powered applications even
1 mA is too much. Selecting a detec-
tor with a low settling time makes it
possible to supply power to the detec-
tor using one I/O pin from the micro-
controller and control the on/off state
of the detector, thus saving power
when the detector is not being used
for active IR data communications.

Power cycling the detector on and

off with an I/O pin can save consider-
able power in battery-powered appli-
cations. Settling times of

200 µs are

available on some detector modules,
and for battery-powered embedded
applications this can be an important
feature. For applications powered by
fixed power supplies this may be of
little consequence. A detector with a
low settling time of

200 µs will

allow fast start, receive, and power
down to conserve battery life.

BAND-PASS FREQUENCY

Select an IR detector with a center

frequency matching the carrier fre-
quency you plan to use, and select an
oscillator as close as possible to the
detector’s band-pass filter center fre-
quency to ensure optimum sensitivity.

Spectral sensitivity characteristics

100

80

60

40

20

0

600

700

800

900 1000 1100 1200

Wavelength

λ

(nm)

Relativ

e sensitivity S (%)

B.P.F. frequency characteristics

(PNA4612M)

100

80

60

40

20

0

33

35

37

39

41

43

Carrier frequency (kHz)

Relativ

e

sensitivity S (%)

Figure 3—

Maximum operating distance of the wireless

link is achieved by matching the wavelength of the IR
emitter and detector as closely as possible.

Figure 4—

Optimum sensitivity for the PNA4612M IR

detector is obtained from a carrier frequency of 38 kHz.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

61

Assuming you have a 4-MHz oscil-

lator (Fosc = 4 MHz) and 40-kHz PWM
(FPWM = 40 kHz), the resulting reso-
lution would be 6.644 bits, or 6-bit
maximum resolution.

Up to 10-bit resolution is possible

with the CCPR1L register contain-
ing the eight MSBs and CCP1CON
bits 5 and 4 containing the two LSBs.
At 4 MHz for a 40-kHz PWM signal
with maximum 6-bit resolution, you
can ignore CCP1CON bits 5 and 4
(the lower two bits, which are used
only for 10-bit resolution).

The following calculation shows

how to find the value to load into
CCPR1L to establish the PWM duty
cycle:

CCPR1L = (PR2 + 1) × TMR2 prescale

× duty

A 20% duty cycle would be expressed
as 0.20. With a prescale of one for
TMR2 and PR2 = 24, the calculation
to solve for CCPR1L is:

CCPR1L = (24 + 1) × 1 × 0.2 = 5

The short PicBasic Pro code sample

in Listing 1 demonstrates how you
can set up a 40-kHz PWM signal with
a 20% duty cycle and 4-MHz oscilla-
tor. If you’re programming in assem-
bly, just write the same values to
each register as shown in Listing 1.
PicBasic Pro makes register access
and data manipulation much easier
than assembly does, but that would
be another article altogether.

The following five steps should be

taken to configure the CCP module
for PWM operation. [1] First, set the
PWM period by writing to the PR2
register. Second, set the PWM duty
cycle by writing to the CCPR1L regis-
ter and CCP1CON bits 4 and 5. For
the third step, make the CCP1 pin an

output by clearing TRISC.2. Fourth,
set the TMR2 prescale value and
enable Timer2 by writing to T2CON.
Finally, fifth, configure the CCP1
module for PWM operation.

The PIC hardware PWM will now

run in the background completely
invisible to your code, which is busy
performing other tasks. To turn off
the PWM, simply write a value of
zero to the CCP1CON register or
clear CCP1CON bits 2 and 3. Next,
set bits 2 and 3 to restart the PWM.

Now that you have established the

maximum data rate for the detector
and decided on the carrier oscillator,
you need a way to control (modulate)
the carrier with your serial datas-
tream. The illustration in Figure 5
shows a simple two-transistor NAND
drive circuit configuration that allows
you to send infrared serial data modu-
lated at the band-pass filter center fre-
quency of the IR detector module at
40 kHz. The serial datastream is
applied to the base of one Zetex 603
NPN transistor. The PWM carrier fre-
quency from the PIC RC2 pin (CCP1)
is applied to the base of a second
Zetex 603 NPN transistor.

Using the unregulated 9-V supply

for the IRLED allows you to use a
smaller 5-V voltage regulator, and
helps overcome the large V

CE

of the

dual Darlington transistors, which
cannot operate in a saturated mode.
When the transmitter is inactive, sim-
ply hold the serial output pin at logic

0 to ensure the NPN transistor does
not conduct. For further power sav-
ings, turn off the PIC hardware PWM.

You can construct your own

NAND gate using two NPN
Darlington transistors (see Figure 5)
or an IC NAND gate. A NAND
Schmitt trigger such as the 74HC132
provides stable operation and is an
excellent choice. The circuit shown
in Figure 5 introduces an additional
voltage drop for the second NPN
transistor, leaving less power avail-
able for the IRLED. Nonetheless, it’s
effective and simple to construct.

The homemade NPN NAND gate

requires less space than the 14-pin
74HC132, and is handy if you don’t
have the 74HC132 available. When
using the 74HC132 NAND Schmitt
trigger, you’ll need a PNP drive tran-
sistor to hold the IRLED off until
both inputs are at logic 1. If you’re
looking for more samples of the
NAND driver circuit, visit the
Reynolds Electronics web site
(www.rentron.com).

HOW IT WORKS

As illustrated in Figure 6, the PWM

frequency (carrier) is applied to the
base on one NPN transistor as shown
in trace B. Trace A represents the
serial datastream applied to the base
of the second NPN transistor.

As simple as it seems, this is quite

effective at generating a 40-kHz mod-
ulated serial datastream. Figure 7
shows the resulting serial datastream
produced by the combination. Trace
A shows the inverted serial datas-
tream being transmitted at 40 kHz.
Trace B shows the carrier applied to
the second NPN transistor.

Taking advantage of the NAND

transistor configuration or the NAND
Schmitt trigger, you can use the serial
data to envelope the carrier within
each serial data bit providing the
modulated data expected by the IR
detector module at the receiver.

The IR detector’s band-pass filter

simply strips the carrier from within
each bit envelope, leaving the com-
plete bit structure of the serial datas-
tream intact, and delivering the wire-
less serial data to the output of the IR
detector. Incoming serial data is now

Data rate

Bit rate

300

3.3 ms

1200

833 µs

2400

416 µs

4800

208 µs

9600

104 µs

Table 1—

For a better understanding, check out these

examples of calculating bit rates for various data rates.

Listing 1—

Register configurations for 40-kHz PWM on CCP1 using the PIC16F876.

PR2 = 24

‘ Load PR2 register for 40kHz

CCPR1L = 5 ‘ Set duty cycle to 20%

TRISC.2 = 0 ‘ Set PORTC.2 (CCP1) to output

T2CON = %00000100 ‘ Turn on Timer2, Prescale = 1

CCP1CON = %00001100 ‘ Set CCP1 to PWM mode

INTCON.7 = 0 ‘ Disable interrupts

background image

Assuming an IRLED with a maxi-

mum peak pulse current of 1 A and
maximum average current of 200 mA,
a 24% duty cycle would allow contin-
uous serial transmissions at peak
pulse currents while staying within
the maximum average current limita-
tions of the IRLED.

ADAPTIVE POWER CONTROL

Firmware control of the PWM fre-

quency and duty cycle adds a lot of
flexibility to the design. The internal
AGC stage of the IR detector
attempts to ensure immunity to
ambient disturbances by automatical-
ly adapting to noise or disturbance
levels by changing the gain of the
internal amplifier.

In dark ambient conditions, gain

will increase. On the other hand, in
light ambient with higher noise lev-
els, the internal AGC will decrease
gain to avoid false output pulses.
With a CDS photo cell connected to
one of the PIC16F876 A/D inputs,
you may alter the output power of
the IRLED drive circuit based on
10-bit analog light measurements
and adjust the duty cycle in order to
compensate for fluctuating ambient
lighting conditions.

You may also reduce IRLED drive

current/output power. With the
internal AGC increasing gain during
dark ambient conditions, less optical
power output is required for commu-
nication with the detector, and short-
er duty cycles will extend the life of
the IRLED. In addition, in high noise
conditions or high ambient light, you
may use this technique to increase
optical output power with longer
duty cycles for environmental adapta-
tion to changes.

Although there are a few trade-offs

using this technique, it does allow a
degree of adaptation and interaction
with external events. Those external
events are often the core of many
embedded applications.

Using the adaptive power control

approach to minimize transmitter
power and prolong optical compo-
nent life requires transmissions to
be bidirectional for feedback from
the receiving unit. Feedback from
the receiver allows the transmitter

62

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

ready for delivery to the controller on
the receiver end connected to the IR
detectors output pin.

IRLED PEAK PULSED CURRENT

Selecting drive transistors with low

V

CE

(sat) will allow more power for

driving the IRLED. Using the two-
transistor circuit shown in Figure 5,
the following equation shows how to
calculate IRLED peak pulse current;

where V

CC

= 9V. V

CC

is applied to a

node of IRLED. V

LED

= 1.7 V (voltage

drop of IRLED), V

CE1

= 1 V, the drop of

the first ZTX603. V

CE2

= 1 V, the drop

of the second ZTX603. R

S

= 5.1

, the

IRLED series current limiting resistor.

The Zetex 603 transistors are

capable of handling a continuous
current of 1A and a peak pulse cur-
rent of 4 A. The Lumex OED-EL-1L2
IRLED can withstand a forward cur-
rent of 100 mA with a forward volt-
age drop of 1.7 V. The LED will not
remain on continuously when pulsed

at 40 kHz. This technique
allows you to pulse-drive the
IRLED at peak pulse currents
well beyond the rated maxi-
mum current level limitations.

With the PIC hardware PWM

generating the carrier, you also
have full control of the duty
cycle via software. By adjusting
the duty cycle of your PWM,
you also can control the output
power of your IRLED, because:

Average LED current = peak

LED

current × PWM duty cycle

By controlling the PWM duty
cycle, you can increase or
decrease the average current

delivered to the IRLED. This
can be convenient for many
embedded applications.

The radiant flux of the LED is

proportional to its forward current.
However, a prolonged high forward
current will create heat, causing the
light-emitting efficiency to decrease.
Pulse driving techniques are used to
prevent overheating the LED.
Consequently, a large radiant flux can
be obtained. With a peak pulsed cur-
rent of 1 A, you can easily adjust the
average current by controlling the
width of the high (or duty) cycle of
your PWM (see Table 2).

A single byte of serial data sent out

at 2400 bps will consist of 10 bits,
including 1 start bit, 8 data bits, and
1 stop bit. Individual bit rates at
2400 bps are 416-µs long. A single
byte transmission therefore would be
approximately 10 bits × 0.000416, or
4.1 ms in duration.

With the start bit at logic 0 and

stop bit at logic 1, the worst-case sce-
nario would be transmitting a value
of 255 for a total on time of 9 bits ×
416 µs = 3.7 ms. A logic 0 bit will not
turn on the NPN drive transistor
NAND configuration, hence no
power is delivered to the IRLED dur-
ing logic 0 bit times.

So, the time average current during

the serial transmission period will
vary widely depending on the actual
data being sent during a continuous
serial data transmission period.

ZTX603

1k

2

Serial data input

1

3

ZTX603

1k

2

40-kHz Oscillator

1

3

1

+9

IRLED

5.1-

Figure 5—

I used this homemade NPN Darlington NAND config-

uration for my IRLED drive circuit to conserve space and simpli-
fy the design.

background image
background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

65

to adjust rapidly to changing condi-
tions for enhanced signal-to-noise
ratio (SNR). [2]

Firmware control of the frequency

also allows you to send serial data to
various IR detector modules or other
equipment operating at different cen-
ter frequencies. An embedded con-
troller can establish wireless commu-
nications with other controllers, and
then adjust frequency/data formats to
control appliances such as television
or audio equipment.

Knowing the bit time for various

data rates and periods required to
generate different frequencies, it’s
also possible to send serial data

modulated at the carrier frequency
out a single I/O pin, but this method
is less portable than using hardware
PWM and the simple NAND configu-
ration drive circuit. This method
requires considerable firmware over-
head when attempting to control
PWM frequency, data formats, on-the-
fly data rate changes, and adaptive
power control techniques.

A circuit constructed with the dual

NPN drive circuit or NAND Schmitt
trigger and inexpensive PIC with
hardware PWM can be quickly insert-
ed into any existing system with
asynchronous serial capabilities for
immediate wireless communications.

I have used both methods, and

appreciate the portability of the
NAND/PWM approach. A MAX232
RS-232 converter allows direct con-
nection of this circuit to the PC serial
port. Also note that insertion into
existing embedded systems doesn’t
require hardware/firmware redesign
for the addition of IR wireless com-
munications. And, as you’ll see, the
receiver circuit is simple and flexible.

THE RECEIVER

Infrared detector modules with the

capability of interfacing directly to
the PIC or other microcontrollers
require (in most cases) no external
components. The output pin of the
detector module remains at logic 1
until data is received modulated at
the band-pass center frequency.

During quiet periods when no data

is being transmitted, the output of
the detector will ideally remain at
logic 1. However, infrared detectors
are highly sensitive and stand contin-
uously ready to receive data signals as
long as power is applied. Note that
this high degree of sensitivity makes

Figure 6—

Trace A shows the serial datastream

applied to the base of one NPN transistor. The PWM
frequency (carrier) is applied to the base on the second
NPN transistor as shown in trace B.

Figure 7—

Trace A illustrates the inverted serial datas-

tream being transmitted at 40 kHz. Trace B demon-
strates the 40-kHz carrier applied to the base of the
second NPN transistor.

JK

microsystems

Call 530-297-6073 Fax 530-297-6074

See our new site www.jkmicro.com

l

Intel 386EX

@

25MHz

l

DOS & Web server pre-installed

l

Realtime multitasking available with eRTOS

l

TCP/IP

&

10Base-T Ethernet

l

In-Circuit-Programmable Xilinx CPLD

l

512K SRAM, 512K Flash standard

l

Accepts M-Systems DiskOnChip

l

Many expansion board combinations

l

46 Digital I/O Lines

l

5V DC Power

l

Clock/Calendar

l

(1)RS232

+

(1)RS232 /485

l

Dimensions 4.2"

x

3.6"

LO

WE

R p

ric

es

De

v K

it $

289

Qty

10

0 $

139

ea

.

New

background image

66

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

the detector susceptible to different
types of disturbances not associated
with the data signal.

Most IR detectors will attempt to

automatically adjust the internal
gain to optimum levels for maximum
sensitivity to the data signal, while
at the same time attempting to sup-
press unexpected output pulses
caused by external noise. Hence,
optimum sensitivity is influenced by
the amount of localized external
noise in the operating environment of
the IR detector module.

The majority of disturbance signals

composed of light emissions in the
visible and IR spectrum from com-
mon white light sources are canceled
by the visible light cutoff resin
impregnated in the detector modules

lens. Combined with internal discrim-
ination circuitry of the detector, this
situation is normally sufficient to
reduce or eliminate false triggering or
dark bits (pulses on the output in the
absence of infrared signals) on the out-
put of the detector. However, this
may not be sufficient for 100% relia-
bility in some conditions. So, keep in
mind that shielding the face of the
detector from direct exposure to sun-
light, tungsten incandescent lamps,
and other radiant sources helps to
improve the sensitivity and reliability
of the IR detector.

The red IR filters found in hobby

remote-control plastic enclosures are
sufficient for most applications. The
plastic filter adds additional optical
filtering and improves detector

gain/reception distance considerably
even in conditions where no apparent
disturbance is present.

DISTURBANCE SOURCES

Cathode Ray Tubes (CRTs) in tele-

visions and other equipment can pro-
duce sufficient electromechanical
interference (EMI) to interfere with
operation. Locating the receiver close
to a CRT will increase the possibility
of interference from deflection fre-
quencies and their harmonics. In
applications in which it’s impractical
to locate the receiver far from these
sources of disturbance, you should
choose a detector with internal or
external metal shielding.

The metal shielding combined with

the internal AGC helps suppress
influence from external EMI sources.
The internal metal shielding of the
Vishay Telefunken IR detector mod-
ules have an advantage compared to
external metal shielding of other
modules because the module appears
black and doesn’t produce a glare
behind the front panel or secondary
filtration optics.

Power supply noise suppression cir-

cuit examples are available in most
detector datasheets, and can be effec-
tive at reducing or eliminating influ-
ences from noise (see Figure 8).

The output of the detector should

remain at a constant logic 1 in the
absence of an infrared signal. Dark
bits are normally caused by EMI,
power supply, or ground loop noise.
Noise spikes from switching power
supplies or inadequate power-supply
filtration can produce sufficient dis-
turbance to degrade overall sensitivity
of the detector.

A simple RC filter circuit is nor-

mally sufficient to suppress these dis-
turbances (see Figure 8). However,
you also should consider adequate
power supply filtration during the
design phase to increase overall sys-
tem sensitivity and help extend the
operating range of the IR wireless
communications link.

For the receiving controller, usually

all that’s required is a direct interface
to the IR detector modules data out-
put pin to receive incoming serial
data. The detector’s output can be

Table 2—

With a peak pulse

current of 1 A, you can easi-
ly adjust the average current
by controlling the width of
the high (or duty) cycle of
your PWM.

Peak IRLED current

PWM Duty cycle

Average IRLED current

1 A

4%

40 mA

1 A

10%

100 mA

1 A

24%

200 mA

1 A

50%

500 mA

1 A

75%

750 mA

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

67

REFERENCES

[1] Microchip Technology Inc.,

“28/40-Pin 8-Bit CMOS Flash
Microcontrollers,” DS30292C.

[2] R. Otte, L. de Jong, and A. van

Roermund, Low-Power Wireless
Infrared Communications

,

Kluwer Academic Publishers,
Netherlands, September 29,
1999.

[3] Vishay Telefunken, “General

Overview of IR Transmission in
Free Space,” 06.00.

Bruce Reynolds is the owner of Rey-
nolds Electronics (www.rentron.com),
an Internet-based company that
offers embedded development sys-
tems, PIC Basic compilers, robotics
equipment, infrared and RF remote
control/wireless components, and
technical books.

SOURCES

OED-EL-1L2 LED
Lumex, Inc.
(847) 359-2790
Fax: (847) 359-8904
www.lumex.com

PIC16F876 CCP
Microchip Technology Inc.
(480) 786-7200
Fax: (480) 899-9210
www.microchip.com

603 NPN Transistor
Zetex Semiconductor
44 161 622 4444
Fax: 44 161 622 4420
www.zetex.com

IR detector modules
Panasonic
www.panasonic.com

Vishay Intertechnology, Inc.
(610) 644-1300
www.vishay.com

RESOURCE

D. Johnson, “Handbook of Optical
Through the Air Communications,”
www.imagineeringezine.com/air-
bk2.html.

easily interfaced to the PC serial port
through a MAX232 RS-232 level con-
verter IC for embedded wireless IR
communications with the PC.

Even with these inexpensive, and

simple methods; the limitations and
applications are virtually endless.

SELECTING AN INFRARED LED

The infrared LED is a critical com-

ponent and should be chosen careful-
ly based on the overall requirements
of the application. Select an IRLED
with a peak wavelength matching
that of the IR detector. IR energy at a
wavelength other than the ideal 940 nm
received by a detector with peak sen-
sitivity in the 940-nm range will not
be converted with maximum efficien-
cy by the detector module.

The maximum transmission dis-

tance of the wireless IR link depends
on several factors. Primary considera-
tions are the radiant intensity of the
emitter (Ie), sensitivity of the receiv-
er, and reflective properties of the
system’s environment.

Applications in which multiple

transmitters and receivers will oper-
ate simultaneously within the same
air space will benefit from an IRLED
with a narrow-beam angle. This is
because the directional properties of
a narrow-beam angle make direct-
line-of-sight, point-to-point, as well
as multi-transmitter/receiver envi-
ronments possible.

IR emitters with narrow emission,

or beam angles, usually provide high-
er radiant intensity in megawatts per
sr, but will require precise alignment
between transmitter and receiver. For
small areas where direct line of sight
between transmitter/receiver isn’t

practical, maximum coverage can be
achieved by selecting an LED with a
much wider emission angle.

Wider emission angles make it possi-

ble to bounce IR signals off surrounding
walls without the direct-line-of-sight
restrictions or alignment problems with
a narrow-beam angle IR emitters.

Calculating the transmission range,

in the simplest case, assumes a square
law relationship between distance (d)
and irradiance (Ee) receiver. [3] With a
known emitter intensity (Ie), the cal-
culation is:

In most cases, the actual distance

will be longer than the result derived
by the square law. But, selecting an IR
emitter with sufficient radiant inten-
sity based on the expected operating
distance and known responsive prop-
erties of the detector will help you
reach optimum operating distances. [3]

Look for manufacturers that provide

comprehensive IR emitter/detector
datasheets that show emitter radiant
intensity in megawatts per sr, emission
angles, peak pulse current specifications
for IR emitters, and thresholds for IR
detector module sensitivity. I’ve done
well with Vishay Telefunken IR prod-
ucts because they’re supported by
detailed datasheets and informative
applications notes.

Infrared technology has a lot to

offer, and compared to other options
it’s well within the budget for many
embedded applications. So, the next
time you’re faced with stringing miles
of cables for a communications link,
you may want to first consider a sim-
ple yet effective IR wireless design.

Figure 8—

An ounce of prevention goes a long way toward establishing reliable IR communications, as shown in

this simple RC noise filter circuit.

Even the sharpest knife is a poor
choice for a gunfight, but it certainly
has its place when needed.

I

GND

0V

Out

+V

S

Supply voltage

10 K

R1 100

background image

68

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

wasn’t brought

up to disbelieve my

elders, never mind my

college professors. So

when I was taught that transistors
were just a fad, I didn’t complain about
the many long hours spent on the
virtues of the vacuum tube. Not that
tubes have ever really gone away, but
they are certainly not responsible for
the explosion of technology. I realize
now my professors were just teaching
what they knew best. I use this as a
constant reminder to be open to new
technologies and not to become com-
placent with what I’m using today.

The oscilloscope was the number

one design tool at the time, and it
soon became evident that transistors
were a lot less expensive, easier, and
less hazardous to design with than
hot glass for both analog and digital
circuitry. I hardly think about the
transistor advances, which made way
for the op-amp and digital logic gate.
After losing access to the test gear of
the college’s engineering lab by gradu-
ating, I found my loan payments ate
up what little money I had for my own
gear. How I wished for an oscilloscope.

Then I found that I could design

digital logic (’74 series) without a
scope. Someone had put out a line of

digital tools. A logic probe would
show (nearly) all you need to know
about output of logic devices without
a scope. A digital signal injector
would provide a trigger or clock to
stimulate digital logic inputs. Both of
these were about $10 a piece. I was in
heaven. The simplicity of an LED to
show status has never left me. The
logic probe may have been the device
that continues to spur on all of those
status messages (much like Morse
code). I’ll bet you’ve used a single LED
as a diagnostic tool for code execution.

I still use these tools from time to

time. They fit easily into my portable
tool case. It’s no wonder that when I
saw an advertisement for the osziFOX
pen-type storage oscilloscope I was
immediately intrigued. It’s the shape
of the osziFOX that set the hook and
the price that reeled me in.

If you’re familiar with standard small

LCDs, you know that the minimum
size package you need to house it is
far from small. And that’s for a char-
acter display, not even a dot matrix
array. OsziFOX has a 16 × 64 dot
matrix display that’s almost as wide
as the probe’s body. Refer to Figure 1
for the control locations on oszi’ as I
discuss the different modes available.

MODE MANIPULATION

The oszi’ requires a 9-V battery or a

9- to 14-V power supply to operate. A
power cord is included with alligator
clips for easy power connection from
your circuit, battery, or power supply.
Current demands are in the 12- to 85-
mA range, depending on whether or
not the backlight is enabled.

Jeff Bachiochi

Probe This

i

FROM THE
BENCH

Jeff
learned
to make
due
without
an oscil-

loscope. But when he
saw an affordable,
pen-type ’scope, the
offer was too good to
pass up. With his new
osziFOX, he went to
troubleshoot circuits.

Photo 1

These two screens show the typical displays

of DVM (top) and Oscilloscope modes.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

69

The osziFOX powers up as an oscillo-

scope. Pressing the Menu button steps
through the four functions. The first
function is Timebase and sets the sam-
ple rate when using osziFOX as an oscil-
loscope. The selected timebase is dis-
played; 50 ns is the default (5-MHz
bandwidth maximum). Also, there’s a
small gap in the line below the timebase
that shows the timebase selected in rela-
tion to the possible selections. The slow-
est timebase is 2 ms (100-Hz bandwidth
minimum). Choose a timebase with
the Select button. Each press cycles
through one of the 11 timebases.

The second function, trigger, also

pertains to the oscilloscope function.
Five types of triggers can be used to
begin a sampling sweep, free run, a
rising or falling internal voltage, and a
rising or falling external voltage. Free
run continuously samples the input
without any triggering necessary. The
remaining four selections require an
additional choice of one of six possi-
ble trigger levels, three above and
three below zero. Again, choose these
with the Select button.

In addition, these selections can

single or continuously trigger the
sweep. In Single Sweep mode, “wait-
ing” is displayed prior to actually
being triggered. Two single pin jacks
are available (on the reverse side of
the oszi’), allowing the included micro-
chip leads to be used when necessary.
One jack is for external triggers and
the second is for a circuit ground.

The third function enables and dis-

ables the backlight. The default selec-
tion is off. Enabling the backlight can
add ~70 mA to the supply require-
ments, which isn’t a factor unless you
are using a 9-V battery to feed the oszi.

The final function chooses between

using the osziFOX as an oscilloscope
or DVM. Not much needs explaining
here except for the ranges. The maxi-

mum input volt-
age the oszi’ will
accept without
getting terminal-
ly ill is 42 VDC,
or 42 VAC peak
to peak. There

are three input
ranges that will
allow the oszi’ to

measure voltage. Choose the lowest
range that wholly contains your signals
potential. You can choose 0 to 1 V, 0 to
10 V, or 0 to 100 V on the voltage selec-
tor. Why have a 0- to 100-V range when
all you can measure is a maximum of
42 V? The osziFOX actually can meas-
ure both positive and negative voltages.

Photo 1 shows typical LCD displays

for both DVM (DC voltage levels) and
Scope (DC/AC voltages) modes. Notice
the zero level adjust (see Figure 1)
control next to the LCD. In Scope
mode, the horizontal line (ground is 0
V) can be move up, down, or centered
on the screen. For voltages that are
not bipolar, you can adjust this refer-
ence line and get twice the screen res-
olution. There are only 16 vertical
dots on the screen, so you’ll want to
take full advantage of this feature.

You’re probably wondering how this

adjustment affects the DVM mode.
When the AC/DC/GND switch is
switched to ground, you can adjust
the ground reference in relation to the

Figure 1

The oszi FOX pen-type oscilloscope has simple controls and can run on a

9-V battery connected to the power jack.

Probe

Select

Menu

AC/DC

GND

Voltage

selector

Serial

line

Zero-level adjust

LCD

Power

jack

Byte

Name

Definition

Comment

Synchronization

Bits 6–2 = Always set

7F hex

Bit 1 = Reserved

Also used to detect hardware attachment

Bit 0 = Trigger Awaiting mode

1

Switch setting

Bit 6 = Not used
Bit 5 reset = AC

If bits 5 and 4 are cleared = GND

Bit 4 reset = DC
Bit 3 set = 100 V

If bits 3 and 2 are cleared = 1 V

Bit 2 set = 10 V
Bit 1–0 = Not used

2

Timebase definition

0 = 50 ns
1 = 100 ns
2 = 0.5 µs
3 = 1 µs
4 = 5 µs
5 = 10 µs
6 = 50 µs
7 = 0.1 ms
8 = 0.5 ms
9 = 1 ms
10 = 2 ms

3

Trigger definition

Bit 6 = Not used

If byte and 7E hex = 0 = free run

Bit 5 = +Internal
Bit 4 = –Internal
Bit 3 = +External
Bit 2 = –External
Bit 1 = Not used
Bit 0 set = Single
Bit 0 reset = Run

4

Trigger level

Bit 6 = Not used

If byte = 0 = –0.5

Bit 5 = –0.3
Bit 4 = –0.1
Bit 3 = 0.1
Bit 2 = 0.3
Bit 1 = 0.5
Bit 0 = Not used

Next
128 bytes

Signal

133

DVM value (100s)

0–9

Valid values available from 0 to 3F hex (6 bits)

134

DVM value (10s)

0–9

135

DVM value (1s)

0–9

136

DVM flags

Bit 6–4 = Not used

Values are true if byte is set

Bit 3 = Minus flag set
Bit 2 = Reserved
Bit 1 = Overflow flag set
Bit 0 = Under-flow flag set

Table 1

The communications format makes it easy to use data from the osziFOX in your own application. This

periodic data is continuously output at 19.2 kbps (7N1).

background image

Saelig

C

o. Inc.

716-425-3753 • Fax: -3835

www.saelig.com • saelig@aol.com

HHii

!! II’’m

m AAllaann LLoowwnnee..

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 instrumenta-

tion 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 specific control

or measurement

problem.

• Over 50 different DIN-modules for:

analog i/p & o/p, thermocouple i/p,
digital i/p, relays, on 2000m network!

• 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

Make PCs

talk I

2

C

easily!

ISA PCI p-port

RS232 to RS422 &

RS485 converters

• Store analog/

digital data on
PC FlashATA cards

• > 100 readymade

software function
modules—finish quickly.

• 8ch 10bit A/D, 33 I/Os, I

2

C, 2 x

RS232, interrupts, sleepmode,
pre-emptive multitasking, easy to
attach LCD or keypad.

• CANbus adapter—recompile or log

data over huge network!

osziFOX

$

129

Self-contained in
2" x 3" plastic box,

2-year battery-

powered 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!

Handheld

PenScope

2-Year

Dataloggers

PCMCIA

Datalogger TDS2020D

lowpower PCcard logging

Remote control & data

acquisition without power!

PC Instruments

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!

• EnviroMon

temperature

logging/alarm system
standalone or with PC.

TH-03

thermistor-

to-PC converter

TC-08

8x thermocouples

N

O

W

!

G

P

S

L

o

g

g

i n

g

see what’s new at www.saelig.com!

Industry-standard
card for PC’s

. . . . . . . . . . . . .

$

299

• Master, Slave or Bus monitor

• Control or program I

2

C devices

• Low volt ICA93LV for 3V ic’s . .

$

399

PARALLEL PORT VERSION

NEW - PCI VERSION!

BIT

link

®

CANboards

USB ic’s

RS232 <> USB easily!!

SMD PCB adapters

for prototyping

by Janz

for all

computer

s

www.abidata.be for details.

“Ho

w to I

2

C”

www

.saelig.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

science experiments!

- only $99!

2-wire

control network

power & information on 2-wires!

CANbus

Starter Packs

Boards for PCI/ISA/PCMCIA/PC104/VME/compPCI

Drivers for WIn95/98/NT,VxWORKS, pSOS, Lynx,

Linux, OLE, HPVee, LabView, etc.

DrDAQ

Educational

Datalogger

built-in sensors!

www.drdaq.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.

new!

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

71

input (see Figure 1). Use the zero level
adjust to take full-scale advantage of
the known polarity. The reference
line moves up and down based on the
position of the zero level adjust.

DVM mode measures DC voltages

only. In this mode, slide the AC/DC/
GND switch to DC when you’re ready
to make a voltage reading. When in
Scope mode, you may use either AC
or DC as necessary. Use AC if you
wish to get rid of any DC level that
your AC signal may be riding on.

OSZI IN ACTION

The approach I use when trou-

bleshooting a circuit is pretty much
the same whether it’s a PCB right out
of assembly or one that has failed at
some point in its life. However, it’s
often easier to troubleshoot a PCB
that’s been working (unless it has had
major damage like a reversed or over-
voltaged power supply.) With a failed
PCB at least you know you’re not look-
ing for opens or shorted traces. I gener-
ally begin with measuring power and
looking for operational oscillators.

NO COMM ON SBC

Let’s look at a failed single board

computer; it no longer communicates
with a host PC. After connecting my

A quick check of the bus lines

shows continual change, so some-
thing is running on the PCB. Let’s go
right to the UART output where the
processor should be sending data into
the level shifter. As you can see in
Photo 2, it looks like a single bit time
is 2 bits wide at this (now 50-µs time-
base) sampling rate, that is ~100 µs,
1/100 µs = 10 Kb (9600 bps).

Photo 2 shows 3 bytes being sent:

00100100, 000000001, and 00000000
(24h, 80h, 0h). A look at the output
side of the MAX232 level shifter
shows nada, nothing, zilch. A quick
change of this guy verifies that he is
indeed the culprit.

ONE WAY HERO

My fascination with robotics goes

back to Robby the Robot and Erector
sets. Almost anyone can find an
aspect of robotics that is of interest.
Investigate motors and movement,
sensors and feedback, batteries and
power, communication, and even AI.
Years ago, I bought a Hero Jr. Recently
a friend cleaned house and turned
over his Hero I to me. Now, my friend
must have fed Hero well, because
most functions were still in working
order. The biggest problem was Hero
I’s inability to move backward.

PC to the SBC and applying power. I
measure all the correct voltages, 5
and 12 V, on the PCB using DVM
mode. Then, I switch to Scope mode
to look at the oscillators. I measured
the 3.579- and 18.432-MHz crystals.

With 0 V centered on the LCD and

using the fastest sampling rate (50 ns),
you can see that one cycle is between
five and six samples (5.5 × 50 ns =
275 ns or 3.636 MHz). The ampli-
tude of the waveform is just about
full scale (5 V). The bottom trace is
the 18.432-MHz oscillator (see
Photo 1). If you study this trace, you
will notice two things, its amplitude
is considerably lower and its frequen-
cy is not six times that of the 3.579-
MHz trace. Could this be the prob-
lem? Is the oscillator running at some
harmonic frequency?

Think about the specifications of

the osziFOX and the picture will
become clear. The bandwidth is speci-
fied at a maximum of 5 MHz. You
would expect higher frequencies to be
attenuated partially if not completely.
The second problem is that the sam-
pling rate does not satisfy Nyquist’s
theorem (sampling must be at least 2×
the input bandwidth). Refer to Figure 2
to see how the resulting aliasing plays
tricks on sampled frequency.

Photo 3a

This time-referenced display is triggered externally by a transmit pulse. The display then shows the time between that trigger and the rising edge (produced by the

receiver).

b—

These two displays show differing ultrasonic times. The movable cursors help easily measure time differences.

c—

The guts of the osziFOX are all mounted on a

single PCB. The ASIC hides below the LCD.

Photo 2a—

The osziFOX shows TTL communication from the Z80 processor on this SBC.

b—

My Hero helps out with circuit debugging by holding the schematic steady with

its single manipulator.

c—

The Hero’s motor drive circuitry produces the proper PWM pulses.

a)

b)

c)

a)

b)

c)

background image

72

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

I grabbed my osziFOX and made the

Hero hold the schematics so I could
work with both hands (see Photo 2b).
One of the 12-V sealed lead-acid batter-
ies was used only for motor support. A
PWM controller applied power to Hero’s
feet, er wheels, through a DPDT relay. I
probed the motor control circuitry using
the 100-µs timebase to verify proper
PWM pulses (see Photo 2c).

Next, I looked at the drive transis-

tor for the DPDT relay. When reverse
is called it looks as though the relay
was being driven correctly, still Hero
would not back up. A close examina-
tion of the DPDT relay (by removing
the outer protective case) showed
severe contacting arcing such that the
contacts weren’t breaking when the
coil was energized!

I should have guessed high motor

currents would eventually ruin the
DIP relay. Looking through my junk
box, I found an R10-type DPDT with
contacts at least 2× the DIP relay. If I
mount a DIP socket on Hero I’s PCB, I
can use a DIP header to wire in the
new relay (and be able to remove it).

Following a few simple keystrokes

on the RF controller, the Hero I was
off. Obviously happy about being able
to back out of a sticky situation, Hero
replies, “Thank you master.” Wait, I
didn’t program that.

EXTERNAL TRIGGERING

When events that you wish to look

at are related to time, you must be
able to trigger a sweep on one signal
to make any sense out of the second.
A good circuit for showing this is the
ultrasonic sonar ranging device.

The ultrasonic pulse is a few cycles

burst of 40 kHz, which is triggered by
a falling edge on the input of the cir-
cuit. After the pulse burst is transmit-

PC UTILITY

Got your laptop handy? The

osziFOX comes with a DOS/WIN PC
program, which enhances display of
the sampled data. You get vertical and
horizontal cursors for measuring the
waveform’s frequency/period or ampli-
tude. In addition, you can freeze one
sample while looking at another. You
can check out an example in Photo 3b.
And don’t forget DVM mode.

All of the functions are controlled

via the probe. In other words, the
screen merely displays the data it
receives over the serial interface (seri-
al output only). You might want to
incorporate the output from the
osziFOX into your own program.
Note that Table 1 lists the protocol of
the reoccurring 137-byte serial output
at 19.2 kbps, with 7 data bits, 1 stop
bit, and no parity.

SPILL YOUR GUTS

I have my screwdriver handy. I real-

ly enjoy the mechanics of packaging
as much using the product itself.
Look at Photo 3c and Figure 3 to get
an idea of how the osziFOX is con-
structed. You won’t have to void your
warranty to see what’s inside because

ted, it travels at ~1

/ms (speed of

sound). If it strikes a surface, it can be
reflected back to the transducer. At
this point, the transducer is listening
for the pulse burst and if recognized,
the circuit outputs a high. The time
between the falling edge input trigger
and the rising edge output is propor-
tional to the distance the pulse burst
traveled (out and back).

By using the falling edge to trigger

the osziFOX, the output can be
viewed using the 0.5-ms timebase (see
Photo 3a). Here the transducer is
directed away from the camera and the
oszi’ shows the pulse burst returning
after about 36 samples (0.5 ms × 36 =
18 ms). That’s ~18

round trip or 9

(to

the opposite wall).

Amplifier

ADC

6 Bits

MUX

6

6

5

RAM

128 × 6

8

CPU

COP8

CPU Clock

5 MHz

4

8

Address

counter

RS-232

LCD

–5-V

Converter

Zero level

Selector

1 V

10 V

100 V

Timebase

Counter

3

Test pins

Bypass RAM

External PWR

Control logic

Comparator

Internal

Ser

ial out

pp

pp

pp

16 × 64

Dots

DISP Clock

1.25 MHz

DISP Data

Trigger input

Buffer

Control

S/R

External

Oscillator

5 MHz

1.25 MHz

Trigger

level

20 MHz

External

GND

AGND

+5 V

DGND

Start

Trigger test

Trigger out

Test pin

Write

Mode

Exter

nal input

8

Timebase

S/R

LCD

S/R

AC
DC

GND

Figure 3

A small microcontroller and analog ASIC make up the majority of the osziFOX’s circuitry. Notice that the

ASIC also handles the dot matrix LCD.

50-n

Sample

time

18.432 MHz

Figure 2

The sample time of the osziFOX sensor does not satisfy Nyquist’s theorem. When the input (18.432 Hz,

15 sampled every 50 ns), the result is not a true representation of the original.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

73

I already invaded the packaging. As
you can see, all of the components are
mounted on the top surface of a
multi-layer PCB. All push buttons
and switches are right angle, through
hole mounted along one edge.

The processor of choice here is

from National’s COP8SA family.
This low-cost, 8-bit OTP microcon-
troller features 4 KB of code space
and 128 bytes of RAM, low EMI, a
POR, and watchdog. At the end of
the probe (where the power comes in)
is a simple 5-V regulator. Between
these two (and hidden by the LCD) is
a ZMD ASIC where the signal condi-
tioning and A/D conversion work is
handled to achieve the 50-ns sam-
pling rate. The LCD is a custom
backlit dot matrix display with inte-
gral COB drivers.

TOOLBOX TREASURE

Have you ever bought one of those

cool widgets only to find you haven’t
used it since? I think you’ll find the
osziFOX to be a tool that you’ll use
again and again, especially when you
don’t have access to a real oscillo-
scope. Although you might be able to
troubleshoot your circuitry with an
LED, osziFOX will allow you to see
things that you could never see with
just a multimeter. Although the
osziFOX does have its limitations, I
found it a handy addition to my tool-
box, always willing to help rejuvenate
a dead circuit.

I

SOURCES

osziFOX sensor
Wittig Test Technology
Deutschland GmBH
+49 0 7031 714-760
Fax: 49 0 7031 714765
www.wittigtechnologies.com

COP8SA
National Semiconductor Corp.
(408) 721-5000
www.national.com

Jeff Bachiochi (pronounced BAH-key-
AH-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@circuitcel-
lar.com.

background image

ong-time readers

may have heard

this story but it’s

probably worth repeating.

Way back when I was a young upstart
micro marketeer, I well remember a
meeting in which a senior manager
proclaimed, “The 8-bit micro is
dead.” Of course, most of you will
find some irony in the fact that more
than a few (oh, let’s say 100 billion
plus or minus) of the little puppies
have been shipped since then.

My favorite part of the story is the

postscript. That same manager subse-
quently moved on and did well for
himself at a start-up IC company that
to this day sells a lot of 8-bit micros.
Live and learn.

Last time I looked at the market

stats, 8-bit micros are shipping on the
order of 10 million units a day. Where
are they all going? Just about every-
where there’s a moving electron.

Though it lacks the glamour of 32-

bit-and-beyond desktop chips, I say the
8-bit micro is the true hero of the
microelectronics revolution. Indeed,
with the current move to the ’Net and
server-based processing, it seems like
the desktop world is heading back to
the old days. Oh darn, the mainframe
(i.e. ‘Net) is down, now what do I do?

74

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

I think most folks realize that, far

from being dead, the 8-bit micro is
not only healthy, but will continue to
shuffle this mortal coil at least as long
as you or I do. That’s not to say that
16- and 32-bit parts aren’t increasing
in popularity, just that the good old
8-bit chips are still young at heart.

That said, it doesn’t mean the 8-bit

market isn’t maturing. We’re at the
young adult stage where there’s still
lot’s of energy and activity, but per-
haps have passed the teen years of
frantic growth spurts. You know,
when all of a sudden the little tyke
you bounced on your knee wants to
borrow the car.

That means the heyday when any-

one and everyone could get into the
business with little more than a chip
and an order pad are gone forever.
There is evidence on the supply side
in bouts of fire-sale price wars, stress
on the bottom lines of marginal per-
formers, and hints of possible consoli-
dation to come.

In fact, every time I write about a

new 8-bit micro, as I did last month, I
wonder if it will be the last. Surely,
the newest chip will fill the tiny
niche that remains unserved by the
dozens of well-entrenched suppliers
and hundreds of popular parts already
on the market, right?

Wrong. Surprising even myself, I

stumbled across yet another 8-bit chip
that strikes my fancy, the XE88LC05,
a.k.a., the Sensing Machine, from
Xemics (see Figure 1).

The name reflects Xemics bull’s eye

targeting of the latest and greatest
trend to incorporate mixed-signal fea-
tures, the last links in the so-called
signal chain that connects computers
and the real world. What was once a
finicky lash-up of parts—op-amps,
voltage references, ADCs, micro/
DSP—gets rolled into a unified real-
world-in, ones-and-zeros-out chip.

The niche has attracted the interest

of major players, but is also a spawn-
ing ground for new entrants like
Cygnal (“Cygnal Processor,” Circuit
Cellar Online

September 2000),

Cypress Microsystems (“SoC Hop,”
Circuit Cella

r 128), and now Xemics.

I also note with interest various cor-
porate machinations, including

SILICON
UPDATE

Tom Cantrell

The Last Micro?

l

Back when
rumors of
doom for
8-bit micros
were ram-

pant, Tom held his
tongue and waited to
see what would really
happen. After looking
at an offering from
Xemics, he noticed
enough new perks to
defy the rumors.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

75

bridge circuit found under the hood of
typical sensors (for example, pressure,
strain, and acceleration).

However, if you have the luxury of

a signal-conditioned sensor (i.e., high-
voltage, low-noise output), the zoom-
ing ADC can work single-ended, as
well. In that case, there are seven
inputs (A1 through A7) measured
against a common reference (A0).

Back to Differential mode, a mux

control bit allows crossing the inputs.
For example, A0 could be considered
the positive input and A1 the nega-
tive, but flipping the mux sign bit
reverses the connection.

Why is that feature useful? Well,

the whole idea of differential inputs is
to determine the relative difference,
which should not change if you look
at it from one side or the other. But
it might appear different, specifically
if your point of view isn’t right in
the center, a situation that arises
because of offset in the ADC. You
can cancel the converter offset by
performing two conversions, one
with each crossover setting, and aver-
aging the result.

After the inputs wind their way

past the mux, they enter a pipeline of
three programmable gain amps with

Microchips’s takeover of mixed-signal
up-and-comer Telcom Semiconductor
and Maxim’s acquisition of speedy
MCU know-how via their purchase of
Dallas Semiconductor.

Yes, as you’ll see, the ’LC05 offers a

polished mixed-signal resume. But
that alone wouldn’t be enough to
ensure success in the rough-and-tum-
ble 8-bit market. The fact is the
XE8000 lineup (see Figure 2) has a lot
more going for it than is apparent at
first glance. Read on and I think
you’ll see what I mean.

ROOM TO ZOOM

The sensing machine premise starts

with what Xemics calls the zooming
ADC. It’s an apt terminology because
the combination of high-resolution
ADC fronted by programmable gain
and offset cancellation allows you to
zoom in on signals at the low end of
the scale that would otherwise get
lost in the noise.

Figure 3 illustrates the details for

you. Starting at the pins, there are
four multiplexed reference inputs and
eight multiplexed signal inputs. The
first thing to note is that the signal
chain maintains differential capability
from beginning to end. That’s pretty
much a must for canceling common
mode interference that would other-
wise swamp the meager (few to tens
of millivolts) output of the resistive

16-bit Buffered DAC

8-bit Buffered DAC

16 + 6-bit Zooming ADC

MTP ROM

RISC CPU

RAM

VLD

POR

IRQ

PA

Cr

ystal

P

rescaler

W

a

tchdog

C

ount

e

rs

UA

R

T

PB

PC

Zoom

×

+

RC

Figure 1—

Thanks to a fancy analog subsystem and some other neat stuff, the Xemics XE88LC05 manages to

stand out in the 8-bit MCU crowd.

XE88LC08

4

2.4 to 5.5

+

+

4

24

LQFP44, PLL-44L*

11

512

8

+

+

+

UA

4 CC

2

XE88LC04*

8

22

8

+

+

4

+

+

+

UAS

4 CC

2

BGA

XE88LC05

LQFP64

XE88LC06

8

+

+

4

12 to 24

SO20, SO24,

SO28, LQFP32

120 seg

24

UA

22

22

8

1024

512

8

8

+

+

4

+

+

+

+

+

+

UA

4 CC

2

4 CC

2

4

+

16+

XE88LC01

8

22

512

2.4 to 5.5

8

+

+

2

24

+

+

+

UA

4 CC

2

+

16+

LQFP44, PLL-44L*

XE88LC02*

1.2

˚

/2.4 to 5.5

LQFP80, LQFP100

XE88LC03

8

2.4 to 5.5

+

+

2

12 to 24

LQFP32

120 seg

32 to 60

UAS

22

22

8

1024

512

8

8

+

+

4

+

+

+

+

+

+

UA

4 CC

2

4 CC

2

4

+

16+

1.2

˚

/2.4 to 5.5

2.4 to 5.5

1.2

˚

/2.4 to 5.5

512

32 to 60

+

4

12

S

upply v

oltage

Prog

ram (kB)

Prog

ram (kW)

Data (B)

LP RAM (B)

RC prog

rammab

le

Cr

ystal 32 kHz

Max speed (MIPS)

PIO

V

oltage le

v

el detection

W

atchdog

Prescaler

Ser

ial interf

ace

Counters timers

PWN D

A

C

Dual-b

uff

ered D

A

C

LP compar

ators

Zooming ADC

ADC resolution

LCD dr

iv

ers

Packages, all also

available in die

Memory

Peripherals

+ Available * Future products

˚

For ROM version only

Figure 2—

Having developed a library of functions, including the CoolRISC 816 core, for ASICs, Xemics can quickly cut and paste different standard chips.

background image

76

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

signal offset cancellation at each
stage. The amps and offset sections
feature different settings that allow a
mix of coarse- and fine-tuning.
Maximum possible gain is a whop-
ping 1000 (i.e., 10x at each amp). At
the same time, if an amp isn’t needed
it can be bypassed rather than simply
running through it (and adding noise
along the way) with a gain of one.

When the signal of interest is scaled

and offset appropriately, it’s passed to
the ADC. As a sigma-delta converter,
each conversion is comprised of one to
eight elementary conversions, which
each consist of eight to 1024-plus sam-
ples. Thus, designers choose the trade-
off between conversion time and reso-
lution (see Table 1), as well as either
continuous (automatic) or on-demand
(initiated by software) conversion modes.

DACS NOT FOR ALL FOLKS

Completing the real-world connec-

tion typically requires a DAC as well
as an ADC. In addition to the com-

mon technique of using a timer
and/or software to implement a PWM
DAC, the ’05 includes a pair of dedi-
cated hardware DACs.

As the name implies, the bias

DAC is ideally adapted to bias bridge
sensors. Reflecting that purpose, res-
olution is only moderate (just 8 bits)
and speed is slow, in fact, downright
pokey (100-ms step response).
However, balancing things, the bias
DAC does offer high-drive (up to 10 mA)
and includes external connections
for resistors to establish an output
reference that’s independent of the
chip power supply.

By contrast, the signal DAC is

designed for higher resolution (up to
16 bits) and speed (up to 64 kHz),
though once again there’s a trade-off
between the two specs.

Because the signal DAC references

the chip power supply (i.e., ratiomet-
ric), the datasheet correctly notes that
the output will be only as clean as the
chip power supply. [1] Indeed, it cau-

tions that obtaining the
most precise performance
requires considering power
supply noise induced by
high-speed switching of
heavily loaded output ports.

Notice that the outputs of

the DACs are routed off-
chip, as are the differential
inputs of the on-chip ampli-
fiers next to them. This is a
safety valve that allows you
to graft your own external
signal conditioning circuits
into the chain. In addition,

it’s easy to wire an arrange-
ment that delivers either

voltage or current output.

LIGHT PIPE

OK, the ’LC05 has its analog ducks

in order, but what about the digital
side? I must say I was intrigued by
what I found. It’s not so much a mat-
ter of any particular big-ticket item
that stands out but rather the unique
combination of many clever features
that make this part interesting.

For instance, the premise of pipe-

lining isn’t new, even for 8-bit chips.
Traditionally, the scheme goes hand
in hand with the charge toward the
Holy Grail of higher clock rates.
That may be well and good in the
gigahertz-or-bust computing world,
but embedded designers know the
last thing they need is a hot and
noisy gas hog under the hood. It’s
kind of like putting a drag racer
engine in a golf cart.

I’ve made a short story long. The

pipelined XE88 tops out at a whop-
ping 2 MHz, but don’t be concerned,

there’s a 4-MHz
version in the
works! Don’t get
excited and jump
to the conclusion
that the XE88 is a
stick in the mud
just because it
doesn’t have a
double- or triple-
digit clock rate.

Thanks to pipe-

lining, throughput
is one instruction
per clock. Thus,

Resolution

Conditions

Input frequency

Conversion time

Output frequency

6

Oversampling per conversion = 8

512 kHz

40 µs

25.0 kHz

1 conversion (no offset rejection)

8

Oversampling per conversion = 16

512 kHz

50 µs

20.0 kHz

1 conversion (no offset rejection)

12

Oversampling per conversion = 64

512 kHz

150 µs

6.7 kHz

1 conversion (no offset rejection)

13

Oversampling per conversion = 64

512 kHz

275 µs

3.6 kHz

2 conversions (offset rejection)

16

Oversampling per conversion = 256

512 kHz

500 µs

2.0 kHz

1 conversion (no offset rejection)

16

Oversampling per conversion = 256

512 kHz

1 ms

1.0 kHz

2 conversions (offset rejection)

16

Oversampling per conversion = 1024

512 kHz

16.5 ms

60.0 Hz

8 conversions (offset rejection)

Table 1—

As is often the case with ADCs, a look under the hood reveals the expected speed versus resolution trade-off.

Symbol

Description

Minimum

Typical

Max

Unit

Comments

Fst

Frequency at startup

50.00

80.0

110.0

kHz

At 27°C

Range

Range selection

1.00

10.0

Multiplies Fst

mult[3:0]

Coarse tuning range

1.00

16.0

4 bits, multiplies Fst × range

tune[5:0]

Fine-tuning range

0.65

1.5

6 bits, multiplies Fst × range × mult

Fine-tuning step

1.4

2.0

%

Tst

Startup time

30.0

50.0

ms

Bias current is off (RC off)

Ost

Overshoot at startup

50.0

%

Bias current is off (RC off)

Twu

Wakeup time

3.0

5.0

ms

Bias current is on (RC ready)

Owu

Overshoot at wakeup

50.0

%

Bias current is on (RC ready)

jit

Jitter rms

2.0

0/00

Tdf

Temperature drift

0.1

%/°C

Table 2—

Although the RC timebase isn’t absolutely accurate, it’s adjustable. The trick is to use an external watch crystal (or some other accu-

rate timing source) to fine-tune the RC frequency dynamically.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

77

it’s an honest 2- (soon to be 4-) MIPS
machine that, although it won’t win
the megahertz wars, squarely hits the
decent performance spot for meat-
and-potato MCUs.

Traditionally pipelining brings

along baroque architectural trinkets
such as hazards, stalls, and delay
slots. Heaven forbid you should have
to write, much less debug optimized
machine code. Sure, you know the
gory details are supposed to get hid-
den behind the veneer of the compiler
and debugger, but it’s difficult to
maintain the illusion.

Again, Xemics follows a different

drummer. Every, and I do mean every,
instruction executes in a single clock.
That includes multiply and the condi-
tional branches. Thanks to forward-
ing logic, there are no load delays. In
other words, an instruction that uses
a register can immediately follow one
that loads it.

Indeed, there are merely a handful

of pipeline hazards, and they are
trivial. For example, the instruction
after a software interrupt request is

executed (which provides a conven-
ient way to pass an argument to the
handler) and a NOP is required fol-
lowing an instruction that sets the
Sleep bit. That isn’t a big deal, and
certainly does not contribute to the
code bloat found on RISCs that must
insert one or two delay slots after
every load and branch.

Ironically, although a true one-CPI

machine, the ’LC05 eschews conven-
tional RISC wisdom when it comes to
the instruction set. It’s a hybrid of
RISC and CISC that allows both the
compiler and an assembly language
programmer to have it their way.

For example, many instructions

include the three register operand for-
mat typically found on a pure load/
store RISC machine (reg1 = reg2 OP
reg3). But at the same time, versions
are available that access memory
directly (reg1 = reg2 OP memory).

The register file also has a split per-

sonality. Let me explain. There are
16 general-purpose 8-bit registers that
also have special functions such as
data or program memory index. One

of the registers even works as an
accumulator that is updated every
cycle with the ALU output.

CLOCKED AND LOCKED

Clock options include a built-in

RC, external 32.768-kHz watch crys-
tal, or external clock input. The clock
source is software-selectable. Unused
clocks can be powered down for low-
power operation.

At reset, the on-chip RC is the

default source and stabilizes quickly—
within 50 µs. If the crystal oscillator
is used, software can switch over after
a 32,768-cycle start-up delay (1 s).

As is usually the case, the RC isn’t

especially accurate or stable. Instead
of trying to nail it down, the designers
built in a wide range of programma-
bility comprised of coarse (greater or
less than 1 MHz), medium (multiply
by factor of one to 16), and fine (mul-
tiply by a factor of 0.6 to 1.5) tuning.
Table 2 shows the whole picture.

You can twist the dials all you

want, just remember that the RC
timebase may be off by a factor of two

background image

In Standby mode, which is invoked

by a halt instruction, the CPU stops
but any (enabled) clock sources and
peripherals continue operating. And,
as usual, a reset or interrupt can
wake up the chip.

As an aside, the Xemics parts fea-

ture extensive interrupt capability
compared to what’s typically found on
such tiny chips. These include four
interrupt sources from the internal
timer/counters, two (128 and 1 Hz)
from the watch crystal prescaler, one
from the on-chip power monitor, and
one from the ADC.

Also, any or all of the eight port

pins (PA0 through 7) can be config-
ured as interrupt sources. Besides the
programmable pull-ups and polarity
found on most chips, Xemics adds
some interesting tweaks. For
instance, whether used for I/O or as
interrupts, the port pins can take
advantage of built-in debouncing logic
for glitch suppression.

Even more clever, besides just using

the port lines as interrupts directly,
you can choose to specify that an
interrupt be requested by the appear-
ance of a particular bit pattern on the
port as a whole. Yes, obviously it may
not be something every application
needs, but it clearly would eliminate
a measure of software or hardware for
those that do.

My only complaint is that the

interrupt options seem to be less
than well served by a four-level stack.
Yes, there are hooks to arbitrarily
extend the stack into general-purpose
RAM with software, but I suspect
this is a case in which a little more
hardware would go a long way.
According to the documents, the
architecture can accommodate up to

(e.g., 50 kHz minimum, 80 kHz typi-
cal, 110 kHz maximum). Being off by
a factor of two can be problematic for
applications that require a measure of
real time, not to mention enough
accuracy, for example, to run the
UART at standard data rates.

I came across an application note

on the Xemics web site that offers a
clever solution relying on the external
watch crystal. [2] The solution is like
a software phase lock loop scheme
that uses timers to evaluate the RC
frequency relative to the crystal and
adjusts the RC tuning to converge on
the desired frequency.

FIGHT THE POWER

Whether it’s because of a growing

green consciousness, the desire for
fewer batteries (size, weight, and cost
concerns) and longer battery life, or
simply datasheet one-upsmanship,
ultralow power is all the rage. That’s
fortuitous for Xemics, a company that
got its start making watch chips.
Attention to detail is evident in the
myriad of power-management options
and controls. The design features
gated clocking that shuts off power
dynamically to unused circuits as
well as overt programmer control.

There’s the typical triad of Active,

Standby, and Sleep modes included,
but with plenty of embellishments.
For instance, the first eight locations
in on-chip RAM as well as the afore-
mentioned accumulator are specifical-
ly designed as the lowest of low-
power places to stash things. My
experience is that many simple con-
trol apps will be able to take advan-
tage of these locations for storing the
few most persistent and frequently
used snippets of data.

78

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

AC_R(0)
AC_R(1)
AC_R(2)
AC_R(3)

AC_A(0)
AC_A(1)
AC_A(2)
AC_A(3)
AC_A(4)
AC_A(5)
AC_A(6)
AC_A(7)

Input selection

Gain 1

Gain 2

Offset 2

Gain 3

Offset 3

Mode Output

code

ADC

Reference selection

TERMS:

NO MINIMUM ORDER

. Shipping and handling for the

48 continental U.S.A. $6.00 per order. All others including AK,
HI, PR or Canada must pay full shipping. All orders delivered
in CALIFORNIA must include local state sales tax. Quantities

Limited. NO COD. Prices subject

to change without notice.

MAIL ORDERS TO:

ALL ELECTRONICS

CORPORATION

P.O. Box 567

Van Nuys, CA 91408

FAX (818)781-2653

e-mail allcorp@allcorp.com

CALL, WRITE

FAX or E-MAIL

for our

FREE

96

Page

CATALOG

Outside the U.S.A.

send $3.00 postage.

24 Vdc, 80 mm Fan

$

3

00

each

CHARGE ORDERS to Visa, Mastercard,

American Express or Discover

1-800-826-5432

ORDER TOLL FREE

SHOP OUR ONLINE STORE

www.allelectronics.com

Panaflo® DC Brushless
Model FBA08A24M
3.15” square x 1.”
24 Vdc @ 0.1 Amp.
(14-27.6 Vdc) 32 CFM.
7 blade impeller.
11” pigtail leads. UL, CSA.

CAT # CF-118

10 for $2.75

case of 100 for $2.00 each

Panasonic # EVANMKP08B14
10K linear taper power fader.
100mm travel. 5 Vdc driving
motor. Operates on
2 Vdc to 5 Vdc.
0.2 seconds
travel time
at 5 Vdc.

Motorized 10K Slide Pot

each

Overall

dimensions:

7.32” long x 0.6” wide.

Motor, 0.95” dia. x 0.72.”

Threaded mounting holes on 5.27” centers.

CAT # MSP-10K

10 for $6.75 each

100 for $6.00 each

$

7

00

Globe Motors
# 409A582
Precision gear-
head motor
equipped with an
electric brake and
a tach or positioning sensor. Brake must be
energized to allow motor to rotate. Brake
can be easily disconnected if not required.
Motor rated at 12 Vdc, brake at 24 Vdc. No
load rating: 25 RPM @ 12 Vdc @ 130 mA.
Overall size, excluding shaft, 5.15” long x
1.52” dia. 0.25” dia. x 0.9” long shaft with a
press-fit gear. Threaded mounting holes
on gearhead face.

CAT# DCM-177

25 RPM Gearhead Motor

with Brake

$

20

95

each

Figure 3—

With up to 16-

bit resolution and nearly 6-
bits (1000x) gain, the
Zooming ADC can zoom
in on the low-level (milli-
volts) outputs delivered
by sensors.

background image

ULTRA-LOW-POWER FLASH MCU

DESIGN CONTEST

ULTRA-LOW-POWER FLASH MCU

DESIGN CONTEST

ULTRA-LOW-POWER FLASH MCU

DESIGN CONTEST

Got a cool gadget or practical application that
you've designed and want the world to know
about? Never mind late-night infomercials; the
Texas Instruments MSP430 Design Contest is
your opportunity to showcase your design skills
and win loads of great prizes, including a grand
prize of $5,000! Enter your project containing
an MSP430 ultra-low-power Flash MCU by
December 17, 2001, and show us how your design
(even if it's not a laser-wielding robot) could take
the world by storm.

For complete contest rules, prizes and entry form, visit

www.circuitcellar.com/msp430

background image

80

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

eight levels, which I suggest imple-
menting on every part. [1, 2]

The tight squeeze is a small price to

pay if power consumption is your bot-
tom line. Even running at 1 MIPs
with peripherals up and running, the
draw from the wide 2.4- to 5.5-V sup-
ply (there’s an on-chip regulator) is
barely more than 1 mA. Shut off the
peripherals and RC (Standby mode)
and you can still run off the watch
crystal with a mere 10 µA. Put the
thing into deep sleep and you’re look-
ing at a measly 1 µA to keep the
RAM and registers alive!

A GNU DAY

These days it takes more than a

good chip to keep up with the pack.
Fortunately, I’m pleased to report
Xemics appears to
have a level of tools
and support surpris-
ingly competitive for
a relatively small
newcomer. I had a
chance to play around
with both the
CoolRIDE software
and ProStart starter
kit (see Photo 1).

Overlooked in all of

the open-source
hoopla on the desktop
is the fact the GNU
tool chain is making
it’s mark in the
embedded world, as
well. Notably, it pro-
vides a critical boost
for small companies

and niche architectures that would
otherwise have trouble cobbling
together the tools they need to get off
the launching pad.

The CoolRIDE incarnation of the

GNU tools certainly has a profession-
al air. Not that there weren’t a few
gotchas. For instance, I had a problem
with installation, which required a
call to Xemics and manually fiddling
with my

AUTOEXEC.BAT file. Hopefully

by the time you read this article such
glitches will be history.

Nevertheless, after I was over the

hump, I found the software to be
modern and professional in appear-
ance and capabilities (see Photo 2). All
the more true considering the price;
CoolRIDE is free for the taking on the
company’s web site.

Photo 2—

CoolRIDE combines the robust GNU tool chain (including C compil-

er, simulator, and debugger) with a powerful and easy-to-use GUI. It’s a com-
bination that gives Xemics a chance to break into the mainstream market.

Photo 1—

The ProStart kit combines a generic XE8000 family programmer board and device-specific (in this case

the XE88LC05) evaluation board.

A monthly magazine for the
electronics enthusiast, amateur
or professional.

Four fully

described and illustrated
projects in each issue, includ-
ing full p.c.b. layout and wiring
diagrams.

Plus

*

Ingenuity Unlimited – read-
ers’ circuit ideas

*

New Technology Update –
keeping you informed of
advances in technology

*

Circuit Surgery – readers’
circuit problems answered.

*

REGULAR SERIES AND

FEATURES describing how
electronics monitors and
controls the world around us.

FREE SAMPLE ISSUE

Download a sample issue free
of charge from our Online web
site or buy a one year Online
subscription for just $9.99 (12
issues).

www.epemag.com

You can also order printed
issue subscriptions or buy a
wide range of electronics
books and CD-ROMs.

If your interest is electronics
check out

Everyday Practical

Electronics NOW!

Everyday Practical

ELECTRONICS

background image
background image

82

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

The ProStart kit is decent as well,

however, the $300 price seems a little
high for an entry-level evaluation and
programming board. But, I have to
conclude it’s fair considering the two-
board approach (a generic programming
board and device-specific adapter
board), not to mention the whizzy ZIF
programming socket for the 64-pin
QFP surface-mount package. Note
that a CoolRIDE CD is included with
ProStart, so if you’re ordering the kit
you can skip the big download.

The only real complaint I have

with ProStart isn’t because of a
problem with the kit, but rather
because it’s a byproduct of the chip’s
flash memory programming scheme.
Because of the high voltage required
and the hijacking of pins for serial
programming, the part can only mar-
ginally be considered in-system pro-
grammable. A serious design-in would
probably best be served coughing up
the bucks for the real emulator.

Kudos to Xemics for the quality

and amount of documentation I was
able to grab off the company web site.

CIRCUIT CELLAR

Test Y

Your E

EQ

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

8

more EQ

questions

each month in

Circuit Cellar Online

Problem 1

—What is the significance of

the “overflow” and the “direction” flags in

the 8086 microprocessor architecture?

Contributed by Naveen PN

Problem 2

—Everyone knows that the

Nyquist criterion states that you need to

sample a signal with bandwidth W at a

sample rate of 2 × W in order to be able

reconstruct the signal without aliasing.

Does this work even if the samples

aren’t equally spaced in time?

Contributed by Naveen PN

Problem 3

—Given that real systems must

contend with noise of various types, what is
one of the drawbacks of using nonuniform
sampling?

Contributed by Naveen PN

Problem 4

—A regular expression cannot

be used to handle the general problem of
nested delimiter matching. Why not?

Contributed by David Tweed

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.

SOURCE

XE88LC05 MCU, CoolRIDE Flyer,

ProStart

Xemics SA
(888) 393-6427
+41 32 720 51 70
Fax: +41 32 720 57 70
www.xemics.com

REFERENCES

[1] Xemics SA, “XE88LC05: 16 and

10 bit Data Acquisition Ultra
Low-Power Microcontroller,”
D0106-40.

[2] ———, “Digital Frequency

Locked Loop,” AN8000.09.

All too often it seems the chip comes
first, the tools second, and the docu-
mentation last. However, because
they have been using bits and pieces
of the architecture as the underpin-
nings for various ASICs over the
years, Xemics didn’t have to start
from scratch. Hence, they’ve accumu-
lated quite a bit of know-how.

There’s one final bit of irony that I

can’t let go unnoticed. Look closely at
the shot of the ProStart board (see
Photo 1) and you may notice a famil-
iar face. Yes, that’s a PIC alright. I
imagine this odd coupling will inspire
lively discussion around more than a
few watercoolers.

PROMISES, PROMISES

I’ve got to get these 8-bit chips off

my shoulder. It’s true I think the
Xemics parts are nifty, and able to
stake out a unique claim in a market
filled with plenty of great chips. But if
this keeps up, I’m going to get type-
cast. Yeah, Tom Cantrell, “The 8-bit
Guy,” a goofy ones-and-zeros version
of Jim Carey’s “The Cable Guy.”

So this is it, I’m going cold turkey.

No more 8-bit chips! At least not
anytime soon. Well, probably not
next month anyway.

Trust me.

I

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

83

51 East Campbell Ave

Campbell, CA 95008

....by using real-time emulators.

888-886-6428

Support for:

HC12, HC11
8051
C166
C500
ST10
Super10
Philips XA
68300 family
Ubicom

Scenix

"Nohau emulators show you what is really going
on inside your embedded system. Turn yourself
into a debugging expert and find bugs

fast."

How to:

Cut Your De

velopment Time

sales@nohau.com

www.nohau.com

For more “

How to

” info see www.nohau.com/howto

408-866-1820

Insert-ready sub-mini SBCs (small as 47x55 mm.) supporting the
Philips

8xC591

8xC591

8xC591

8xC591

8xC591, 89C51Rx2

89C51Rx2

89C51Rx2

89C51Rx2

89C51Rx2, XACx

XACx

XACx

XACx

XACx, XAGx

XAGx

XAGx

XAGx

XAGx

, Infineon

C167Cx

C167Cx

C167Cx

C167Cx

C167Cx

,

Motorola

MPC555

MPC555

MPC555

MPC555

MPC555

& ST Microelectronic

ST10F168

ST10F168

ST10F168

ST10F168

ST10F168

Low EMI design

Low EMI design

Low EMI design

Low EMI design

Low EMI design

achieved via GND circuitry, 6 to 8 layer PCB, by-

pass 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, I

2

C & 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

Rapid Development Kits

Rapid Development Kits

Rapid Development Kits

Rapid Development Kits

including Development Board,

AC adapter, serial cable and SPECTRUM CD with eval software tools
(Keil, TASKING), FlashTools, electronic documentation and demos

www.phytec.com

phyCORE Modules:

phyCORE Modules:

phyCORE Modules:

phyCORE Modules:

phyCORE Modules:
NEW GENERA

NEW GENERA

NEW GENERA

NEW GENERA

NEW GENERATION

TION

TION

TION

TION

SINGLE BOARD COMPUTERS

SINGLE BOARD COMPUTERS

SINGLE BOARD COMPUTERS

SINGLE BOARD COMPUTERS

SINGLE BOARD COMPUTERS

PHYTEC America LLC

PHYTEC America LLC

PHYTEC America LLC

PHYTEC America LLC

PHYTEC America LLC ■ 255 Ericksen Avenue ■ Bainbridge Island, WA ■ USA 98110

(800) 278-9913

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 submis-

sion 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!

background image

84

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Real Time Control and reading 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 free source code,
Real Time Logging

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

Internal FIFO for linear, cubic or Spline Interpolation.

24 digital I/O,2 SPI, 11 analog channels on-board.

32 bit DLL

Windows 95,98,00,NT;

DOS, Linux,

FREE SOURCE CODE in C++ and VBASIC

ST400NT

MOTOR CONTROLLER

SPORT232

DATA ACQUISITION & CONTROL

RMV Electronics Inc.

300-3665 Kingsway
Vancouver, BC, Canada V5R 5W2
Tel: (604) 299-5173 Fax: (604) 299-5174
Web:

www.rmv.com

Less than US$100/axis!

M2 ENGINE

Two cahnnels 10 bit
ADC, Servos, SPI,24
Digitals IO.

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

85

-.



PLFURV\VWHPV,QF

Visit our new site www.jkmicro.com

Call 530-297-6073 Fax 530-297-6074

7RROVWR



0RYH'DWD

Ether6

6 Serial Ports
Ethernet
33Kbaud
Modem-Option
Starts at $369

µFlashTCP-EP

2 Serial Ports
Ethernet
Enclosure
Starts at $229

Software

DOS On-Board

Borland C/C++

eRTOS for Multitasking

TCP/IP Source Code

LogicFlex

2 Serial Ports

Clock/Calendar

46 Digital I/O’s

Ethernet

Starts at $189

µFlashTCP

2 Serial Ports

3.75” x 2.50”

Ethernet

Starts at $149

background image

86

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Learn PICmicro

®

Assembly

PIC and PICmicro are registered trademarks of Michrochip
Technology Inc. in the USA and other countries.

Need to quickly get up to speed with the
PICmicro

family? 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 PIC
microcontrol-
lers. Get
started with
complete
systems
from $349.

172 Harvard Road
Waterloo, ON, N2J 3V3
Canada
519.886.4462
519.886.4253(fax)

www.siriusmicro.com

PMDS 2 Professional Pack Features:

• PIC16F84, PIC16F876, programmer, cables, power supplies
• 2X16 LCD, keypad, analog pots, analog reference adjust,
buffered port probe, RS-232 port, 2 4k serial EEPROMs,
2 servo outputs, IR receiver, & in-circuit programming port

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

87

background image

88

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

Made in USA

◗ PCI 48-channel Digital I/O adapter
◗ Versatile interrupt capability
◗ 50-pin connections to industry-standard relay racks
◗ Simple installation with included software

Discover why industry leaders rely on Serial I/O and
Digital I/O products from Sealevel Systems. Call today
or visit our website for a free catalog or CD.

PCI DIGITAL I/O

864.843.4343

© 2001 Sealevel Systems Incorporated

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!

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

89

RS232/RS422 Converter

• Full duplex
• 422 or 485 4 wire
• Short haul modem

up to 5000 feet

• Supports up to 40

RS422 devices

$84.00

quantity 1.

OEM discounts.

Connecticut microComputer, Inc.

PO BOX 186, Brookfield,CT 06804
(203)740-9890 Fax:(203)775-4595

code CC60

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.

www.2cmc.com

New

Port
powered

background image

90

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

91

Email: sales@picofab.net

background image

92

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

background image

www.circuitcellar.com

CIRCUIT CELLAR

®

Issue 136 November 2001

93

48 Sword St
Auburn MA, 01501
Fax: 508-798-4782
800-587-5069

48 Sword St
Auburn MA, 01501
Fax: 508-798-4782
800-587-5069

48 Sword St
Auburn MA, 01501
Fax: 508-798-4782
800-587-5069

background image

94

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

INDEX

89

A Better Mousetrap!

23

ADAC

85

Abacom Technologies

92

Abia Technology

86

Ability Systems Corp.

86

ActiveWire, Inc.

90

Advanced Embedded Systems, Inc.

36,38

Advanced Transdata Corp.

78

All Electronics Corp.

85

Amazon Electronics

73

American Raisonance Corp.

9

Amulet Technologies

84

Andromeda Research

92

AP Circuits

6

ATOP Technologies

85

Bagotronix, Inc.

53

Beige Bag Software

86

CCS-Custom Computer Services

91

Cedar Technologies, Inc.

26

Ceibo

92

Conitec

37,89

Connecticut mircoComputer Inc.

85

Copeland Electronics Inc.

86

Cyberpak Co.

49

Cygnal Integrated Products

C4

Dataman Programmers, Inc.

93

Dataprobe Inc.

86

DataRescue

83

Decade Engineering

The Advertiser’s Index with links to their web sites is located at www.circuitceller.com under the current issue.

Page

79

Design MSP430 Contest

87 Designtech Engineering

7

Dreamtech Computers

1

Earth Computer Technologies

32

ECD (Electronic Controls Design)

84

EE Tools

(Electronic Engineering Tools)

37

EMAC, Inc.

33

Embedsys.com

32

Engineering Express

80

Everyday Practical Electronics

84

FDI-Future Designs, Inc.

53

General Device Instruments

87

Gigahertz Electronics

86

HVW Technologies Inc.

84

Hagstrom Electronics

42

HI-TECH Software,LLC

86

ICE Technology

89

IMAGEcraft

89,91

Intec Automation, Inc.

63

Interactive Image Technologies Ltd.

88

Intronics, Inc.

65,85

JK microsystems

30

JR Kerr Automation & Engineering

15

Jameco

87

LabMetric, Inc.

89

Laipac Technology, Inc.

53

Lakeveiw Research

93

Lemos International

2

Link Instruments

88

Lynxmotion, Inc.

91

MCC (Micro Computer Control)

83

MetaLink Corporation

89

MJS Consulting

17

Microchip

88

Micro Digital Inc

91

microEngineering Labs, Inc.

65

Microcross, Inc.

24,81

Micromint Inc.

30

Midwest Micro-Tek

91

Mosaic Industries, Inc.

64,77

MVS

92

Mylydia Inc.

87

Narly Software

39

NetBurner

95

Netmedia, Inc.

83

Nohau Corp.

90

OKW Electronics Inc.

92

Ontrak Control Systems

C2

Parallax, Inc.

90

Peter H. Anderson

83

Phytec America LLC

91

Phyton, Inc.

91

Picofab Inc.

93

Prairie Digital Inc.

90

Pulsar Inc.

84

R.E.Smith

90

RLC Enterprises, Inc.

84

RMV Electronics Inc.

Multimedia Streaming: The MPEG-4 Approach

SatPoint: Second Place Winner in the Design2K Contest

Riding the Light: An Integrated Bike Light

Why Not GNU?

Design Logic 2001 Contest Winners

I Above the Ground Plane

: UHF Wire Sculpture

I From the Bench

: Is Anyone Really Here?—Desktop Status from SitePlayer

I Silicon Update

: Ready, Steady, Go

I Applied PCs:

Digging Into PICDEM

Page

Page

Page

Graphics & Video

PREVIEW

137

ADVERTISER’S

31

Rabbit Semiconductor

25

Radiotronix, Inc.

42

Remote Processing

85

SMTH Circuits

70

Saelig Company

5

Scott Edwards Electronics Inc.

88

Sealevel Systems Inc.

93

Senix Corp.

86

Sensory, Inc.

83

Signum Systems

86

Sirius MicroSystems

89

SmartHome.com

30

Softools

16

Solutions Cubed

92

Spectrum Engineering

83

Square 1 Electronics

88

TAL Technologies

6,66

Technologic Systems

87

Technological Arts

C3

Tech Tools

88

Tern Inc.

41

Texas Instruments

87

Triangle Research International Inc.

77

Trilogy Design

88

Vantec

93

Vetra Systems Corp.

92

Weeder Technologies

47

Wittig Technologies

84

Xilor Inc.

background image
background image

f it weren’t for the fact that I get to meet and talk to

Circuit Cellar readers, I’d hate going to trade shows. The

practice isn’t new but the procedures have surely changed over the years. Back in the early days, I used to sit on

a tall stool at the

BYTE booth and exchange ideas and opinions with a crowd of enthusiastic supporters. Of course,

the definition of enthusiasm was often broadened to incorporate field service. Frequently there would be readers who

arrived at the show booth with a shopping bag full of electronic components. The more resourceful among them would even drag along test
equipment and a soldering iron. Essentially, the logic was that they had read my article, built the project, and just needed a “little” help getting
it running. Entirely oblivious to the commercial madness of a trade show environment, I had guys who spread entire hand-wired computer sys-
tems across the booth counter, and then pass me a probe and say, “Can you fix this?” Fortunately, eccentricity was a more acceptable reader
demographic back then. Advertising sales people even accepted that success, and having Ciarcia around, occasionally involved some solder
fumes wafting through the ranks at trade shows.

Today things are different, yet still the same. I’m sure that every one who took the time and trouble to lay a project in front of me in search

of a design answer charted a career course that has left its own valued mark on the world. People with that much drive and ambition typically
find success wherever they go.

Readers still meet me at shows to discuss projects and ideas, but it’s rare that anyone dumps out a bag full of hardware on the table.

Today, a reader it more likely to pull out his PDA and start scrolling through a thousand lines of C code before I can get it across to him that I
still speak mostly “solder.” The other big difference in show talk today is the testimonial aspect of a lot of it. Readers frequently tell me stories
about how

Circuit Cellar had a strong influence in directing their career paths. Although it completely confirms that our message is valuable,

I’m embarrassed to take personal credit when I truly believe that

Circuit Cellar has always been a community of engineers, rather than an indi-

vidual effort.

Talking to readers is important if we want to stay editorial-centric. I’d be talking only to advertisers if I were thinking of making

Circuit Cellar

like a trade magazine. In truth, however, all our readers can’t be at trade shows, and I can’t be there to hear everyone who wants to be heard.
That’s where I have to rely on the Internet.

By the time you read this, a survey will be posted on our web site at www.circuitcellar.com/survey. In some ways, this is like most of the

surveys we’ve sent to you by snail mail, but now I ask that you to come to us instead. I want to know what kind of job you have, whether
you’ve thought about participating in our contests, and what kind of editorial you want to see. Most of all, I want to know what you think about
us, and whether or not you think we’ve benefited your livelihood. I’m putting in a large comment section, and I invite you to add your two
cents. If you think

Circuit Cellar has affected your career path, please tell me about it. It’s not that I have any particular marketing objective in

mind, it’s just that sometimes I need to be reminded why we’re doing all this.

Speaking of doing all this, it reminds me of our latest contests. While you are on the site filling out the survey, check out the winners of our

recent Atmel Design Logic 2001 contest.

Of course, design contests have always been a big deal around

Circuit Cellar. I’m proud to say that the way we do them is really different

from other magazines. The majority of magazine contests only involve design ideas and not physical projects. All you have to do is describe
how you’d use an XYZ widget. Simple, sweet, and direct, but not our cup of tea and certainly no challenge.

Because of your enthusiasm and dedication, we get to approach them differently and with purpose. For the magazine, it’s an incentive

bonus plan to find new, good

Circuit Cellar authors. For an entrant, it’s a subsidized design adventure.

In next month’s magazine, we’ll show you the winners from our Atmel Design Logic 2001 contest. Right now, our Texas Instruments Ultra-

Low Power MSP430 Design contest is in full swing, and it isn’t too late to enter. If you’ve ever thought about building that neat little portable
widget, this is your opportunity. But wait, don’t unplug your soldering iron. If we haven’t hit your favorite processor yet, hang in there, we’ll get
to it eventually. We have an entirely new

Circuit Cellar contest sponsor for early 2002. With all of these contests in the pipe, subscribers can

count on a lot of terrific project articles covering a variety of great processors in the issues to come.

Moving Forward

INTERRUPT

i

steve.ciarcia@circuitcellar.com

PRIORITY

96

Issue 136 November 2001

CIRCUIT CELLAR

®

www.circuitcellar.com

background image

Copyright © 1999, TechTools, P.O. Box 462101, Garland, Texas 75046-2101 • ClearView, CVASM16, PICwriter, PICstation, the “Wizard” symbol and
TechTools are trademarks of TechTools, P.O. Box 462101 Garland, Texas 75046. • PICmicro is a registered trademark of Microchip Technology, Inc.
• All other trademarks are trademarks or registered trademarks of their respective company.

PICmicro

®

Assembler

M

odular design for easy, low-cost expansion &

upgrades.

PICmicro

®

In-Circuit Emulator

F

ully emulates the selected PICmicro, including pro-

gram memory, register memory, EEPROM, I/O activity,
SLEEP mode and all peripherals.

U

ses specialized Microchip “Bondouts” for accurate

emulation.

S

upports unlimited “NO SKID” Hardware Breakpoints.

T

e

c

h

T

ools

T

M

Embedded Systems De

v

elopment

T

ools

Get the TOTAL Package for only

Complete PICmicro

®

Development System

PICmicro

®

Debugger

Windows

®

IDE

w

w

w

w

w

w

w

w

w

w

w

w

..

..

tt

tt

e

e

e

e

cc

cc

h

h

h

h

--

--

tt

tt

o

o

o

o

o

o

o

o

ll

ll

ss

ss

..

..

cc

cc

o

o

o

o

m

m

m

m

CONTACTS: (972) 272-9392 Fax: (972) 494-5814 Email: sales@tech-tools.com

I

ntuitive, Easy to Learn full-featured environment

with integrated ClearView Debugger.

S

ource-level debugging for ALL popular Compilers

and Assemblers.

ClearView™ Mathias

is a full-fea-

tured In-Circuit Emulator with a highly
productive Development and Debugging
environment for the PICmicro.

See why Engineers choose TechTools

Visit our website at www.tech-tools.com and request your FREE CDROM!

Complete 12bit Development System from $699
Complete 14bit Development System from $749

Combined 12bit & 14bit Development System from $899

Add additional device support for $75 to $200

Add a PICwriter Programmer for $199

Add Data Breakpointing for $50

Add a Timing/Trace combination module for $270

$699

background image

STILL THE WORLD’S MOST

POWERFUL PORTABLE

PROGRAMMERS?

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

$795

inc 4mb ram

Orders received by 4pm will normally be despatched same day.

Order today, get it tomorrow!

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.

$1295

DATAMAN-48LV

• Plugs straight into parallel port of PC or

laptop

• Programs and verifies at 2, 2.7, 3.3 & 5V

• True no-adaptor programming up to 48

pin DIL devices

• Free universal 44 pin PLCC adaptor

• Built-in world standard PSU - for go-

anywhere 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

S4 GAL MODULE

• Programs wide range of 20 and 24 pin

logic devices from the major GAL vendors

• Supports JEDEC files from all popular

compilers

SUPPORT

• 3 year parts and labor warranty

• Windows/DOS software included

• Free technical support for life

• Next day delivery - always in stock

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 market-
leading programming solutions.

NEW MODEL

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


Wyszukiwarka

Podobne podstrony:
circuit cellar1996 11
circuit cellar1993 11
circuit cellar1994 11
circuit cellar1997 11
circuit cellar2004 11
circuit cellar2000 11
circuit cellar1995 11
circuit cellar2002 11
circuit cellar2003 11
circuit cellar1996 11
circuit cellar1993 11
circuit cellar1995 11
circuit cellar1996 11
circuit cellar2003 11
circuit cellar1997 11
circuit cellar1993 11

więcej podobnych podstron