Professional Documents
Culture Documents
CHAPTER ONE
INTRODUCTION
Overview
Background
Objective
Thesis
outline
Page 1
1. INTRODUCTION
The purpose of this project is to design and to create a persistence of vision(POV)
display. This display will allow users to upload an image to be displayed through wireless
communication. A persistence of vision (POV) refers to the phenomenon of the human eye in
which an after image exits for a brief time(10ms). A POV display exploits this phenomena by
spinning a one dimensional row of LEDs through a two dimensional space at such a high
frequency that a two dimensional display is visible.
1.1. Overview
Our project uses two standards, serial peripheral interface(SPI) and IEEE 802.11 for
our wireless radio communication. The standard for SPI consists of a 4-wire serial bus that
allows a master/slave communication mode. The wires are the following:
SCLK :
MOSI :
MISO :
SS
The IEEE 802.11 standard is for the wireless radio which is controlled by the FCC
regulations for radio frequency devices. This regulation can be found in title 47 part 15
section 243. Since our radio transceiver was designed within the FCC regulations, it meets all
the specifications noted in the section, especially the 500 microvolts/meter at 30 meters.
Our project does not include any exiting patents, copyrights or trademarks. Weve
designed all the hardware from scratch and all the software is our original work with some
assistance from classmates and professor land.
1.2. Background
The original idea for this project came from the brilliant mind of David Bjanes who has
many projects in his project queue. The inspiration came when david saw a video of a similar
POV display on youtube.com. Next we started brainstorming about the orientation of our
POV display. Some ideas we had seen oriented the display on a propeller or circular clock
ESWAR COLLEGE OF ENGINEERING
Page 2
1.3. Objective
The overall design of this project can be grouped in the following three categories:
electrical design, mechanical design and software design. The most labour intensive portion
of this project was the mechanical design. While the electrical schematics and software
design appear trivial, intregating the hardware with an adept firmware proved to the biggest
challenge of all. Mounting the electrical components onto the mechanical structure- i.e. the
spinning arm- was also quite a challenge. As one can forsee, the nature of our mechanical
design introduced various safety issues that we also had to take into consideration.
Page 3
CHAPTER TWO
Overview of the
Technologies Used
Embedded system
Bluetooth technology
Page 4
Page 5
2.1.2. Tools
As for other software, embedded system designers use compilers, assemblers, and
debuggers to develop embedded system software. However, they may also use some more
specific tools:
In circuit debuggers or emulators
Utilities to add a checksum or CRC to a program, so the embedded system can
particular hardware.
An embedded system may have its own special language or design tool, or add
system, which may have DSP capabilities like DSP nano RTOS.
Page 6
2.2.3 Requirements:
This makes Bluetooth communication much more flexible and robust. Its also
important to note that because Bluetooth excels at low-bandwidth data transfer, it is not
Page 7
Page 8
Page 9
2.2.9 ADVANTAGES:
It allows Bluetooth devices to use the entirety of the available ISM band, while never
transmitting from a fixed frequency for more than a very short time This ensures that
Bluetooth conforms to the ISM restrictions on transmission quantity per frequency.
It ensures that any interference will be short-lived. Any packet that doesn't arrive
safely at its destination can be resent at the next frequency.
It provides a base level of security because it's very difficult for an eavesdropping
device to predict which frequency the Bluetooth devices will use next. Of course, the
connected devices must agree upon the next frequency to use. The Bluetooth
specification. ensures this in two ways. First, it defines a master-slave relationship
between Bluetooth devices. Second, it specifies an algorithm that uses device-specific
information to calculate frequency-hop sequences.
A Bluetooth device operating in master mode can communicate with up to seven
slave devices. To each of its slaves, the master Bluetooth device sends its own unique device
address (similar to an ethernet address) and the value of its internal clock. This information is
used to calculate the frequency-hop sequence. Because the master device and all its slaves
use the same algorithm with the same initial input, the connected devices always arrive
together at the next frequency.
Page 10
2.2.11 Security
Security is a challenge faced by every communications standard. Wireless
communications present special security challenges. Bluetooth builds security into its model
on several different levels, beginning with the security inherent in its frequency-hopping
scheme (described in Frequency Hopping). At the lowest levels of the protocol stack,
Bluetooth uses the publicly available cipher algorithm known as SAFER+ to authenticate a
devices identity. The generic-access profile depends on this authentication for its devicepairing process. This process involves creating a special link to create and exchange a link
key. Once verified, the link key is used to negotiate an encryption mode the devices will use
for their communication. The topic of Bluetooth security is beyond the scope of this
document. For references that contain more information on Bluetooths encryption and
authentication processes.
Page 11
Lower Layers
At the base of the Bluetooth protocol stack is the radio layer. The radio module in a
Bluetooth device is responsible for the modulation and demodulation of data into RF signals
for transmission in the air. The radio layer describes the physical characteristics a Bluetooth
devices receiver-transmitter component must have. These include modulation characteristics,
radio frequency tolerance, and sensitivity level.
Above the radio layer is the baseband and link controller layer. The Bluetooth
specification doesnt establish a clear distinction between the responsibilities of the baseband
and those of the link controller. The best way to think about it is that the baseband portion of
the layer is responsible for properly formatting data for transmission to and from the radio
layer. In addition, it handles the synchronization of links. The link controller portion of this
layer is responsible for carrying out the link managers commands and establishing and
maintaining the link stipulated by the link manager.
The link manager itself translates the host controller interface (HCI) commands it
receives into baseband-level operations. It is responsible for establishing and configuring
links and managing power-change requests, among other tasks. Youve noticed links
mentioned numerous times in the preceding paragraphs. The Bluetooth specification defines
two types of links between Bluetooth devices:
Synchronous,
Connection-Oriented
(SCO),
for
isochronous
and
voice
Page 12
The HCI (host controller interface) layer acts as a boundary between the lower
layers of the Bluetooth protocol stack and the upper layers. The Bluetooth
specification defines a standard HCI to support Bluetooth systems that are
implemented across two separate processors. For example, a Bluetooth system on a
computer might use a Bluetooth modules processor to implement the lower layers of
the stack (radio, baseband, link controller, and link manager). It might then use its
own processor to implement the upper layers (L2CAP, RFCOMM, OBEX, and
selected profiles). In this scheme, the lower portion is known as the Bluetooth module
and the upper portion as the Bluetooth host. Of course, its not required to partition the
Bluetooth stack in this way. Bluetooth headsets, for example combine the module and
host portions of the stack on one processor because they need to be small and selfcontained. In such devices, the HCI may not be implemented at all unless device
testing is required.
Because the Bluetooth HCI is well defined, you can write drivers that handle different
Bluetooth modules from different manufacturers. Apple provides an HCI controller object
that supports a USB implementation of the HCI layer.
Upper layers
Above the HCI layer are the upper layers of the protocol stack. The first of these is the
L2CAP (logical link control and adaptation protocol) layer. The L2CAP is primarily
responsible for:
Establishing connections across existing ACL links or requesting an ACL link if one
does not already exist
Multiplexing between different higher layer protocols, such as RFCOMM and SDP, to
allow many different applications to use a single ACL link
Page 13
Repackaging the data packets it receives from the higher layers into the form expected
by the lower layers. The L2CAP employs the concept of channels to keep track of
where data packets come from and where they should go. You can think of a channel
as a logical representation of the data flow between the L2CAP layers in remote
devices. Because it plays such a central role in the communication between the upper
and lower layers of the Bluetooth protocol stack, the L2CAP layer is a required part of
every Bluetooth system.
Above the L2CAP layer, the remaining layers of the Bluetooth protocol stack arent
quite so linearly ordered. However, it makes sense to discuss the service discovery protocol
next, because it exists independently of other higher-level protocol layers. In addition, it is
common to every Bluetooth device.
The SDP (service discovery protocol) defines actions for both servers and clients of
Bluetooth services. The specification defines a service as any feature that is usable by another
(remote) Bluetooth device. A single Bluetooth device can be both a server and a client of
services. An example of this is the Macintosh computer itself. Using the file transfer profile a
Macintosh computer can browse the files on another device and allow other devices to
browse its files.
An SDP client communicates with an SDP server using a reserved channel on an
L2CAP link to find out what services are available. When the client finds the desired service,
it requests a separate connection to use the service. The reserved channel is dedicated to SDP
communication so that a device always knows how to connect to the SDP service on any
other device. An SDP server maintains its own SDP database, which is a set of service
records that describe the services the server offers.
Along with information describing how a client can connect to the service, the service
record contains the services UUID, or universally unique identifier.
Also above the L2CAP layer is the RFCOMM layer. The RFCOMM protocol
emulates the serial cable line settings and status of an RS-232 serial port. By providing serialport emulation, RFCOMM supports legacy serial-port applications. It also supports the
OBEX protocol and several of the Bluetooth profiles.
Page 14
Page 15
CHAPTER THREE
HARDWARE
IMPLEMENTATION OF
PROJECT
Page 16
The most labor intensive portion of this project was the mechanical design. While the
electrical schematics and software design appear trivial, integrating the hardware with an
adept firmware proved to the biggest challenge of all. Mounting the electrical components
ESWAR COLLEGE OF ENGINEERING
Page 17
MAX232
8 RED LEDs
1-9V battery
Page 18
3 16-bit Timer/Counters
Watchdog Timer
Power-off Flag
Page 19
Page 20
Page 21
VCC
Supply voltage.
GND
Ground
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1sare written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data
bus during accesses to external program and data memory. In this mode, P0 has internal pullups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes
during program verification. External pull-ups are required during program verification
Port 1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 Output
buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled
high by the internal pull-ups and can be used as inputs. In addition, P1.0 and P1.1 can be
configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2
trigger input P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives
the low-order address bytes during Flash programming and verification.
Port Pin
P1.0
P1.1
P1.5
P1.6
P1.7
Alternate Functions
T2(External Count input to Timer/Counter 2), clock-out
T2EX (Timer/ Counter 2 capture/reload trigger and direction control)
MOSI (used for In-system Programming)
MISO (used for In-system Programming)
SCK (used for In-system Programming)
Table 1: Functions of Port1
Port 2
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output
buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled
high by the internal pull-ups and can be used as inputs. Port 2 emits the high-order address
byte during fetches from external program memory and during accesses to external data
ESWAR COLLEGE OF ENGINEERING
Page 22
Port 3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output
buffers can sink/source four TTL inputs. When 1s are writt 1s are written to Port 3 pins, they
are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that
are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also
serves the functions of various special features of the AT89S52, as shown in the following
table. Port 3 also receives some control signals for Flash programming and verification.
Port Pin
P3.0
P3.1
P3.2
P3.3
P3.4
P3.5
P3.6
P3.7
Alternate Functions
RXD (serial input port)
TXD (serial output port)
INT0 (external interrupt 0)
INT1 (external interrupt 1)
T0 (timer 0 external input)
T1 (timer 1 external input)
WR (external data memory write strobe)
RD (external data memory read strobe)
Table2: Functions of Port3
RST
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
ALE/PROG
Address Latch Enable (ALE) is an output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program pulse input (PROG)
during Flash programming. In normal operation, ALE is emitted at a constant rate of1/6 the
oscillator frequency and may be used for external timing or clocking purposes. Note,
however, that one ALE pulse is skipped during each access to external data Memory. If
ESWAR COLLEGE OF ENGINEERING
Page 23
PSEN
Program Store Enable (PSEN) is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset. A should be
strapped to VCC for internal program executions. This pin also receives the 12voltProgramming enables voltage (VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Output from the inverting oscillator amplifier.
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
that can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an External clock source,
XTAL2 should be left unconnected while XTAL1 is driven.
Page 24
Accumulator:
The Accumulator, as its name suggests is used as a general register to accumulate the
results of a large number of instructions. It can hold 8-bit (1-byte) value and is the most
versatile register.
The R registers: The R registers are a set of eight registers that are named R0, R1.
Etc up to R7. These registers are used as auxiliary registers in many operations.
The B registers: The B register is very similar to the accumulator in the sense
that it may hold an 8-bit (1-byte) value. Two only uses the B register 8051 instructions:
MUL AB and DIV AB.
The Data Pointer: The Data pointer (DPTR) is the 8051s only user accessible 16-bit
(2Bytes) register. The accumulator, R registers are all 1-Byte values. DPTR, as the name
suggests, is used to point to data. It is used by a number of commands, which allow the 8051
to access external memory.
Page 25
Immediate Addressing
MOV A, #20 H
Direct Addressing
MOV A, 30 H
Indirect Addressing
MOV A, @R0
Indexed Addressing
a. External Direct
b. Code In direct
MOVX A, @DPTR
MOVC A, @A+DPTR
Immediate Addressing:
Immediate addressing is so named because the value to be stored in memory
immediately follows the operation code in memory. That is to say, the instruction itself
dictates what value will be stored in memory. For example, the instruction:
MOV A, #20H
This instruction uses immediate Addressing because the accumulator will be loaded
with the value that immediately follows in this case 20(hexadecimal). Immediate addressing
is very fast since the value to be loaded is included in the instruction. However, since the
value to be loaded is fixed at compile-time it is not very flexible.
Direct Addressing:
Direct addressing is so named because the value to be stored in memory is obtained
by directly retrieving it from another memory location.
For example: MOV A, 30h
Page 26
Indirect Addressing:
Indirect addressing is a very powerful addressing mode, which in many cases
provides an exceptional level of flexibility. Indirect addressing is also the only way to access
the extra 128 bytes of internal RAM found on the 8052. Indirect addressing appears as
follows:
MOV A, @R0:
This instruction causes the 8051 to analyze Special Function Register (SFR) Memory:
Special Function Registers (SFRs) are areas of memory that control specific
functionality of the 8051 processor. For example, four SFRs permit access to the 8051s 32
input/output lines. Another SFR allows the user to set the serial baud rate, control and access
timers, and configure the 8051s interrupt system.
Timer 2 Registers:
Control and status bits are contained in registers T2CON and T2MOD for
Timer 2 . The register pair (RCAP2H , RCAP2L) are the Capture / Reload registers for
Timer 2 in 16-bit capture mode or 16-bit auto-reload mode .
Interrupt Registers:
The individual interrupt enable bits are in the IE register . Two priorities can
be set for each of the six interrupt sources in the IP register.
Timer 2 is a 16-bit Timer / Counter that can operate as either a timer or an
event counter. The type of operation is selected by bit C/T2 in the SFR T2CON .
Timer 2 has three operating Modes : capture , auto-reload ( up or down Counting ) , and
baud rate generator . The modes are selected by bits in T2CON . Timer 2 consists of
ESWAR COLLEGE OF ENGINEERING
Page 27
TL2 register is
recognize
is 1 / 24 of the
oscillator frequency . To ensure that a given level is sampled at least once before
it changes , the level should be held for atleast
Symbol
EA
Position
IE.7
ET2
ES
ET1
EX1
ET0
EX0
IE.6
IE.5
IE.4
IE.3
IE.2
IE.1
IE.0
Function
Disables all interrupts. If EA=0, no interrupt is acknowledged. If
EA=1, each interrupt source is individually enabled or disabled by
setting or clearing its enable bit.
Reserved
Timer2 interrupt enable bit
Serial port interrupt enable bit
Timer1 interrupt enable bit
External interrupt1 enable bit
Timer0 interrupt enable bit
External interrupt0 enable bit
Table3: Interrupt Register Functions
Capture Mode
In the capture mode , two options are selected by bit EXEN2 in T2CON . If
EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2
in T2CON . This bit can then be used to generate an interrupt . If EXEN2 = 1 , Timer
2 performs the same operation , but a 1-to-0 transition at external input T2EX also
causes the current value
in TH2
and
TL2
Page 28
by setting
TCLK
and/or
RCLK in T2CON . Note that the baud rates for transmit and receive can be different
if Timer 2 is used for the receiver or transmitter and Timer 1 is used for the other
function .The baud rates in Modes 1 and 3 aredetermined by Timer 2s overflow rate
according to the following equation .
Modes 1 and 3 Baud Rates =Timer 2 Overflow Rate16
The timer operation is different for Timer 2 when it is used as a baud rate
generator .Normally ,as a timer , it increments every machine cycle (at 1/12 the
oscillator frequency).As a baud rate generator , however, it increments every state time (
at 1/2 the oscillator frequency ) .
Timer 0
Timer 0 functions as either a timer or event counter
in four
modes of
operation . Timer 0 is controlled by the four lower bits of the TMOD register and
bits 0, 1, 4 and 5 of the TCON register
Page 29
configures
timer 0
as
an
automatically reloads from the TH0 register . TL0 overflow sets TF0 flag in the
TCON register and reloads TL0
software .
mode is provided
timer or counter .
Timer 1
Timer 1 is identical to timer 0 , except for mode 3 , which is a hold-count
mode .
Mode 3 ( Halt )
Placing Timer 1 in mode 3 causes it to halt and hold its count . This can
be used to halt Timer 1 when TR1 run control bit is not available i.e. , when
Timer 0 is in mode 3 .
Baud Rates :
The baud rate in Mode 0 is fixed. The baud
frequency . If
SMOD = 1, the baud rate is 1/32 the oscillator frequency. In the 89S52 , the baud
rates in Modes 1 and 3 are determined by the Timer 1 overflow rate. In case of
Timer 2 , these baud rates can be determined by Timer 1 , or by Timer 2 , or by
both (one for transmit and the other for receive ).
Page 30
TCON REGISTER :
7
TF1
Bit
number
7
6
TR1
5
TF0
4
TR0
Bit
Mnumonic
TF1
3
IE1
2
IT1
1
IE0
0
IT0
Description
Timer 1 Overflow flag
Cleared by hardware when processor vectors to interrupt routine
Set by hardware on timer/counter overflow, when the timer1
register overflows
Timer1 Run Control Bit
Clear to turn off timer/counter 1
Set to turn on timer/counter 1
TR1
TF0
TR0
IE1
IT1
IE0
IT0
Page 31
TMOD REGISTER:
7
GATE1
6
C/T1#
Bit
Number
Bit
Mnumonic
GATE1
C/T1#
M11
M01
GATE0
C/T0#
M10
M00
5
M11
4
M01
3
GATE0
2
C/T0#
1
M10
0
M00
Description
Timer1 Gain Control Bit
Clear to enable timer1 whenever the TR1 bit is set
Set to enable timer1 only when the INT1#pin is high and TR1 bit is
set
Timer1 Counter/timer Select Bit
Clear for timer operation:Timer0 counts the divided-down system
clock
Set for counter operation:timer1 counts negative transitions on
external pin T1
Timer1 mode select bits
M11 M01 Operating mode
0
0 Mode0:8-bit timer/counter(TH1) wuth 8-bit prescaler(TL1)
0
1 Mode 1: 16-bit timer/counter
1
0 Mode2:8bit auto reload timer/countert(TL1).
1
1 Mode 3: Timer1 hacked. Retains count
Page 32
3.4. DC MOTORS
Industrial applications use dc motors because the speed-torque relationship can be
varied to almost any useful form for both dc motor and regeneration applications in either
direction of rotation. Continuous operation of dc motors is commonly available over a speed
range of 8:1. Infinite range (smooth control down to zero speed) for short durations or
reduced load is also common. Dc motors are often applied where they momentarily deliver
three or more times their rated torque. In emergency situations, dc motors can supply over
five times rated torque without stalling (power supply permitting). Dynamic braking (dc
motor-generated energy is fed to a resistor grid) or regenerative braking (dc motor-generated
energy is fed back into the dc motor supply) can be obtained with dc motors on applications
requiring quick stops, thus eliminating the need for, or reducing the size of, a mechanical
brake. Dc motors feature a speed, which can be controlled smoothly down to zero,
immediately followed by acceleration in the opposite direction without power circuit
switching. And dc motors respond quickly to changes in control signals due to the dc motor's
high ratio of torque to inertia. In any electric motor, operation is based on simple
electromagnetism. A current carrying conductor generates a magnetic field; when this is then
placed in an external magnetic field, it will experience a force proportional to the current in
the conductor, and to the strength of the external magnetic field. As you are well aware of
from playing with magnets as a kid, opposite (North and South) polarities attract, while like
polarities (North and North, South and South) repel. The internal configuration of a DC
motor is designed to harness the magnetic interaction between a current carrying conductor
and an external magnetic field to generate rotational motion. Let's start by looking at a simple
2-pole DC electric motor (here red represents a magnet or winding with a "North"
polarization, while green represents a magnet or winding with a "South" polarization).
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commentator, field magnet(s), and brushes. In most common DC motors (and all that
BEAMers will see), the external magnetic field is produced by high-strength permanent
magnets1. The stator is the stationary part of the motor this includes the motor casing, as well
as two or more permanent magnet pole pieces. The rotors (together with the axle and attached
commentator) rotate with respect to the stator. The rotor consists of windings (generally on a
core), the windings being electrically connected to the commentator. The above diagram
shows a common motor layout -- with the rotor inside the stator (field) magnets.
ESWAR COLLEGE OF ENGINEERING
Page 33
Page 34
Page 35
Basic principle:
Like a normal diode, the LED consists of a chip of semi conducting material
impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current
flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse
direction. Charge-carriers electrons and holes flow into the junction from electrodes with
different voltages. When an electron meets a hole, it falls into a lower energy level, and
releases energy in the form of a photon.
The wavelength of the light emitted, and therefore its color, depends on the band gap
energy of the materials forming the p-n junction. In silicon or germanium diodes, the
electrons and holes recombine by a non-radioactive transition which produces no optical
emission, because these are indirect band gap materials.
The materials used for the LED have a direct band gap with energies corresponding to
near-infrared, visible or near-ultraviolet light. LED development began with infrared and red
devices made with gallium arsenide. Advances in materials science have made possible the
production of devices with ever-shorter wavelengths, producing light in a variety of colors.
LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer
Page 36
Bar graph
Seven segment
Star burst
Dot matrix
Page 37
2 mm.
3 mm (T1).
5 mm(T1).
10 mm.
The encapsulation may also be clear or semi opaque to improve contrast and viewing angle.
There are three main categories of miniature single die LEDs:
Page 38
Page 39
3.5.3 Applications:
Automotive applications with LEDS
Instrument Panels & Switches, Courtesy Lighting, CHMSL, Rear Stop/Turn/Tai,
Retrofits, New Turn/Tail/Marker Lights.
Consumer electronics & general indication
Household appliances, VCR/DVD/ tereo/Audio/Video devices,
Toys/Games
Page 40
Page 41
Features:
Circuit connections:
A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is 3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins of
the uC chips, thus need a converter chip. A MAX232 chip has long been using in many uC
boards. It provides 2-channel RS232C port and requires external 10uF capacitors.
Fig 9. MAX232
Page 42
3.7 SWITCHES
A switch is a mechanical device used to connect and disconnect an electric circuit at
will. Switches cover a wide range of types, from subminiature up to industrial plant switching
megawatts of power on high voltage distribution lines. In applications where multiple
switching options are required (e.g., a telephone service).
The switch is referred to as a "gate" when abstracted to mathematical form. In the
philosophy of logic, operational arguments are represented as logic gates. The use of
electronic gates to function as a system of logical gates is the fundamental basis for the
computer i.e. a computer is a system of electronic switches which function as logical gates.
Page 43
In a multi-throw switch, there are two possible transient behaviors as you move from
one position to another. In some switch designs, the new contact is made before the old
contact is broken. This is known as make-before-break, and ensures that the moving contact
never sees an open circuit (also referred to as a shorting switch). The alternative is breakbefore-make, where the old contact is broken before the new one is made. This ensures that
the two fixed contacts are never shorted to each other. Both types of design are in common
use, for different applications.
Biased switches
The momentary push-button switch is a type of biased switch. In this contact is made
by spring. The most common type is a push-to-make switch, which makes contact when the
button is pressed and breaks when the button is released. A push-to-break switch, on the other
hand, breaks contact when the button is pressed and makes contact when it is released. An
example of a push-to-break switch is a button used to release a door held open by an
electromagnet. Changeover push button switches do exist but are even less common.
Mercury tilt switch
The mercury switch consists of a drop of mercury inside a glass bulb with 2 contacts.
The two contacts pass through the glass, and are connected by the mercury when the bulb is
tilted to make the mercury roll on to them. This type of switch performs much better than the
ESWAR COLLEGE OF ENGINEERING
Page 44
Toggle switches are actuated by a lever angled in one of two or more positions. The
common light switch used in household wiring is an example of a toggle switch. Most toggle
switches will come to rest in any of their lever positions, while others have an internal spring
mechanism returning the lever to a certain normal position, allowing for what is called
"momentary" operation.
ESWAR COLLEGE OF ENGINEERING
Page 45
Pushbutton switches are two-position devices actuated with a button that is pressed
and released. Most pushbutton switches have an internal spring mechanism returning the
button to its "out," or "unpressed," position, for momentary operation. Some pushbutton
switches will latch alternately on or off with every push of the button. Other pushbutton
switches will stay in their "in," or "pressed," position until the button is pulled back out. This
last type of pushbutton switches usually have a mushroom-shaped button for easy push-pull
action.
Selector switches are actuated with a rotary knob or lever of some sort to select one of
two or more positions. Like the toggle switch, selector switches can either rest in any of their
positions or contain spring-return mechanisms for momentary operation.
A joystick switch is actuated by a lever free to move in more than one axis of motion.
One or more of several switch contact mechanisms are actuated depending on which way the
lever is pushed, and sometimes by how far it is pushed. The circle-and-dot notation on the
ESWAR COLLEGE OF ENGINEERING
Page 46
These limit switches closely resemble rugged toggle or selector hand switches fitted
with a lever pushed by the machine part. Often, the levers are tipped with a small roller
bearing, preventing the lever from being worn off by repeated contact with the machine part.
Proximity switches sense the approach of a metallic machine part either by a magnetic
or high-frequency electromagnetic field. Simple proximity switches use a permanent magnet
to actuate a sealed switch mechanism whenever the machine part gets close (typically 1 inch
or less). More complex proximity switches work like a metal detector, energizing a coil of
wire with a high-frequency current, and electronically monitoring the magnitude of that
current. If a metallic part (not necessarily magnetic) gets close enough to the coil, the current
will increase, and trip the monitoring circuit. The symbol shown here for the proximity
switch is of the electronic variety, as indicated by the diamond-shaped box surrounding the
ESWAR COLLEGE OF ENGINEERING
Page 47
These switches sense the rotary speed of a shaft either by a centrifugal weight
mechanism mounted on the shaft, or by some kind of non-contact detection of shaft motion
such as optical or magnetic.
Gas or liquid pressure can be used to actuate a switch mechanism if that pressure is
applied to a piston, diaphragm, or bellows, which converts pressure to mechanical force.
Page 48
Page 49
CHAPTER FOUR
Firmware
Implementation of the
Project
Keil Compiler
Proload
Page 50
Page 51
Page 52
Page 53
Page 54
4.3 Proload:
Proload is software which accepts only hex files. Once the machine code is converted
into hex code, that hex code has to be dumped into the microcontroller and this is done by the
Proload. Proload is a programmer which itself contains a microcontroller in it other than the
one which is to be programmed. This microcontroller has a program in it written in such a
way that it accepts the hex file from the Keil compiler and dumps this hex file into the
microcontroller which is to be programmed. As the Proload programmer kit requires power
supply to be operated, this power supply is given from the power supply circuit designed
above. It should be noted that this programmer kit contains a power supply section in the
board itself but in order to switch on that power supply, a source is required. Thus this is
accomplished from the power supply board with an output of 12volts.
Page 55
4.3.1 Features:
1. Supports major Atmel 89 series devices
2. Auto Identify connected hardware and devices
3. Error checking and verification in-built
4. Lock of programs in chip supported to prevent program copying
5. 20 and 40 pin ZIF socket on-board
6. Auto Erase before writing and Auto Verify after writing
Informative status bar and access to latest programmed file
1. Simple and Easy to use
2. Works on 57600 speed
4.3.2 Description:
It is simple to use and low cost, yet powerful flash microcontroller programmer for
the Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and
Blank Check. All fuse and lock bits are programmable. All devices have signature bytes that
the programmer reads to automatically identify the chip. No need to select the device type,
just plug it in and go! All devices also have a number of lock bits to provide various levels of
software and programming protection. These lock bits are fully programmable using this
programmer. Lock bits are useful to protect the program to be read back from microcontroller
only allowing erase to reprogram the microcontroller. The programmer connects to a host
computer using a standard RS232 serial port.
Page 56
Page 57
CHAPTER 5
RESULTS AND DISCUSSION
5.1 Result
Our project met all our requirements laid out in our proposal. We were successfully
able to spin a one dimensional array of LEDs through a two dimensional space(a cylinder) at
a high enough frequency. We can successfully communicate wirelessly to the spinning
onboard microcontroller to update the display and change any of the pixels at any time.
Page 58
Page 59
CHAPTER 6
BIBLIOGRAPHY
1. The 8051 Micro controller and Embedded System by Muhammad Ali Mazidi,
Janice Gillispie Mazidi
2. The 8051 Micro controller Architecture, Programming & Applications by Kenneth
J.Ayala
3. Fundamentals of Micro processors and Micro computers by B.Ram
4. Micro processor Architecture, Programming & Applications by Ramesh S.Gaonkar
5. Electronic Components by D.V.Prasad
6. www.national.com
7. www.atmel.com
8. www.microsoftsearch.com
9. www.geocities.com
Page 60