Skip to Content
Hardware Hacking Projects for Geeks
book

Hardware Hacking Projects for Geeks

by Scott Fullam
January 2004
Intermediate to advanced
348 pages
13h 33m
English
O'Reilly Media, Inc.
Content preview from Hardware Hacking Projects for Geeks
209
Chapter 10, How to Build an Internet Toaster
Exhibit B: TCU Firmware Code
Option Explicit
Dim keypad1 as byte
Dim keypad2 as byte
Dim keypad3 as byte
Dim keypad4 as byte
Dim inbuffer1(1 to 20) as byte
Dim outbuffer1(1 to 20) as byte
Dim inbuffer3(1 to 20) as byte
Dim outbuffer3(1 to 20) as byte
Dim ch as byte
dim ch2 as byte
dim lettera as string
Dim letterb as string
dim codea as byte
dim codeb as byte
‘ Toast Control Unit firmware
‘ version 1.0
‘ 5/4/02
‘ Scott Fullam
Public Sub Main()
Call init_ports()
begin:
Call scan_keys()
Call scan_serialport()
GOTO begin
End Sub
Private Sub init_ports()
Call putpin (5, 3)
Call putpin (6,3)
Call putpin (7,3)
Call putpin (8,3)
Call Putpin (9, 0)
call putpin (10, 0)
call openqueue (inbuffer1, 20)
call openqueue (outbuffer1, 20)
call openqueue (outbuffer3, 20)
‘ set up com1 for communications to PC
Call OpenCom(1, 19200, Inbuffer1, Outbuffer1)
call Putqueuestr(Outbuffer1, “Toaster 1.0”)
Exhibit B
ch10_toaster.indd 209
1/13/2002 2:45:04 PM
210
Part II: Advanced Hacks, Tools, and Techniques
‘ set up pin 9 to send data to the LCD
‘ set to inverted logic, 8 datas bits, no parity
Call definecom3(0, 9, &H88)
Call OpenCom(3, 9600, inbuffer3, outbuffer3)
ch = 254
call putqueue (Outbuffer3, Ch, 1)
ch = 1
call putqueue (Outbuffer3, Ch, 1)
call Putqueuestr(Outbuffer3, “ LCD Toast”)
lettera = “A”
letterb ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Home Hacking Projects for Geeks

Home Hacking Projects for Geeks

Eric Faulkner, Tony Northrup

Publisher Resources

ISBN: 0596003145Catalog PageErrata