206
Part II: Advanced Hacks, Tools, and Techniques
WARNING
When working with high voltages, I observe what I call the One-Hand Rule. This
means you should keep one hand in your pocket whenever you are handling live,
high-voltage circuits. Do not be tempted to use both hands at once; if one hand
happens to brush against a high-voltage point and the other is touching a ground
point, your body will create a path for electricity to flow across your heart. This
high voltage may cause your heart to stop, which is a very bad thing!
Software Setup Instructions
I decided to keep the software running on the TCU simple. It performs the
basic functions listed here:
Controls LCD
Reads button events from the front panel
Reads and interprets data from the RS-232 serial port
Controls heating coil selector relay
The TCU may be operated with or without a host PC gateway. When oper-
ated alone, it allows toast pattern selection from the buttons on the front of
the TCU. When operated with a host gateway PC, toast pattern selection
could be based on data gathered from the Internet by sending a command
to the TCU over the gateway serial port.
The software written for the BasicX controller is listed in Exhibit B. The
protocol the TCU uses is simple: when it receives the character A, it selects
the top heating elements; when it receives the character B, it selects the bot-
tom heating elements. The serial communications port is configured by the
software to operate at 19200 bits per second with 8 data bits, no parity bits,
and one stop bit. This can be abbreviated as 19200 bps 8N1.
Program the BasicX controller
Youll program the BasicX controller via the serial port of a PC running
the BasicX programming software. You will need to type the listing as it
appears in Exhibit B into the BasicX editor. You can also download the
code from http://www.oreilly.com/hardwarehacking.
Start the BasicX software on a PC and open the TCU software file. Connect
the BasicX carrier board to the PC serial port and plug in the board. Select
the program option on the BasicX software; this will transfer the soft-
ware from the PC to the BasicX controller. You are now ready to test your
system.
Software Setup Instructions
ch10_toaster.indd 206
1/13/2002 2:45:03 PM

Get Hardware Hacking Projects for Geeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.