Академический Документы
Профессиональный Документы
Культура Документы
The aim of fast prototyping is to produce an was while contemplating these weal<nesses available, but specifica-
operational prototype of an application in that the idea for Sceptre was born. tion #3 rules out a lot
the shortest possible time. To achieve this, Here are the specifications collected thus far of them. We ended up
we need powerful, easy-to-use tools espe- for a powerful fast prototyping platform: choosing the LPC2148
-
cially when a microcontroller application is from NXP for the follow-
involved. The ideal is a simple assembly of a . powerful microcontroller ing reasons:
few intelligent building-blocks. Often, you . built-in useful peripherals . Popular: easy to find,
need only a single version of a set-up, and . easyto implement thanks to a big com-
would like to use the prototype as is. So you . compact size munity of users.
need to be able to treat these intelligent . cheap . Available in an
building-blocl<s as consumables. LQFP64 package:
Many commercially-
available microcon-
troller development
boards are not suit-
Open mobile platform
able for fast proto-
typing as they are too large, too fragile, or Let's add a sixth point to the list: relatively easy to
simply too expensive to be used only once. solder, even using DYI tools.
Usually, there is also a lacl< of software sup- . the project must be able to be built by . ln situ programmable via a simple
port for developing an application rapidly. an (experienced) amateul which implies serial port: doesn't need a special
One excellent example of a fast prototyp- the use of readily-available components programmer.
ing platform is Arduino tll, which we tell you that are also easy to solder. . Powerful: 32-bit ARMTTDMI-S core,
about from time to time. However, one of 512 KB flash memory,40 l(B RAM, lots
the drawbacl<s with Arduino is its low cal- Let's start with the first specification: the of built-in peripherals, including USB 2.0
culating power. 5o we almost always have brains of the project. The most power- and a real-time clocl<.
to add an expansion board to be able to use ful microcontrollers currently accessible . Easy to implement: the multi-platform
it, as an Arduino board has no peripherals. lt to enthusiasts are 32-bit ones. Several are open-source development tools are
03-2o1o elel<tor
MICROCONTROLLERS
]ilIJIJIEITI
. 32-bit ARMTTDMI-5 LpC:r48 . Real-time clocl<
microcontroller, 5rz l(B flash, 4o KB RAM . All microcontroller pins accessible
. USB z.o . Batteryor U5B port powering
. Bluetooth (Class r or z) . Li-ion battery charger
. 5D card reader . Compact: 6x8cm
. Serial port via U5B (e.9. for in situ . Open-source tools, software, and
available free on the Web, as
programming) hardware
are lots of libraries.
. 3-axis accelerometer . Open-source extended library
. DSrSBzo thermometer
We could argue for ages
about the peripher-
als that are'useful'
to have on the sort
of board we're thinl<-
ing of. After lengthy consider-
ation, we've chosen the following
(Figure 1):
Bluetooth module: naturally, a wireless
linl< (class 1 or 2, as you prefer) is obliga-
tory these days.
5D card reader: for storing data and
programs.
USB 2.0 (peripheral): since it's already
included in the microcontroller...
RS-232 serial port via USB: handy for in
situ programming.
3-axis accelerometer: this'll let you do
some super things.
Thermometer: always comes in handy!
Real-time clocl<: lots of applications
need one.
Li-ion battery charger: as the board's
going to be small, it will be portable, so
battery powering is a must. Figure 1. Sceptre blocl< diagram.
Expansion port: because you can't
always plan for everything, all the micro-
controller's pins will be accessible via
terminal strips.
elel<tor 03-201o
M ICROCONTROLLERS
Banqy CharEer
Applications &
Slitctr Ow Circufl
Those familiar with Nintendo's Wii games
console may have noticed the similarities
between the Sceptre and the Wiimote,
the remote control for the Wii. lt's true
(given that this is a totally open project, we
won't be hiding anything from you - long
live transparency!): both are portable and
include Bluetooth, a 3-axis accelerometer,
and a powerful micro. ln fact, our original
idea was to build a sort of Wiimote, and the
name Sceptre was chosen to highlight its
function as a powerful remote control (Fig-
ure 2). But you can do a lot more with the
Sceptre, as it's a universal open platform.
For example, the SD card reader lets you use
the Sceptre as a stand-alone data recorder.
The board already has a thermometer and
a real-time clocl<. What's more, the micro-
P1.31fr6-
controller and board have been designed to P1.3otrMs
lC4 P12efrcK
minimize power consumption and prolong
P0-4/SCK0/CAP0.ilAD0.6 P127ft&
battery life.
P0-6/MOS|0/CAP0.ZADI.0 P1.25IEX1N0
PO.7/SSELO/PWMZ€|NT2 P1,24fiAACECLK
l-{ardware
The circuit diagram of the Sceptre is shown
in Figure 3. As there are a hundred or so
components, the circuit may at first sight
seem daunting, but lool<ing closer, you'll
see that there's nothing terribly compli-
cated about it. So we're not going to go Figure 3. The full circr t diagram of the Sceptre. lt's a bit big,
03-201o elel<tor
MICROCONTROLLERS
elel<tor o3-2oro
M ICROCONTROLLERS
He I9 oph Td hb
'..; r.D'r. F q,Je-
@M tml4a
been provided in case the impedance of do the same. Allthe source codes developed
r*ruo,unmu-pii"uppi9J; .- ,lr-;* l
MdilHvdd.h6S-40.1138:S @eidr the Bluetooth module's RF output needs to for the Sceptre ought to compile using any
ffim
t#pq'n@
be matched to the aerial. ln most cases, this C/C++ compiler that can produce executa-
i-E networl< isn't required, and L2 can simply blesforthe 1PC2148.
'ndFN
be replaced by a wire linl< or 0 O resistor. A
fdcdffie#&dml dSpqramtE 31 mm length of wire will do as an aerial, Another reason for staying with Windows
but it's possible to fit an edge-type SMA is the Flash Magiclsl flash tool. Even though
ll
connector to the board. That way, you can WinARM does include its own flash tool
screw a 'WiFi' aerial onto the board - now (lpc21isp), Flash magic, which is free for
Figure 4. Configuring Flash Magic. The
there's class for youl private use, is user-friendly and helps avoid
communications parameters are the most
important ones. For programming, the The suggested Bluetooth modules require finger trouble. This tool also incorporates a
serial port speed must not be above 38,400 just two wires (RX and TX) for communicat- serial port terminal, very handy for debug-
baud. For the terminal, you can choose a ing with the mioocontroller. The RTS and ging. A serial port is often used during pro-
higher speed. CTS signals are however available (well, you gram development to send messages about
never l<now...) and they can be connected whether the program is worl<ing correctly
together if necessary via JP9. or not. Flashing the microcontroller requires
The 3-axis accelerometer lC2 cin be put]nto a serial port too; by using the same port for
LED D4 is intended as an indicator that the standby in order to limit power consump- both these tasl<s, we can mal<e do with just
microcontroller's USB port is connected, tion. lts sensitivity can be altered using two a single cable between the computer and
but there's nothing stopping you using it jumpers. lt is least sensitive when they are the Sceptre. Flash Magic avoids conflicts
for something else. ln this event, remember not fitted. See the data sheet for further between the flash tool and the terminal, as
to remove R16 if the microcontroller's USB details. they can't be enabled at the same time. So
port has to operate at the same time. The thermometer only uses power when you it's impossible to forget to free off the serial
To save power, the SD card reader and the actually tall< to it. lt's a good little device. port each time you want to reprogram the
Bluetooth module are switched using tran- Lastly, jumpers JP6 and JP7 let you choose microcontroller - Flash Magic takes are of
sistors (T2 and T3 respectively). the voltage sources for V0",. (required by everything.
the real-time clocl<) and V,", (needed for
The board has two positions for a Blue- the CNA). It seems that Flash Magic worl<s under Linux
tooth module, one for a Class 1 module and MAC OS X in the WINE Windows emu-
(BTM-222), the other for a Class 2 module Development envi ronment lator I6l.
(BTM-1 12). Once again, the reason is the Programming a microcontroller requires For the sake of completeness, lpc2l isp also
board's power consumption. A Class 1 mod- tools, and that's often where things get includes a terminal, but in order to use it,
ule (1 00 m, 300 ft) draws significantly more complicated. Not for the Sceptre, as the you have to use the same communication
than a Class 2 module (10 m, 30 ft). development tools were part of the original speed for flashing and debugging, as they
The little 'n' network C8. 12, and C9 has specifications: they must be free and multi- can't be specified individually.
platform. The advantage of the ARM core
as used by Sceptre is that there are actu- lnstallation
ally several free compilation chains based So installing the WinARM-based develop-
-aofmdcabns
Ha'dware conris Secudy
.
Jusr tn Ttu co# I,L*!_ MF9 on CCC (CNU Compiler Collection t3l)which ment environment is child's play. Down-
ZJ,e DTB dnd F I 5 ro ronhol PST dnd lSPpm operate under Linux, Mac, and Windows. load the latest distribull6n ral (currently ver_
IKeep FI5 dseiled hhile toM Poil opeh
ll c0 m! T2: 100
We've opted for a collection of tools that is sion 20060606, we haven't yet tried the
beginning to get a bit dated now but which beta version 20080331 ) and unzip the file
-Arieil DTP a.d FTS whh toM Poil oFen
is really easy to install and includes every- onto your hard drive. Add the following line
..) thing you need to get going right away. to the Windows pathname (assuming you
ftrnrjl K I The drawbacl< is that it only operates under have unzipped the file to the C drive root
Windows. We're referring to the WinARM directory):
distribution l4l, a big file that you'll have to
Fb Fl HeF
unzip after downloading it. This distribution C:\WinARM\bin;C:\WinARM\utils\bin;
includes the compiler, the linl< editor, a spe-
@
cial text editor for programming, a tool for This step is not obligatory, you can also
Figure 5. Options -> Advanced Options...: flashing the microcontroller, and lots more enter it at a command prompt or put it into
Checking this box enables Flash Magic to besides. a batch file (.bat) that you run each time
put the Sceptre in programming mode and Of course, just because we happened to you start a Sceptre programming session,
reboot without your having to do anything. choose WinARM doesn't mean you have to like this:
24 o3-201o elel<tor
MICROCONTROLLERS
elel<tor 03-2or o