E-book_15-ElektorBlockbusters(2).pdf

(8786 KB) Pobierz
E-book-15-ElektorBlockbusters-uk.pdf
Elektor
Blockbusters
Top-15 articles from Elektor
Elektor blockbusters
Artikeltitel • 1
9293493.051.png 9293493.058.png 9293493.059.png 9293493.060.png 9293493.001.png 9293493.002.png 9293493.003.png 9293493.004.png 9293493.005.png 9293493.006.png 9293493.007.png 9293493.008.png 9293493.009.png 9293493.010.png 9293493.011.png 9293493.012.png 9293493.013.png 9293493.014.png 9293493.015.png 9293493.016.png 9293493.017.png 9293493.018.png 9293493.019.png 9293493.020.png 9293493.021.png 9293493.022.png 9293493.023.png 9293493.024.png 9293493.025.png 9293493.026.png 9293493.027.png 9293493.028.png 9293493.029.png 9293493.030.png 9293493.031.png 9293493.032.png 9293493.033.png 9293493.034.png 9293493.035.png 9293493.036.png 9293493.037.png 9293493.038.png 9293493.039.png 9293493.040.png 9293493.041.png 9293493.042.png 9293493.043.png 9293493.044.png 9293493.045.png 9293493.046.png 9293493.047.png 9293493.048.png 9293493.049.png 9293493.050.png
Contents
Elektor RFID Reader ........................................................................................................ 3
Stand Alone OBD-2 Analyser ......................................................................................... 11
ElekTrack ....................................................................................................................... 18
Making Waves at C ........................................................................................................ 24
Digital Inspector ............................................................................................................ 27
Profiler .......................................................................................................................... 31
ECIO PLC ........................................................................................................................ 36
Universal JTAG Adaptor ................................................................................................. 41
GBECG ............................................................................................................................ 47
Tilt Gamepad ....................................................................................................... 57
Micro Webserver .................................................................................................. 60
Software Defined Radio ................................................................................................ 68
Wireless USB in miniature ............................................................................................. 74
A 16-bit Tom Thumb ...................................................................................................... 82
USB Flash Board ............................................................................................................ 89
Elektor blockbusters
Contents • 2
9293493.052.png
HANDS - ON MICROCONTROLLERS
ELEKTOR RFID Reader
Gerhard H. Schalk
RFID cards are becoming
increasingly popular in
many fields where
previously barcodes and chip
cards were used. They open
up many new possibilities, such
as applications in travel cards or
even banknotes. As befits a
premier electronics magazine,
Elektor Electronics is offering its
readers with this issue not only a
free RFID card but also a professional
RFID reader for your own applications.
The design described here can both read
from and write to all types of RFID card
that are compatible with the MIFARE and
ISO 14443-A international standards.
In developing the Elektor Electronics
RFID reader we have aimed to make
the device as universal as possible. So,
for example, the reader can be used in
conjunction with a PC over a USB con-
nection, or in stand-alone mode using
its liquid crystal display. It is very sim-
ple to use the free PC-based program
‘MIFARE Magic’ to read and write all
kinds of MIFARE cards without
installing special software in the
reader.
Elektor blockbusters
Elektor RFID Reader • 3
For MIFARE ® and ISO 14443-A cards
26
elektor electronics - 9/2006
9293493.053.png
Specifications
Available as ready populated and tested SMD circuit
board
Can be modified for user applications
Programming tools available
Elektor Electronics RFID reader:
Near-field reader for 13.56 MHz RFID cards
Compatible with MIFARE and ISO 14443-A cards
Allows both reading and writing
USB interface for connection to PC
Ready for immediate use without programming
Free PC-based software available
Stand-alone (including portable) operation using LCD
module
Dedicated MF RC522 reader IC
Dedicated microcontroller on reader board
SPI and I 2 C interfaces
Spare 8-bit microcontroller port
Buffered switching output
MF RC522 reader IC:
Highly-integrated single-chip reader for ISO 14443-A and
MIFARE cards
Supports contactless data transmission at 106 kbit/s,
212 kbit/s and 424 kbit/s
50 mm approx. read/write range (depending on antenna)
Integrated MIFARE Classic cryptography
Programmable over UART, I 2 C or SPI
64 byte transmit and receive FIFO buffer
Programmable reset and power-down modes
Programmable timer
Internal oscillator allows direct connection of 27.12 MHz
crystal
MIFARE Magic directly supports a
range of contactless 13.56 MHz
MIFARE cards, including the Philips
MIFARE UltraLight, MIFARE 1K and
MIFARE 4K. The MIFARE Magic win-
dow ( Figure 1 ) also offers the facility
to send individual commands to the
card with a click of the mouse. This
allows you to determine the character-
istics of different cards very easily.
Examples of compatible cards include
the MIFARE UltraLight RFID card sup-
plied with this issue, and described in
more detail in a separate article, and
smart cards used on many public
transport systems all over the world —
for example, the London Underground
Oyster card
In stand-alone operation, for example
in an access control application, the
reader can be used directly with the
firmware we have developed. On
switch-on the reader immediately
looks for cards within the range of the
antenna (a few centimetres) and reads
any cards it finds in that area. The LCD
(if connected) then shows the card
type along with its serial number, and
the switching output of the reader is
activated.
The reader is constructed around the
newest Philips reader IC type
MF RC522 and a type LPC936 micro-
controller. Since the reader IC is only
available in an HVQFN32 package, we
have decided to solve the problems of
mounting and soldering by making
available ready populated and tested
reader boards fitted with pre-pro-
grammed microcontrollers.
The Elektor Electronics RFID reader is
naturally ideal for experimenting with
the free MIFARE UltraLight card. The
system includes a powerful microcon-
troller and I 2 C, SPI, UART and USB
interfaces, and free development tools
are available. This makes it suitable for
developing dedicated applications
such as door and gate openers, mem-
bership card systems, storing pass-
words and configuration data, pay-
ment systems, security for domestic
appliances such as televisions, video
recorders and PCs, monitoring battery
Figure 1. The MIFARE Magic program developed for the Elektor Electronics RFID reader allows MIFARE and
ISO 14443-A RFID cards to be read, written and programmed.
Elektor blockbusters
9/2006 - elektor electronics
Elektor RFID Reader • 4
27
9293493.054.png 9293493.055.png 9293493.056.png
HANDS - ON MICROCONTROLLERS
RFID Reader
LCD
I /O
I 2 C
vides the 3.3 V supply for the LPC
microcontroller (IC3) and the
MF RC522 (IC4). Red LED D6 shows
when the 3.3 V supply is present. If 5 V
power is not provided via the USB con-
nector Schottky diode D4 allows an
external power supply to take over
automatically. Either four AA-size cells
(the enclosure suggested in the parts
list will accept these) or a 5 V mains
supply capable of delivering at least
300 mA can be used.
Figure 4 shows an overview of the
internal functions of the MF RC522
reader IC in the form of a (greatly sim-
plified) block diagram. The output driv-
ers of the device allow direct connec-
tion of transmit and receive antennas
without external active amplification
circuitry. A few passive components
provide the essential matching to the
antenna characteristics. The analogue
interface handles demodulation and
decoding of the reply data sent by the
card. The digital block is responsible
for constructing the ISO 14443A or
MIFARE protocol frames and accompa-
nying error detection (parity and CRC).
The FIFO buffer allows 64-byte blocks
to be sent and received in ISO 14443
mode (‘T=CL’ protocol). In MIFARE
mode the largest data blocks
exchanged are at most 16 bytes long,
and so there is no need for the micro-
controller to split up the command
packets. The registers of the MF RC522
can be programmed over the SPI, asyn-
chronous serial or I 2 C interfaces. Since
the LPC936 microcontroller only has
one asynchronous serial interface, and
this is required for communications
with the PC, the I 2 C interface is used
to talk to the MF RC522.
If desired an LCD module can be con-
nected to port P0 of the LPC936 via
connector K2. P0.0 is buffered by a
transistor and provides a switched out-
put, and the SPI and I 2 C interfaces of
the microcontroller afford plenty of
opportunities to expand the reader by
adding extra hardware. For example, a
real-time clock could easily be added
to allow for time monitoring, and the
switched output could control a door
opener; see also the pages about the
RFID reader on the Elektor Electronics
website.
MF RC522
I 2 C
M C / Philips
LPC 935
RS232
Voltage
Regulator
FT232R
USB / UART
USB
Optional Power Supply
5V
060132 - 13
Figure 2. Block diagram of the Elektor Electronics RFID reader.
packs and much more besides. The
combination of secure identity, data
storage and contactless interface
opens up many opportunities for novel
applications.
memory are sufficient for an enormous
range of possible applications. Pro-
grams for the microcontroller can be
simply written using any 8051 com-
piler. Communications with the PC are
handled by an FT232R USB/RS232
interface chip from our friends at
Future Technology Devices (FTDI).
The full circuit diagram is shown in
Figure 3 . When connected to a PC,
power is taken from the USB via mini-
connector K1. The FT232R USB inter-
face chip is configured to report the
reader as a high-power device when
the bus is initialised (during ‘enumer-
ation’). As a bus-powered device the
reader can then draw a current of up to
500 mA. When enumeration is com-
plete the /PWRNEN signal on pin 11 of
IC1 changes state, making P-channel
MOSFET T2 conduct. The 5 V supply is
then passed through to voltage regula-
tor IC5. The output of the LM2937 pro-
Reader hardware
Figure 2 shows the block diagram of
the reader. The basic reader functions,
including the creation of the HF mag-
netic field, modulation and demodula-
tion, and the generation of the
ISO 14443 data stream, are carried out
in the MF RC522. It is simplest to think
of the MF RC522 as a contactless
UART driven directly by the microcon-
troller. In the Elektor Electronics reader
we have used an 8051-compatible
LPC936 microcontroller from Philips.
The CPU takes only two cycles per
instruction and is clocked at 16 MHz.
This speed and the 16 kbyte Flash
Analog
Interface
Contactless
UART
Register Bank
FIFO
Serial UART
SPI
I 2 C
Host
MFRC5222
060132 - 14
Get started
The double-sided printed circuit board
for the Elektor Electronics RFID reader
is shown in Figure 5 . It is only possi-
ble to reflow solder the reader IC, and
so we are making the board available
Figure 4. Block diagram of the Philips MF RC522 reader IC.
Elektor blockbusters
Elektor RFID Reader • 5
28
elektor electronics - 9/2006
9293493.057.png
Zgłoś jeśli naruszono regulamin