Sie sind auf Seite 1von 16

Graphical Remote Control

With RF Transceiver
EE650 Technical Report

Report by:
Class:

Alex Martin
3EN16
Dec. 08, 2000

Index
1.0 Introduction
2.0 Background
3.0 Desired User Interface
3.1 Background
3.2 User Interface Requirements
3.3 User Interface Overview
4.0 Hardware Overview
4.1 System Block Diagram
4.2 Brief Description
5.0 Component Selection/Requisition
5.1 Transceiver
5.1.1 Transceiver Requirements
5.1.2 Transceiver Selection
5.1.3 Transceiver Requisition
5.2 LCD Display
5.2.1 Display Requirements
5.2.2 Display Selection
5.2.3 Display Requisition
5.3 Microcontroller
5.3.1 Microcontroller Requirements
5.3.2 Microcontroller Selection
5.3.3 Microcontroller Requisition
5.4 Other Components
5.4.1 Component Selection
5.4.2 Component Requisition
6.0 Hardware Description
6.1 System Schematic
6.2 Microcontroller
6.2.1 Microcontroller Overview
6.2.2 Microcontroller Port Designations
6.2.3 External Serial EEPROM
6.3 Transceiver
6.3.1 Transceiver Overview
6.3.2 Transceiver Interface
6.4 LCD Display
6.4.1 LCD Overview
6.4.2 LCD Interface/Control
6.5 LCD Bias Circuit
6.6 LCD Backlight Circuit
6.7 LCD Power Control

Index (contd)
7.0 Hardware Construction
7.1 PCB Design
7.2 Circuit Assembly
8.0 Firmware Description
8.1 Memory Usage
8.1.1 Program Flash
8.1.2 Data RAM
8.1.3 Internal EEPROM
8.1.4 External EEPROM
8.1 Display Data Format
8.2 Transceiver Protocol
8.3 Flowchart/Description
9.0 Programming
9.1 Development Tools
9.2 Programming the Serial EEPROM
10.0 Appendices
10.1 PCB Layout
10.2 Program Assembly Code
10.3 EEPROM Modifier Assembly Code
10.4 Display Data Listing
10.5 Invoices
10.6 Data Sheets

1.0

Introduction
3

The present report pertains to a remote control system, incorporating a graphical LCD
display, and a digital RF transceiver. The implemented system consists of a remote unit, and a base
station unit. The system is intended to act as a sub-system, providing control of a larger appliance, the
design of which is beyond the scope of this project. Due to time restrictions the digital RF transceiver
section of the system remained unimplemented. However, to avoid wasting the great deal of
contemplation and time which was spent on this section of the circuit, it is still described herein.

2.0

Background

To implement a wireless remote control system, a communication medium is required. The


most popular medium for remote communication is infrared light, such as used in the common
television remote. Despite its popularity, this communication medium has two main limitations.
The first such limitation is that of range. A direct line of sight must exist between the remote
device, and the controlled device. While this is an acceptable condition for appliances such as
televisions, this restriction is inconvenient when controlling other devices, such as stereos.
Another limitation inherent to the infrared remote control, is that communication is only
simplex. This, again, is an acceptable condition when controlling a television, since the monitor
displays graphical feedback to the user, indicating the result of the control attempt. If, however, an
appliance such as a stereo, is to be controlled from a different room, simplex communication does not
suffice.
In order to implement a more convenient means of remote control, a radio frequency(RF)
medium may be used for data communication. This is the communication medium selected for this
design project.

3.0

Desired User Interface

3.1

Background

This section is intended as an overview of the desired user interface for the device, so that the
reader may more easily interpret the ensuing description of system design. The user interface, along
with feasibility, were the first things contemplated when considering the project, and defined the
process of design.

3.2

User Interface Requirements


The following list describes conceived requirements of the user interface.
Quick Visual Feedback
Flexible/Adaptive
Simple/Low profile

3.2

User Interface Overview


4

To accommodate these requirements, a menu driven system was implemented. This provided
an interface which can be adapted to almost any application, while minimizing the number of required
user controls. Means of user control are provided using push-buttons, the functions of which are
displayed on an adjacent display device. By this method, a menu driven system can be efficiently
realized by changing the displayed push-button functions.
This menu driven platform, combined with full duplex communication, is capable of
supporting an unlimited number of applications. Moreover, the reduced number of push-buttons
results in a low profile user interface, which is simple to understand.

4.0

Hardware Overview

4.1

System Block Diagram

The block diagram of Figure 4.1 describes the main circuit blocks used to realize the remote,
and base station components of a complete system. These two components of the complete system, are
of similar design, the only difference being that the remote device does not require external memory,
because all display information can be stored at the base station.

EXTERNAL
CONTROL
INTERFACE

USER
CONTROLS

Figure 4.1

RF
TRANSCEIVER

PIC16F877
MICROCONTROLLER

8Kx8
SERIAL
EEPROM

LCD DISPLAY

4.2

Brief Description

The relationship of the main system components becomes apparent by examination of the
block diagram(Fig. 4.1). The microcontroller acts as a mediator, and interface between system

components. The executed program controls and regulates all system functions. Because the amount
of data required for storage of display data exceeds that of the common microcontroller, an external
memory device is also required. Implementation of radio frequency communication requires the use of
an RF transceiver circuit.
The main purpose of the system, of course, is to control one or more larger appliance. This
larger system is beyond the scope of this project, and, as such, an external control port must be
provided to allow for future expansion.

5.0

Component Selection/Requisition

5.1

Transceiver Circuit

5.1.1

Transceiver Requirements

To establish feasibility of the project, the first component to be considered was the RF
transceiver. The device, of course, had to be digital, and provide duplex communication. The data rate
of the device should accommodate the magnitude of serial data to be communicated, such that the
remote device can be updated within a couple of seconds. Other considerations were range and
frequency, which determine the usable distance of the remote, and the physical size of the antenna,
respectively.

5.1.2

Transceiver Selection

Several options were explored when searching for a suitable transceiver device. The initial
conception was to use a transceiver module. A couple of these were found, and considered, but this
seemed to much like cheating. In order to realize a system comprised entirely of discrete components,
transceiver ICs were then considered. Most of these devices are very complex, and require large
networks of external components. This is also true of the new Bluetooth technology, which exists
mainly at the baseband level.
A suitable RF transceiver device was finally found from a Norway company called Chipcon.
This company produces both ASICs and standard products, two of which are RF transceiver ICs.
The simpler of the two ICs, the CC400, was selected, due to its lower operating frequency of
430MHZ, and its minimized number of external components. The device operating voltage is 3V,
which was ideal for operations from two AA batteries. The data rate was a suitable 10Kb/s.

5.1.3

Transceiver Requisition

Obtaining the transceiver ICs proved to be much simpler than anticipated. These components
had to be imported from Norway, which of course could have been a huge task if things went roughly.
However, a purchase order was simply faxed to Chipcon, and they abruptly replied, and shipped five
of the devices. The only reservation was that it cost $75 for customs brokerage, which almost doubled
the price of the components.

5.2

LCD Display

5.2.1

Display Requirements

The display device had to be capable of displaying all user feedback and menu information,
to realize the desired user interface. For this reason, a graphical display was desirable. Liquid crystal
seemed the efficient choice, based on popularity, and power consumption. Many products, from many
companies were reviewed, one of the main criterion being a 3V power supply.

5.2.2

Display Selection

The initial graphical display selected, was unobtainable, due to large order quantities. None
the less, the same company, Densitron, was able to provide prototype quantities of a similar (but more
complex) device, the LM4736. Products form twelve other companies were consider, but Densitron
was the most attractive. Moreover, the device was capable of 3V operation.

5.2.3

Display Requisition

Two LCD displays were initially purchased. I, used a false company name, to obtain the
devices from prototype stock. These devices cost approximately $150 each, and, again, a customs
brokerage fee was required.

5.3

Microcontroller

5.3.1

Microcontroller Requirements

After selecting the other main components, the requirements of the microcontroller were well
established. It, of course, had to be capable of 3V operation, be of sufficient speed to interface to other
system components. A maximum number of ports, and maximum on chip memory were desirable. The
device had to be reprogrammable, to allow for ease of development. Another of the main criterion was
a good development package, because it is not desirable to spend a lot of time fiddling with nuisances.

5.3.2

Microcontroller Selection

Approximately 50 microcontroller companies were reviewed for suitable devices. After


screening for functionality, development tools were reviewed. Based upon this factor, the most
attractive manufacturers were ST, Temic, Atmel, and Microchip. Microchip won out because it
provided the most descriptive literature, which was invaluable in ensuring suitability of the
microcontroller. The PIC16F877 was selected.

5.3.3

Microcontroller Requisition

The selected Microcontroller was readily available through Digi-Key.

5.4

Other Components

5.4.1

Component Selection

All other components were selected to support the main components. These included all
discrete components, as well as a memory device, op-amp, and switch-mode regulator.

5.4.2

Component Requisition

All other components, with the exception of the switch-mode regulator, were obtained from
Digi-Key. The switch-mode regulator(required for LCD bias), was obtained through Maxim sample
distribution. This was the only component which was not purchased at full price. It was necessary to
sample this component because no distributor stocked them.

6.0

Hardware Description

6.1

System Schematic

Figure 6.1.1 is a more descriptive block diagram of the system, indicating some of the extra
support devices required. Of these additional circuits, included is a switch-mode power supply, and
LCD backlight control. A full schematic is represented in figure 6.1.2, describing exact connection of
the circuitry. These figures, and the attached data sheets should be referred to while reading this
report. To reduce the size of this report, only the first six pages of each data sheet are included. Full
data sheets are available from the manufacturer web sites.

Figure 6.1.1

RF
TRANSCEIVER

USER
CONTROLS

EXTERNAL
CONTROL
INTERFACE

POWER
CONTROL

PIC16F877
MICROCONTROLLER

8Kx8
SERIAL
EEPROM

LCD BIAS
STEP-UP
REGULATOR

6.2

LCD DISPLAY

BACKLIGHT
CONTROL

Microcontroller

6.2.1

Microcontroller Overview

The data sheet of the PIC16F877 may be referred to for full details on this microcontroller.
The device contains 8K words of 14 bit flash program memory, 365 bytes of RAM, and 256 bytes of
EEPROM. There is actually 512 bytes of internal RAM, but several locations are used as control
registers.

The PIC16F877 has many internal functions, some of which were unnecessary. One of the
internal timers was repeatedly used to generate timing for functions such as encoding the data for
transmission. Because the device has no dedicated address or control busses, these functions had to be
implemented in software, along with the ascociated timing.
The device has 32 I/O lines, arranged as 5 ports. Each of these I/O lines can be independently
assigned as inputs or outputs. Most of these pins have multiplexed functions, and the implemented
functions are programmable using the control registers. These lines are used to interface to the
peripheral devices.

6.2.2

Microcontroller Port Designations

The following I/O designations describe port usage. Several of the busses were split,
to allow multiple functions, or because of the multiplexed pin functions.

Port A
RA0
RA1
RA2
RA3
RA4
RA5

Port B

Transceiver Interface STROBE


Transceiver Interface PDATA
Transceiver Interface CLOCK
Transceiver Interface D I/O
-

Port C
RC0
RC1

Display Control Bus


Display Control Bus

/RD
/WR

RC2
RC3
RC4
RC5
RC6
RC7

Display Control Bus


Serial SPI Interface
Serial SPI Interface
Serial SPI Interface
Display Control Bus
Display Control Bus

A0
SCK
SDI
SDO
/RST
/CS

Port E
RE0
RE1
RE2

6.2.3

Piezo Transducer Out


Display Power Enable
High Voltage Enable

RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7

Serial SPI Interface


Serial SPI Interface
User Controls
User Controls
User Controls
User Controls
User Controls

/CS
/CS
PB1
PB2
PB3
PB4
PB5

Port D
RD0
RD1
RD2
RD3
RD4
RD5
RD6
RD7

Display Data Bus


Display Data Bus
Display Data Bus
Display Data Bus
Display Data Bus
Display Data Bus
Display Data Bus
Display Data Bus

D0
D1
D2
D3
D4
D5
D6
D7

External Serial EEPROM

The Microcontroller did not have sufficient internal memory to store all of the required
display data. For this reason an external memory was required. A serial SPI EEPROM, the 25LC640
from Microchip, was selected for display data storage. This memory device proved to be an efficient
solution, and despite the overhead required, could be accesses using a repetitive read loop.

6.3

Transceiver

6.3.1

Transceiver Overview

The transceiver portion of the circuit was not implemented due to time restrictions. No
problems with this circuit are anticipated, and it will be developed when time allows. To avoid
wasting all of the time and contemplation which was spent on this section of the circuit, a brief
description follows.
The selected transceiver IC was the CC400 form Chipcon Components. This device is
capable of a 10Kb/s data rate, and uses an FSK modulation scheme. The carrier frequency is firmware
programmable in increments of 5KHz, from 300-500MHz. However the connected components
network values were calculated to support a 420-450MHz carrier frequency. The device utilizes a
half-duplex operating scheme. A /4 wavelength SMA antenna implemented in the system.
Other programmable functions include, frequency deviation, transmit power, sensitivity,
transmit/receive, and power down mode. Component values for supporting circuitry, were calculated
using Chipcons SmartRF Studio software. All parameters are entered into the software, and
component values are conveniently calculated.

6.3.2

Transceiver Interface

The transceiver requires 16 configuration bytes to be programmed via a 3-wire interface, to


initialize the device. These configuration bytes program the aforementioned functions. The three
programming lines are a clock, strobe, and data. Timing for these lines are generated in software.
Transmitted data must be Manchester encoded to maintain a constant DC signal level.
Although the data link was not completed, the transmitter is provided with the Manchester encoded
display data. Data input and output form the transceiver share a common signal pin. The
transmit/Receive function of the device is programmable through the configuration bytes.

6.4

LCD Display

6.4.1

LCD Overview

The selected LCD display device is the LM4736 from Densitron Corporation. This display
module provides an on board controller, memory, and display drivers. It has many powerful(and
complex) features, such as three layers of graphical memory, each of which can be independently
scrolled. The controller is interfaced to 32K of on-board RAM, for data storage. The layers of data can
be stored anywhere within the addressing space of this RAM, thus increasing the complexity of the
device.
The LCD controller also has an on-chip character generator ROM. This is efficient in
reducing the number of display write commands necessary to display text. It, however, does not assist
with the large amount of data required to display graphics to the display.
A 20 volt power supply is necessary for LCD bias. This is accomplished using a switch-mode
regulator, as is described in a following section.

6.4.2

LCD Interface/Control

Address, data, and control for the LCD display module share a common 8-bit bus. Each byte
written to the bus is designated as a control of data byte, by a separate control line. While this may

10

seem efficient, it requires that sequential data for the display must be stored as 9-bit words. This is
accomplished by segmenting the data into packets, as will be described in the firmware section of this
report.
The display requires four other control line including read, write, chip select, and reset. All
control signal timing is generated in software, as the microcontroller does not have a dedicated control
bus. The display is intended to interface to an 8080 type microcontroller. The reset signal to the
display was initially generated by a TCM809 reset controller from Telcom. It was found that the
150ms delay generated by this device was much longer than the required 1ms, and so the device was
replaced by a microcontroller control signal.

6.5

LCD Bias Circuit

Bias for the LCD display was provided by a 20V switch-mode power regulator. It was found
that switch-mode regulators capable of generating 20V from 3V, are few and far between. A suitable
device was eventually found in the Maxim MAX629, switch-mode regulator. The related circuitry is
displayed in the schematic of figure 6.1.2. The display data sheet called for a 24V supply, but the
regulator was noisy at this level. It was found that a 20V supply sufficed. This input voltage is also fed
to a potentiometer, for contrast control.

6.6

LCD Backlight Circuit

Because the device is to be used as a battery operated remote control, power consumption is a
prime issue. One way of reducing power consumption while the remote is active, is to control the
backlight. For this purpose a backlight control circuit was designed. This circuit is comprised of a
simple comparator, and Cds photoresistor, controlling an LED driver transistor. This circuit works
beautifully, switching the LED backlight on when surrounding light levels are to low. A Cds
photoresistor was used as opposed to a photodiode or phototransistor, because its responsivity more
closely matches that of the human eye.

6.7

LCD Power Control

The microcontroller, memory and transceiver each have programmable standby states, in
which power consumption is minimal. The LCD display, and related circuitry, however, dont. For
this reason a Hexfet is used to control power to this part of the circuit. This is necessary in order for a
full standby state to be realized, and for battery power consumption to be minimized. International
Rectifiers IRF7402 Hexfet was used for this purpose.

7.0

Hardware Construction

7.1

PCB Design

11

Appendix 10.1 contains Images of the PCB layout. The layout was created in
Autocad, as no proper deign software was available. It is believed that Autocad provides a
degree of freedom that most dedicated PCB design software doesnt. However, it does no
integrate many of the convenient functions commonly found in PCB design software
packages.

7.2

Circuit Assembly

The PCB was completely fabricated by myself. The process required a lot of trial
and error, and it took a full week to get right. The pin pitch on the transceiver chip was
only 0.62mm A photoetching process was used. All components were hand soldered, and
assembled. Figures 7.2.1, and 7.2.2 describe the assembled PCB construction.

12

8.0

Firmware Description

8.1

Memory Usage

8.1.1

Program Flash

The PIC16F877 contains 8Kwords of 14-bit program flash. Accordingly, all program data is
stored in this area.

8.1.2

Data RAM

The Microcontroller also contains 365 bytes of data RAM. Several of these locations were
used as loop counters, and as general purpose registers.

8.1.3

Internal EEPROM

The 256 bytes of internal EEPROM were used only when programming the external
EEPROM. Bootstrap firmware was designed for this purpose, and is described under the
Programming section of this report.

13

8.1.4

External EEPROM

The external serial EEPROM was used to store all display data. Due to the large amount of
data required for both test and graphics, an external memory was required.

8.2

Display Data Format

The display data is stored in the sequential format with which it is written to the display. This
includes all commands, addressing, and data information. Because each byte required a control/data
designation, the data was segmented into 10 byte packets. The format of these packets is described in
figure 8.2.1. The first two bytes of each packet comprise a header, and the following 8 bytes are data.
Packet
Header

Figure 8.2.1

VALID DATA
DATA/CONTROL
0

Each bit in the first header byte is aligned with a respective data byte, and designates weather
the byte is valid. This is used by the display write loop, to determine the end of the sequential read
operation. When the loop encounters a 0 value for a respective byte, the write sequence is
terminated. In this way, write sequences of variable length can be realized.
The second byte of the header is likewise aligned with its respective data byte, and
designates weather the byte is control or data. The display control signals are energized accordingly.
A full display write is made up of a long sequence of packets. These sequences are stored in
the external EEPROM, and separated into pages. Because each graphical background uses a huge
amount of memory, all text foregrounds share only two backgrounds. Each foreground or background
is allotted one or more 256 byte memory block. Appendix 10.4 lists the contents of the external
EEPROM. From this it can be seen that each background takes up about 6 blocks (or 1.5K) of
memory. Each text foreground takes up only 1 block.
In order to establish the functions of each pushbutton, for each foreground, a link table is
included at the beginning of the block. This link table holds the link address of next display for each
menu. Also, so that the correct background may be displayed for each foreground, the address of the
respective background is also stored in the link table.

8.3

Transceiver Protocol

Although the transceiver section of the circuit was not fully implemented, the display data
format is ideal as a transceiver protocol. The base station device contains all display data, and the
remote device acts as a slave, sending control signals, and waiting for display data. Display data is
transmitted form the base station device, in the same 10 byte packet format. In this way, the display
data can be altered at the base station only, and the remote device will adapt accordingly.

8.4

Flowchart/Description

14

The flowchart of figure 8.4.1 describes basic operation of the application firmware. The
flowchart represents only the most basic functions of the program, as all red/write loops, timing,
delays, and addressing have been omitted. The flowchart should however provide enough background
to interpret the well annotated assembly code included in appendix 10.2.
A large portion of the program is simply initialization. This is due to the large number of
ports and devices which need to be configured. The display itself requires that about 50 bytes be
written to it to initialize everything from scrolling, to memory addressing space. The display reset and
power up must follow a specific sequence to avoid display damage. The high voltage LCD bias must
not be applied until the display has had a chance to write to its LCD drivers.
The basic flow of the actual main program is apparent, upon examination of the flowchart.
Keep in mind that each process block on the flow chart could represent up to 100 lines of complex
loops, and counters.
Upon reset, the peripherals are initialized, an the display is written with data for the first
screen. This process includes copying the foregrounds link table to a more convenient location in
RAM. This allows for each user pushbutton depression to link to the successive display image.
The data each display write is simultaneously Manchester encoded, and sent to the
transceiver. Complex timing had to be implemented, in order to maintain a 8Kb/s data rate while
processing interior and exterior memory read loops, which were different in length.
At the end of each write sequence, a pushbutton depression is waited for. Once this occurs,
the respective address is looked up from the current link table, and the display write process restarts.

9.0

Programming

9.1

Development Tools

One of the attractive characteristics of the PIC16F877, is the full set of development tools
provided by Microchip. A programming/debugging tool was purchased as part of this package, at a
price of $240. This tool allowed program breakpoints, single stepping, halting, and register
monitoring. All of these features proved very useful.
The Microchip software package, likewise, was very efficient. It allowed assembly code
editing, compiling, and debugging. Programming was provided by the programming/debugging
module, through Microchips proprietary In Circuit Serial Programming protocol.

9.2

Programming the Serial EEPROM

Through the development package, all internal memory of the microcontroller could be
monitored and modified. The external serial EEPROM, however, could not be modified through the
development tools. It was, however, required that all display data be programmed to this memory.
To complete this task, a full scale application was created. This firmware reads a block of the
external EEPROM to internal EEPROM, where it can be modified using the development tools, and
then written back. This is a tedious process, and required modification of the data in 256 byte blocks,
due to the size of the internal EEPROM.
A full assembly code listing for the EEPROM modifier Program is included in appendix 10.3.
Also, to give an idea of the amount of display data programmed, a full hexadecimal listing of all
EEPROM memory blocks is provided in appendix 10.4.

10.0 Appendices

15

10.1 PCB Layout


10.2 Program Assembly Code
10.3 EEPROM Modifier Assembly Code
10.4 Display Data Listing.
10.5 Invoices
10.6 Data Sheets

16

Das könnte Ihnen auch gefallen