Myalarm V-LED1 Manuel d'utilisateur Page 7

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 8
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 6
via a connection to the TP104 on the
solder side of the MC13192-SARD
PCB. Ground is obtained from the
J101 BDM port pin 2. The signal is
connected to the ATD2 input on pin 3
of J105.
SOFTWARE DESIGN
For software development, I used
the Metrowerks Codewarrior develop-
ment environment that came with the
contest kit. Freescale’s Simple MAC
software provided everything neces-
www.circuitcellar.com
CIRCUIT CELLAR
®
36
Issue 194 September 2006
“N”
78
1 Byte
Netnum +48
ASCII
1 Bytes
“T”
84
1 Byte
devType+48
ASCII
1 Byte
“D”
68
1 Byte
Devnum+48
ASCII
1 Byte
“E”
69
1 Byte
Error+48
ASCII
1Byte
“A”
65
1 Byte
dAta
1 Byte
<CR>
13
1 Byte
<LF>
10
1 Byte
Figure 4
Take a look at the wireless data packet format. Twelve bytes carry the network number, device type,
device number, error code, and data. All but the data have 48 added to push them into printable ASCII characters.
The letters between fields allow the detection of a valid packet. With the <CR><LF>, they make debugging easy by
dumping packets to a terminal window.
sary to get data flying between the
sensors and base unit. All I had to
worry about was the data format to
transmit the sensor information.
I decided on the data packet format
shown in Figure 4. NetNum is the net-
work number, which allows more
than one system to coexist. The base
unit reacts only to messages with a
matching network number and prop-
erly formatted data packet.
De
vType identifies the sensor type.
For example, the garage door sensor was
assigned a device type of 1. DevNum
allows more than one of the same sen-
sor type to be identified by the base
unit. Error is a “1” for a problem that
requires attention and a “0” other-
wise. Data is the actual sensor data.
The letters between fields and the
CRLF allow for the detection of a
properly formatted data packet. They
make debugging easier by allowing
the raw packets to be dumped out the
serial port and read with a terminal
program. (The first four fields are
bytes, and 48 is added to transmit in
readable ASCII characters.)
T
he
remainder of the software for
the remote sensors is simple set-up
and calibration code. It’s followed by a
loop that periodically wakes up,
checks the sensor, transmits the data,
and goes back to sleep. The remainder
of the base unit software is the set-up
code followed by code to monitor the
sensor data (and react appropriately)
and to monitor and process incoming
telephone calls.
IMPROVEMENTS
As usual, I thought of numerous
ways to improve this project even
before I finished. For instance, inte-
grating an Ethernet interface and
TCP/IP stack will allow for a web serv-
er that can be checked from anywhere
via an Internet connection. And since
text messages can be sent to some cell
phones by e-mail, this will allow
alerts to be sent right to a cell phone.
Additional sensors will greatly
expand the system’s capabilities. I
want to design a sensor that can
check the position of a deadbolt lock,
4
th
International System-on-Chip (SoC)
Conference and Exhibit
November 1 & 2, 2006
Radisson Hotel Newport Beach, California
Early Bird Registration Open Now
Register Today & Save!
www.SoCconference.com
The Most Targeted & Informative
System-on-Chip (SoC)
Conference & Exhibit
Event of the Year!
Don’t Miss Out!
For Information and Questions,
Please Contact SoC Conference Organizing Committee:
949-851-1714
www.SavantCompany.com
2609016 Smith.qxp 8/4/2006 2:19 PM Page 36
Vue de la page 6
1 2 3 4 5 6 7 8

Commentaires sur ces manuels

Pas de commentaire