UC Davis ECE 172 Lab Guide Book
UC Davis ECE 172 Lab Guide Book
UC Davis ECE 172 Lab Guide Book
Lab
verification
due
at
the
end
of
your
lab
session
Wednesday
April
22
or
Thursday
April
23,
depending
on
you
lab
section.
-5
points
for
verification
on
April
24.
-10
point
for
verification
during
the
week
of
April
27.
Zero
credit
after
May
1.
Objective:
In this lab, you will use the logic analyzer to characterize the transmissions from an infrared (IR)
remote control and then use the IR remote control as an input device for the Wyzbee board. The
main task in Part A is to determine how the IR transmission signals are encoded for a set of
buttons on the IR remote, and from this analysis determine the IR remote data format and timing.
In Part B, you will decode the transmissions for each button in the Wyzbee board. You will use
key presses to manipulate an object you render on the OLED display.
Hardware:
The Wyzbee board includes an IR receiver from Vishay Semiconductor. Your software will use
interrupts to detect the rising and falling edges of the IR remote input signal, and use one of the
microcontroller's timers to determine the time span between edges, and in turn determine which
key was pressed. You can find an example of interrupt use on the Wyzbee board on the company
website: http://wyzbee.com/QuickStart/
For information on the IR sensor see: http://www.vishay.com/docs/82494/tsop752.pdf. The
details of the onboard circuit can be found in the Board Schematic, found on Smartsite:
You should read through the TSOP75436 IR Receiver Module datasheet to understand how the
module works. As shown in the Block Diagram of the datasheet, the IR receiver has a band-pass
filter, which has a center frequency of 36 kHz. The TSOP75436 is able to suppress most of the
interference from room lights. The room lights in our lab will probably not generate noise on the
device, but if they do, you may need to shield your receiver from the lights. Also when in the lab
around other groups you may need to shield your receiver from their IR remote.
You will use an AT&T RC1534801 or S10-S3 Remote Control to drive the on board IR. (User
Guide in Technical Documents folder on SmartSite)
Your remote may have been previously configured so you should first reset the remote to factory
defaults by following the instructions in of the ATT IR Remote User Guide, posted in the
Technical Documents folder in the class SmartSite. We will use the IR remote in TV mode,
which is entered by pressing the TV button. You will configure the IR remote to generate IR
transmissions for a specific 4-digit set up code assigned by your TA. The IR transmission
encoding varies by manufacturer and TV model so there are different setup codes for different
TVs. The guide describes how to configure the remote TV set up code. We will be using the
numeral keys to interact with the Wyzbee so you will need to follow the configuration procedure
in section activate the numeral keys. In addition you should disable backlighting, as described in
to extend battery life.
Each button on the remote is encoded with a different pattern of varying length pulses, similar to
Morse code and various other communication coding systems. See the document Data Formats
for IR Remote Control posted in the Reading Material/IR Remote folder in the class SmartSite
for some background on IR remote control transmission data formats and timing. Also refer to
the tutorial on IR Remote Control at http://www.sbprojects.com/knowledge/ir/index.php, and
notice the links to some specific protocols in the left-hand column of the page.
In Part A you will use the Saleae USB Logic Analyzer to capture and characterize the IR
transmission format and timing for five different buttons on the remote control. You can
download the Saleae software for personal use from: http://www.saleae.com/downloads
Our IR remote has a modulation carrier frequency of 36KHz so a logic analyzer sampling
frequency that is significantly above that (say 250KHz) will yield accurate timing measurements.
There is no direct access to the GPIO wired to IR_OUT. However, you can write a simple
program to route the input of P10(IR_OUT) to an accessible GPIO pin. From there you can
indirectly sample the IR_OUT signal with the logic analyzer.
Use the logic analyzer to capture a transmission for each of your chosen buttons in the target set
and under 'Options' use 'Save Screenshot' to save a picture of the capture for each button. An
example transmission capture for one button on one TV set up code is:
Use your set of captures to characterize the general format and general timing of your IR
transmissions, and to determine the specific binary data that is sent for each button in the target
set. Use the IR protocol documents described above and/or other web resources as a top down
method to confirm the protocol for your TV set up code. Include this top-down analysis in your
lab report.
Some IR remote transmissions have an address and a data field. The address directs the data to a
specific device (e.g., TV, DVD, VCR, etc.) and the data is essentially a key code that specifies
which key (button) has been pressed. These key codes are sometimes called 'commands' because
the key code is mapped inside the receiving device to a specific operation, e.g., Fast Forward.
When you press a button on the remote control unit and hold it down, the data field is typically
repeated as long as the button is held down. The receiving device ignores the repeated data,
allowing a user to easily select Channel 3, for example, instead of accidentally getting Channel
33 (or 333, etc.) by pressing a button too long. For our application repeated data will be
programmatically ignored by discarding the repeated data fields.
For this lab you will need to use a timer module. Spansion provides a peripheral driver for the
dual timer module of the MCU. You can use the timer to analyze the IR pulse widths in your
interrupt service routine. Documentation can be found on the timer Smartsite in the file FM4-
AN709-0000-E.pdf.
Demonstrate a Logic Analyzer capture of one button press to your TA and have him sign off.
Demonstrate your software detecting at least five different button presses and print your decode
to the screen and have him sign off.
In Part B you will decode the signal coming into the Wyzbee to recognize when the user presses
the buttons you have chosen. Your system must distinguish these buttons from any other buttons
on the IR remote. Your system does not need to identify other buttons, but it must recognize that
they are not in the target button set.
Using the data you acquired in Part A, write a program that (1) decodes and recognizes the IR
transmissions for each button in the target button set, (2) Manipulate an onscreen object.
You should choose an object or set of objects to draw on the OLED. You should then change the
image you have drawn depending on the button presses you detect. Here is a set of suggestions
for what you might do when detecting key presses:
Demonstrate to your TA how at least 5 different buttons change what is being displayed on the
screen. Have him sign off on your work.
At a minimum your lab report should include:
! Your
verification
sheet.
! A
hard
copy
of
your
well-written,
well-commented
code.
! A
soft
copy
of
you
code
uploaded
to
SmartSite
! An
analysis
and
interpretation
of
the
data
format
used
for
your
assigned
TV
set
up
code.
! A
timing
diagram
that
illustrates
the
IR
data
format
for
your
TV.
! Screen
shots
of
the
IR
transmission
for
at
least
five
different
keys,
labelled
with
the
binary
pattern
that
the
transmission
represents.
! A
description
of
any
noteworthy
difficulties
you
encountered
in
constructioning
your
solution.
! A
description
of
your
manipulation
program
and
how
it
works.
! A
description
of
anything
about
your
lab
this
is
interesting, insightful, amazing or
amusing
that
might
be
warrant
bonus
points.
Lab
Completion
Grading:
15%
Logic
Analyzer
Capture
of
Button
presses
55%
Decoding
of
at
least
five
button
presses
30%
Image
manipulation