PRIORITY MANAGEMENT FOR TRAFFIC SIGNAL USING HANDHELD DEVICE USING RF The main aim of the project is to design a system which will be helpful for the vehicles in the highly rush area. The purpose of the system is to help VIP person who are in emergency by clearing the traffic and giving the way to the vehicle using RF technology. This project consists of two parts RF Transmitter part and RF Receiver. Whenever VIP’s vehicle enters into heavy traffic jam area it will send signal to the controller by pressing key from the keypad which is connected to the controller. Controller will access this data and passes to the transmitter. RF transmitter sends this information to the Receiver part which is located at the traffic signal indicator. After receiving the data from the transmitter, receiver will indicate to the microcontroller that vehicle is located in that area. According to that receiver section will clear the traffic in desired way by indicating Green LED. Every system is automated in order to face new challenges in the present day situation. Automated systems have less manual operations, so that the flexibility, reliabilities are high and accurate. Hence every field prefers automated control systems. Especially in the field of electronics automated systems are doing better performance. Any automated system will work effectively if it access wirelessly. Here in this project we are going to
108
Embed
9.Priority Management for Traffic Signal Using Handheld Device Using RF
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
PRIORITY MANAGEMENT FOR TRAFFIC SIGNAL USING HANDHELD DEVICE USING RF
The main aim of the project is to design a system which will be helpful for the vehicles in the highly rush area. The purpose of the system is to help VIP person who are in emergency by clearing the traffic and giving the way to the vehicle using RF technology. This project consists of two parts RF Transmitter part and RF Receiver.
Whenever VIP’s vehicle enters into heavy traffic jam area it will send signal to the
controller by pressing key from the keypad which is connected to the controller.
Controller will access this data and passes to the transmitter.
RF transmitter sends this information to the Receiver part which is located at
the traffic signal indicator. After receiving the data from the transmitter, receiver will
indicate to the microcontroller that vehicle is located in that area. According to that
receiver section will clear the traffic in desired way by indicating Green LED.
Every system is automated in order to face new challenges in the present day
situation. Automated systems have less manual operations, so that the flexibility,
reliabilities are high and accurate. Hence every field prefers automated control systems.
Especially in the field of electronics automated systems are doing better performance.
Any automated system will work effectively if it access wirelessly. Here in this project
we are going to use RF communication for remote accessing of automated system.
Probably the most useful thing to know about the RF communication is that it is an
international standard communication.
RF communication works by creating electromagnetic waves at a source and
being able to pick up those electromagnetic waves at a particular destination. These
electromagnetic waves travel through the air at near the speed of light. The wavelength of
an electromagnetic signal is inversely proportional to the frequency; the higher the
frequency, the shorter the wavelength.
METHODOLOGY:
BLOCKDIAGRAM:
TRANSMITTER SECTION:
RECEIVER SECTION:
MICRO CONTROLLER
RF TRANSMITTER
POWER SUPPLY
KEYPAD
LCD
ENCODER
MICRO CONTROLLER 89C51
INTRODUCTION
A Micro controller consists of a powerful CPU tightly coupled with memory,
various I/O interfaces such as serial port, parallel port timer or counter, interrupt
controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog
converter, integrated on to a single silicon chip.
If a system is developed with a microprocessor, the designer has to go for external
memory such as RAM, ROM, EPROM and peripherals. But controller is provided all
these facilities on a single chip. Development of a Micro controller reduces PCB size and
cost of design.
One of the major differences between a Microprocessor and a Micro controller is that a
controller often deals with bits not bytes as in the real world application.
Intel has introduced a family of Micro controllers called the MCS-51.
The Major Features:
Compatible with MCS-51 products
MICRO CONTROLLER
RF RECEIVER LEDS
POWER SUPPLY
DECODER
4k Bytes of in-system Reprogrammable flash memory
Fully static operation: 0HZ to 24MHZ
Three level programmable clock
128 * 8 –bit timer/counters
Six interrupt sources
Programmable serial channel
Low power idle power-down modes
AT89C51 is 8-bit micro controller, which has 4 KB on chip flash memory, which
is just sufficient for our application. The on-chip Flash ROM allows the program memory
to be reprogrammed in system or by conventional non-volatile memory Programmer.
Moreover ATMEL is the leader in flash technology in today’s market place and hence
using AT 89C51 is the optimal solution.
AT89C51 MICROCONTROLLER ARCHITECTURE
The 89C51 architecture consists of these specific features:
Eight –bit CPU with registers A (the accumulator) and B
Sixteen-bit program counter (PC) and data pointer (DPTR)
Eight- bit stack pointer (PSW)
Eight-bit stack pointer (Sp)
Internal ROM or EPROM (8751) of 0(8031) to 4K (89C51)
Internal RAM of 128 bytes:
Thirty –two input/output pins arranged as four 8-bit ports:p0-p3
Two 16-bit timer/counters: T0 and T1
Full duplex serial data receiver/transmitter: SBUF
Control registers: TCON, TMOD, SCON, PCON, IP, and IE
Two external and three internal interrupts sources.
Oscillator and clock circuits.
Fig 3: Functional block diagram of micro controller
Types of memory:
The 89C51 have three general types of memory. They are on-chip memory,
external Code memory and external Ram. On-Chip memory refers to physically existing
memory on the micro controller itself. External code memory is the code memory that
resides off chip. This is often in the form of an external EPROM. External RAM is the
Ram that resides off chip. This often is in the form of standard static RAM or flash
RAM.
a) Code memory
Code memory is the memory that holds the actual 89C51 programs that is to be
run. This memory is limited to 64K. Code memory may be found on-chip or off-chip. It
is possible to have 4K of code memory on-chip and 60K off chip memory
simultaneously. If only off-chip memory is available then there can be 64K of off chip
ROM. This is controlled by pin provided as EA.
b) Internal RAM
The 89C51 have a bank of 128 of internal RAM. The internal RAM is found on-
chip. So it is the fastest Ram available. And also it is most flexible in terms of reading
and writing. Internal Ram is volatile, so when 89C51 is reset, this memory is cleared. 128
bytes of internal memory are subdivided. The first 32 bytes are divided into 4 register
banks. Each bank contains 8 registers. Internal RAM also contains 128 bits, which are
addressed from 20h to 2Fh. These bits are bit addressed i.e. each individual bit of a byte
can be addressed by the user. They are numbered 00h to 7Fh. The user may make use of
these variables with commands such as SETB and CLR.
Flash memory is a nonvolatile memory using NOR technology, which allows the
user to electrically program and erase information. Flash memory is used in digital
cellular phones, digital cameras, LAN switches, PC Cards for notebook computers,
digital set-up boxes, embedded controllers, and other devices.
Fig 5: - Pin diagram of AT89C51
Pin Description:
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 may 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 pull-ups. 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. As inputs, Port 1 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and
verification.
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. As inputs, Port 2 pins that
are externally being pulled low will source current (IIL) because of the internal pull-ups.
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 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 AT89C51 as listed
below:
Tab 6.2.1 Port pins and their alternate functions
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 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 of 1/6the
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 desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the
bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if the micro controller is in
external execution mode.
PSEN:
Program Store Enable is the read strobe to external program memory. When the
AT89C51 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. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming, for
parts that require 12-volt VPP.
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, which can be configured for use as an on-chip oscillator, as shown in Figs 6.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 as
shown in Figure 6.2. There are no requirements on the duty cycle of the external clock
signal, since the input to the internal clocking circuitry is through a divide-by-two flip-
flop, but minimum and maximum voltage high and low time specifications must be
This section is basically used to transmit and receive the data wirelessly. The
devices used to do the same are RF Transmitter and RF Receiver.
RF transmitter:
RF transmitters are electronic devices that create continuously varying electric current,
encode sine waves, and broadcast radio waves. RF transmitters use oscillators to create
sine waves, the simplest and smoothest form of continuously varying waves, which
contain information such as audio and video. Modulators encode these sign wives and
antennas broadcast them as radio signals. There are several ways to encode or modulate
this information, including amplitude modulation (AM) and frequency modulation (FM).
Radio techniques limit localized interference and noise. With direct sequence spread
spectrum, signals are spread over a large band by multiplexing the signal with a code or
signature that modulates each bit. With frequency hopping spread spectrum, signals move
through a narrow set of channels in a sequential, cyclical, and predetermined pattern.
Selecting RF transmitters requires an understanding of modulation methods
such as AM and FM. On-off key (OOK), the simplest form of modulation, consists of
turning the signal on or off. Amplitude modulation (AM) causes the baseband signal to
vary the amplitude or height of the carrier wave to create the desired information content.
Frequency modulation (FM) causes the instantaneous frequency of a sine wave carrier to
depart from the center frequency by an amount proportional to the instantaneous value of
the modulating signal. Amplitude shift key (ASK) transmits data by varying the
amplitude of the transmitted signal. Frequency shift key (FSK) is a digital modulation
scheme using two or more output frequencies. Phase shift key (PSK) is a digital
modulation scheme in which the phase of the transmitted signal is varied in accordance
with the base band data signal.
Additional considerations when selecting RF transmitters include supply
voltage, supply current, RF connectors, special features, and packaging. Some RF
transmitters include visual or audible alarms or LED indicators that signal operating
modes such as power on or reception. Other devices attach to coaxial cables or include a
connector or port to which an antenna can be attached. Typically, RF transmitters that are
rated for outdoor use feature a heavy-duty waterproof design. Devices with internal
calibration and a frequency range switch are also available.
RF transmitters are used in a variety of applications and industries. Often,
devices that are used with integrated circuits (ICs) incorporate surface mount technology
(SMT), Through Hole Technology (THT), and flat pack. In the telecommunications
industry, RF transmitters are designed to fit in a metal rack that can be installed in a
cabinet. RF transmitters are also used in radios and in electronic article surveillance
systems (EAS) found in retail stores. Inventory management systems use RF transmitters
as an alternative to barcodes.
ASK Transmitter Module (ST-TX01-ASK (Saw Type)
General Description:
The ST-TX01-ASK is an ASK Hybrid transmitter module. ST-TX01-ASK are
designed by the Saw Resonator, with an effective low cost, small size, and simple-to-use
for designing.
Frequency Range: 315 / 433.92 MHZ.
Supply Voltage: 3~12V.
Output Power: 4~16dBm.
Circuit Shape: Saw.
315/434 MHz ASK TRANSMITTER
Applications
*Wireless security systems
*Car Alarm systems
*Remote controls.
*Sensor reporting
*Automation systems
Here in this project the RF transmitter module is not directly connected to
microcontroller. An Encoder is connected between the RF module and the controller, in
order to encode the data for efficient transmission of the data.
RF Receiver:
RF receivers are electronic devices that separate radio signals from one another
and convert specific signals into audio, video, or data formats. RF receivers use an
antenna to receive transmitted radio signals and a tuner to separate a specific signal from
all of the other signals that the antenna receives. Detectors or demodulators then extract
information that was encoded before transmission. There are several ways to decode or
demodulate this information, including amplitude modulation (AM) and frequency
modulation (FM). Radio techniques limit localized interference and noise. With direct
sequence spread spectrum, signals are spread over a large band by multiplexing the signal
with a code or signature that modulates each bit. With frequency hopping spread
spectrum, signals move through a narrow set of channels in a sequential, cyclical, and
predetermined pattern.
Selecting RF receivers requires an understanding of modulation methods such
as AM and FM. On-off key (OOK), the simplest form of modulation, consists of turning
the signal on or off. Amplitude modulation (AM) causes the base band signal to vary the
amplitude or height of the carrier wave to create the desired information content.
Frequency modulation (FM) causes the instantaneous frequency of a sine wave carrier to
depart from the center frequency by an amount proportional to the instantaneous value of
the modulating signal. Amplitude shift key (ASK) transmits data by varying the
amplitude of the transmitted signal. Frequency shift key (FSK) is a digital modulation
scheme using two or more output frequencies. Phase shift key (PSK) is a digital
modulation scheme in which the phase of the transmitted signal is varied in accordance
with the base band data signal.
RF receivers vary in terms of performance specifications such as sensitivity,
digital sampling rate, measurement resolution, operating frequency, and communication
interface. Sensitivity is the minimum input signal required to produce a specified output
signal having a specified signal-to-noise (S/N) ratio. Digital sampling rate is the rate at
which samples can be drawn from a digital signal in kilo samples per second.
Measurement resolution is the minimum digital resolution, while operating frequency is
the range of received signals. Communication interface is the method used to output data
to computers. Parallel interfaces include general-purpose interface bus (GPIB), which is
also known as IEEE 488 and HPIB Protocol. Serial interfaces include universal serial bus
(USB), RS232, and RS485.
Additional considerations when selecting RF receivers include supply voltage,
supply current, receiver inputs, RF connectors, special features, and packaging. Some RF
receivers include visual or audible alarms or LED indicators that signal operating modes
such as power on or reception. Other devices attach to coaxial cables or include a
connector or port to which an antenna can be attached. Typically, RF receivers that are
rated for outdoor use feature a heavy-duty waterproof design. Devices with internal
calibration and a frequency range switch are also available.
Description:
The RX04 is a low-power ASK Receiver IC which is fully compatible with the
Mitel KESRX01 IC and is suitable for use in a variety of low power radio applications
including remote keyless entry. The RX04 is based on a single-conversion, super-
heterodyne receiver architecture and incorporates an entire phase-locked loop (PLL) for
precise local oscillator generation.
Applications:
Car security system
Wireless security systems
Sensor reporting
automation system
Remote Keyless entry
Features
Low power consumption.
Easy for application.
On-Chip VCO with integrated PLL using crystal oscillator reference.
Integrated IF and data filters.
Operation temperature range : 10﹣ ℃~+60℃
Operation voltage: 5 Volts.
Available frequency at : 315/434 MHz
Functional description:
315/434 MHz ASK RECEIVER
PIN DIAGRAM
Fig: RF receiver module.
In this RF receiver is connected as shown in the schematic. The DATA pin is
connected to the decoder HT648L which decodes the received signal and gives to the
microcontroller.
ENCODER and DECODER Sections
The Encoders are the devices which are used to encode the data where the
Decoder is the device which is quite opposite to the Encoder. The Encoder used in the
project are HT12E and Decoder is HT 12D.
HT 12E as RF encoder, HT 12D as RF decoder
The radio frequency spectrum is filled with noise and other signals, especially
those frequencies where unlicensed transmitter operation under FCC part 15 rules is
allowed. When using a wireless remote control system it is desirable to have a way of
filtering out or ignoring those unwanted signals to prevent false data from being received.
A simple way to accomplish this is to use an encoder IC at the transmitter and a
decoder IC at the receiver. The encoder generates serial codes that are automatically sent
three times and must be received at least twice before data is accepted as valid by the
decoder circuit and the information is being decoded using decoder circuitry.
HT12A/HT12E/212Series of Encoders
General Description:
The 2^12 encoders are a series of CMOS LSIs for remote control system
applications. They are capable of encoding information which consists of N address bits
and 12-N data bits. Each ad- dress/data input can be set to one of the two logic states. The
programmed addresses/data are transmitted together with the header bits via an RF or an
infrared transmission medium upon receipt of a trigger signal. The capability to select a
TE trigger on the HT12E or a DATA trigger on the HT12A further enhances the
application flexibility of the 212 series of encoders. The HT12A additionally provides a
38 kHz carrier for infrared systems.
Minimum transmission word
- Four words for the HT12E
- One word for the HT12A
Built-in oscillator needs only 5% resistor
Data code has positive polarity
Minimal external components
HT12A/E: 18-pin DIP/20-pin SOP package
Features Operating voltage
2.4V~5V for the HT12A
2.4V~12V for the HT12E
Low power and high noise immunity CMOS
technology
Low standby current: 0.1mA (type.) at
VDD=5V
HT12A with a 38kHz carrier for infrared
transmission medium
Applications Burglar alarm system
Smoke and fire alarm system
Garage door controllers
Car door controllers
Car alarm system
Security system
Cordless telephones
Other remote control systems
HT12D/HT12F/212Series of Decoders
The 212decoders are a series of CMOS LSI’s for remote
control system applications. They are paired with Holtek’s 212series of encoders (refer to
the encoder/de-coder cross reference table). For proper operation, a pair of
encoder/decoder with the same number of ad-dresses and data format should be chosen.
The decoders receive serial addresses and data from a programmed 212series of encoders
that are transmitted by a carrier using an RF or an IR transmission medium. They
compare the serial input data three times continuously with their local addresses. If no
error or un-matched codes are found, the input data codes are decoded and then
transferred to the output pins. The VT pin also goes high to indicate a valid transmission.
The 212series of decoders are capable of decoding information that consist of N bits of
address and 12-Nbits of data. Of this series, the HT12D is arranged to pro-vide 8 address
bits and 4 data bits, and HT12F is used to decode 12 bits of address information.
Features
Operating voltage: 2.4V~12V
Low power and high noise immunity CMOS technology
Low standby current
Capable of decoding 12 bits of information
Binary address setting
Received codes are checked 3 times
Address/Data number combination
HT12D: 8 address bits and 4 data bits
HT12F: 12 address bits only
Built-in oscillator needs only 5% resistor
Valid transmission indicator
Easy interface with an RF or an infrared transmission medium
Minimal external components
Pair with Holtek’s 212series of encoders
18-pin DIP, 20-pin SOP package
Applications:
Burglar alarm system
Smoke and fire alarm system
Garage door controllers
Car door controllers
Car alarm system
Security system
Cordless telephones
Other remote control systems
LINEAR KEYPAD
This section basically consists of a Linear Keypad. Basically a Keypad can be classified
into 2 categories. One is Linear Keypad and the other is Matrix keypad.
1. Matrix Keypad.
2. Linear Keypad.
1. Matrix Keypad: This Keypad got keys arranged in the form of Rows and
Columns. That is why the name Matrix Keypad. According to this keypad, In
order to find the key being pressed the keypad need to be scanned by making
rows as i/p and columns as output or vice versa.
This Keypad is used in places where one needs to connect more
no. of keys with less no. of data lines.
2. Linear Keypad: This Keypad got ‘n’ no. of keys connected to ‘n’ data lines of
RF encoder.
This Keypad is used in places where one needs to connect less no.
of keys.
Generally, in Linear Keypads one end of the switch is connected to encoder
(Configured as i/p) and other end of the switch is connected to the common ground.
So whenever a key of Linear Keypad is pressed the logic on the microcontroller pin
will go LOW.
Here in this project, a linear keypad is used with switches connected in a serial
manner. Linear keypad is used in this project because it takes less no. of port pins. The
Linear Keypad with 4 Keys is shown below.
Liquid crystal display
Liquid crystal displays (LCDs) have materials, which combine the properties of
both liquids and crystals. Rather than having a melting point, they have a temperature
range within which the molecules are almost as mobile as they would be in a liquid, but
are grouped together in an ordered form similar to a crystal.
An LCD consists of two glass panels, with the liquid crystal material sand
witched in between them. The inner surface of the glass plates are coated with transparent
electrodes which define the character, symbols or patterns to be displayed polymeric
layers are present in between the electrodes and the liquid crystal, which makes the liquid
crystal molecules to maintain a defined orientation angle.
One each polarisers are pasted outside the two glass panels. These polarisers
would rotate the light rays passing through them to a definite angle, in a particular
direction.
When the LCD is in the off state, light rays are rotated by the two polarisers and
the liquid crystal, such that the light rays come out of the LCD without any orientation,
and hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal molecules
would be aligned in a specific direction. The light rays passing through the LCD would
be rotated by the polarisers, which would result in activating/ highlighting the desired
characters.
The LCD’s are lightweight with only a few millimeters thickness. Since the
LCD’s consume less power, they are compatible with low power electronic circuits, and
can be powered for long durations.
The LCD’s don’t generate light and so light is needed to read the display. By
using backlighting, reading is possible in the dark. The LCD’s have long life and a wide
operating temperature range.
Changing the display size or the layout size is relatively simple which makes the
LCD’s more customers friendly.
The LCDs used exclusively in watches, calculators and measuring instruments are
the simple seven-segment displays, having a limited amount of numeric data. The recent
advances in technology have resulted in better legibility, more information displaying
capability and a wider temperature range. These have resulted in the LCDs being
extensively used in telecommunications and entertainment electronics. The LCDs have
even started replacing the cathode ray tubes (CRTs) used for the display of text and
graphics, and also in small TV applications.
This section describes the operation modes of LCD’s then describe how to
program and interface an LCD to 8051 using Assembly and C.
LCD operationIn recent years the LCD is finding widespread use replacing LEDs(seven-segment
LEDs or other multisegment LEDs).This is due to the following reasons:
1. The declining prices of LCDs.
2. The ability to display numbers, characters and graphics. This is in
contract to LEDs, which are limited to numbers and a few characters.
3. Incorporation of a refreshing controller into the LCD, there by
relieving the CPU of the task of refreshing the LCD. In the contrast,
the LED must be refreshed by the CPU to keep displaying the data.
4. Ease of programming for characters and graphics.
LCD pin description The LCD discussed in this section has 14 pins. The function of each pins is given
in table.
TABLE 1:Pin description for LCD:
Pin symbol I/O Description
1 Vss -- Ground
2 Vcc -- +5V power supply
3 VEE -- Power supply to
control contrast
4 RS I RS=0 to select
command register
RS=1 to select
data register
5 R/W I R/W=0 for write
R/W=1 for read
6 E I/O Enable
7 DB0 I/O The 8-bit data bus
8 DB1 I/O The 8-bit data bus
9 DB2 I/O The 8-bit data bus
10 DB3 I/O The 8-bit data bus
11 DB4 I/O The 8-bit data bus
12 DB5 I/O The 8-bit data bus
13 DB6 I/O The 8-bit data bus
14 DB7 I/O The 8-bit data bus
TABLE 2: LCD Command Codes Code
(hex)
Command to LCD Instruction
Register
1 Clear display screen
2 Return home
4 Decrement cursor
6 Increment cursor
5 Shift display right
7 Shift display left
8 Display off, cursor off
A Display off, cursor on
C Display on, cursor off
E Display on, cursor on
F Display on, cursor blinking
10 Shift cursor position to left
14 Shift cursor position to right
18 Shift the entire display to the left
1C Shift the entire display to the right
80 Force cursor to beginning of 1st line
C0 Force cursor to beginning of 2nd line
38 2 lines and 5x7 matrix
Uses:
The LCDs used exclusively in watches, calculators and measuring
instruments are the simple seven-segment displays, having a limited amount of numeric
data. The recent advances in technology have resulted in better legibility, more
information displaying capability and a wider temperature range. These have resulted in
the LCDs being extensively used in telecommunications and entertainment electronics.
The LCDs have even started replacing the cathode ray tubes (CRTs) used for the display
of text and graphics, and also in small TV applications.
LCD INTERFACING
Sending commands and data to LCDs with a time delay:
Fig 21: Interfacing of LCD to a micro controller
To send any command from table 2 to the LCD, make pin RS=0.
for data, make RS=1.Then send a high –to-low pulse to the E pin to enable the internal latch of the LCD.
IGNITION SWITCH
The term ignition switch is often used interchangeably to refer to two very different parts: the lock cylinder into which the key is inserted, and the electronic switch that sits just behind the lock cylinder. In some cars, these two parts are combined into one unit, but in other cars they remain separate. It is advisable to check your car's shop manual before attempting to purchase an ignition switch, to ensure that you buy the correct part.
In order to start a car, the engine must be turning. Therefore, in the days before ignition switches, car engines had to be turned with a crank on the front of the car in order to start them. The starter performs this same operation by turning the engine's flywheel, a large, flat disc with teeth on the outer edge. The starter has a gear that engages these teeth when it is powered, rapidly and briefly turning the flywheel, and thus the engine.
The ignition switch generally has four positions: off, accessories, on, and start. Some cars have two off positions, off and lock; one turns off the car, and the other allows the key to be removed from the ignition. When the key is turned to the accessories position, certain accessories, such as the radio, are powered; however, accessories that use too much battery power, such as window motors, remain off in order to prevent the car's battery from being drained. The accessories position uses the least amount of battery power when the engine is not running, which is why drive-in movie theaters recommend that the car be left in the accessories mode during the movie.
The on position turns on all of the car's systems, including systems such as the fuel pump, because this is the position the ignition switch remains in while the car's engine is running. The start position is spring loaded so that the ignition switch will not remain there when the key is released. When the key is inserted into the ignition switch lock cylinder and turned to the start position, the starter engages; when the key is released, it returns to the on position, cutting power to the starter. This is because the engine runs at speeds that the starter cannot match, meaning that the starter gear must be retracted once the engine is running on its own.
Either the ignition switch or the lock cylinder may fail in a car, but both circumstances have very different symptoms. When the ignition switch fails, generally the electrical wiring or the plastic housing develops problems. The car may not turn on and/or start when this happens. Also, the spring-loaded start position could malfunction, in which case the starter will not engage unless the key is manually turned back to the on position.
When the lock cylinder malfunctions, however, the operation of the key itself will become problematic. If the tumblers become stripped, the lock cylinder may be able to turn with any key, or you may be able to remove the key when the car is on. If the tumblers begin to shift, the lock cylinder may not turn. Sometimes the key can be wiggled until the lock cylinder turns, but it is important to remember that this is only a temporary fix
MAX-232:
The MAX232 from Maxim was the first IC which in one package contains the necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry. Circuitry designers no longer need to design and build a power supply with three voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a simple 78x05 voltage converter.
The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the MAX232A is much more often used (and easier to get) than the original MAX232, and the MAX232A only needs external capacitors 1/10th the capacity of what the original MAX232 needs.
It should be noted that the MAX 232(A) is just a driver/receiver. It does not generate the necessary RS-232 sequence of marks and spaces with the right timing, it does not decode the RS-232 signal, it does not provide a serial/parallel conversion. All it does is to convert signal voltage levels. Generating serial data with the right timing and decoding serial data has to be done by additional circuitry, e.g. by a 16550 UART or one of these small micro controllers (e.g. Atmel AVR, Microchip PIC) getting more and more popular.
The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap. It has also helped that many companies now produce clones (ie. Sipex). These clones sometimes need different external circuitry, e.g. the capacities of the external capacitors vary. It is recommended to check the data sheet of the particular manufacturer of an IC instead of relying on Maxim's original data sheet.
The original manufacturer (and now some clone manufacturers, too) offers a large series of similar ICs, with different numbers of receivers and drivers, voltages, built-in or external capacitors, etc. E.g. The MAX232 and MAX232A need external capacitors for the internal voltage pump, while the MAX233 has these capacitors built-in. The MAX233 is also between three and ten times more expensive in electronic shops than the MAX232A because of its internal capacitors. It is also more difficult to get the MAX233 than the garden variety MAX232A.
A Typical Application
The MAX 232(A) has two receivers (converts from RS-232 to TTL voltage levels) and two drivers (converts from TTL logic to RS-232 voltage levels). This means only two of the RS-232 signals can be converted in each direction. The old MC1488/1498 combo provided four drivers and receivers.
Typically a pair of a driver/receiver of the MAX232 is used for
TX and RX
And the second one for
CTS and RTS.
There are not enough drivers/receivers in the MAX232 to also connect the DTR, DSR, and DCD signals. Usually these signals can be omitted when e.g. communicating with a PC's serial interface. If the DTE really requires these signals either a second MAX232 is needed, or some other IC from the MAX232 family can be used (if it can be found in consumer electronic shops at all). An alternative for DTR/DSR is also given below.
Maxim's data sheet explains the MAX232 family in great detail, including the pin configuration and how to connect such an IC to external circuitry. This information can be used as-is in own design to get a working RS-232 interface. Maxim's data just misses
one critical piece of information: How exactly to connect the RS-232 signals to the IC. So here is one possible example:
MAX232 to RS232 DB9 Connection as a DCE
MAX232 Pin Nbr. MAX232 Pin Name Signal Voltage DB9 Pin
7 T2out CTS RS-232 7
8 R2in RTS RS-232 8
9 R2out RTS TTL n/a
10 T2in CTS TTL n/a
11 T1in TX TTL n/a
12 R1out RX TTL n/a
13 R1in TX RS-232 3
14 T1out RX RS-232 2
15 GND GND 0 5
In addition one can directly wire DTR (DB9 pin 4) to DSR (DB9 pin 6) without going through any circuitry. This gives automatic (brain dead) DSR acknowledgment of an incoming DTR signal.
Sometimes pin 6 of the MAX232 is hard wired to DCD (DB9 pin 1). This is not recommended. Pin 6 is the raw output of the voltage pump and inverter for the -10V voltage. Drawing currents from the pin leads to a rapid breakdown of the voltage, and as a consequence to a breakdown of the output voltage of the two RS-232 drivers. It is better to use software which doesn't care about DCD, but does hardware-handshaking via CTS/RTS only.
The circuitry is completed by connecting five capacitors to the IC as it follows. The MAX232 needs 1.0µF capacitors, the MAX232A needs 0.1µF capacitors. MAX232 clones show similar differences. It is recommended to consult the corresponding data sheet. At least 16V capacitor types should be used. If electrolytic or tantalic capacitors are used, the polarity has to be observed. The first pin as listed in the following table is always where the plus pole of the capacitor should be connected to.
MAX232(A) external Capacitors
Capacitor + Pin - Pin Remark
C1 1 3
C2 4 5
C3 2 16
C4 GND 6This looks non-intuitive, but because pin 6 ison -10V, GND gets the + connector, and not the -
C5 16 GND
The 5V power supply is connected to
+5V: Pin 16 GND: Pin 15
Features
Meet or Exceed TIA/EIA-232-F and ITURecommendation V.28 Operate With Single 5-V Power Supply Operate Up to 120 kbit/s Two Drivers and Two Receivers 30-V Input Levels Low Supply Current . . . 8 mA Typical Designed to be Interchangeable WithMaxim MAX232 ESD Protection Exceeds JESD 22
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments Lin ASIClibrary.
LIGHT EMITING DIODES
It is a semiconductor diode having radioactive recombination. It requires a definite
amount of energy to generate an electron-hole pair.
The same energy is released when an electron recombines with a hole. This released
energy may result in the emission of photon and such a recombination. Hear the amount
of energy released when the electro reverts from the conduction band to the valence band
appears in the form of radiation. Alternatively the released energy may result in a series
of phonons causing lattice vibration. Finally the released energy may be transferred to
another electron. The recombination radiation may be lie in the infra-red and visible light
spectrum. In forward is peaked around the band gap energy and the phenomenon is called
injection luminescence. I n a junction biased in the avalanche break down region , there
results a spectrum of photons carrying much higher energies . Almost White light then
gets emitted from micro-plasma breakdown region in silicon junction. Diodes having
radioactive recombination are termed as Light Emitting Diode, abbreviated as LEDs.
In gallium arsenide diode, recombination is predominantly a radiation
recombination and the probability of this radio active recombination far exceeds that in
either germanium or silicon . Hence Ga As LED has much higher efficiency in terms of
Photons emitted per carrier. The internal efficiency of Ga As LED may be very close to
100% but because of high index of refraction, only a small fraction of the internal
radiation can usually come out of the device surface. In spite of this low efficiency of
actually radiated light , these LEDs are efficiency used as light emitters in visual display
units and in optically coupled circuits, The efficiency of light generation increases with
the increase of injected current and with decreases in temperature. The light so
generated is concentrated near the junction since most of the charge carriers are obtained
within one diffusion length of the diode junction.
The following are the merits of LEDs over conventional incandescent and other types
of lamps
1. Low working voltages and currents
2. Less power consumption
3. Very fast action
4. Emission of monochromatic light
5. small size and weight
6. No effect of mechanical vibrations
7. Extremely long life
Typical LED uses a forward voltage of about 2V and current of 5 to 10mA.
GaAs LED produces infra-red light while red, green and orange lights are produced
by gallium arsenide phosphide (GaAs) and gallium phosphide(Gap) .
Light Emitting Diodes (LEDs)
Example: Circuit symbol:
Function
LEDs emit light when an electric current passes through them.
Connecting and soldering
LEDs must be connected the correct way round, the diagram may be labelled a or
+ for anode and k or - for cathode (yes, it really is k, not c, for cathode!). The cathode is
the short lead and there may be a slight flat on the body of round LEDs. If you can see
inside the LED the cathode is the larger electrode (but this is not an
official identification method).
LEDs can be damaged by heat when soldering, but the risk is small unless you are
very slow. No special precautions are needed for soldering most LEDs.
Testing an LED
Never connect an LED directly to a battery or power supply!
It will be destroyed almost instantly because too much current will pass through and burn
it out. LEDs must have a resistor in series to limit the current to a safe value, for quick
testing purposes a 1k resistor is suitable for most LEDs if your supply voltage is 12V or
less. Remember to connect the LED the correct way round!
Colors of LEDs
LEDs are available in red, orange, amber, yellow, green, blue and white. Blue and white
LEDs are much more expensive than the other colours.
The colour of an LED is determined by
the semiconductor material, not by the
colouring of the 'package' (the plastic
body). LEDs of all colours are available
in uncoloured packages which may be
diffused (milky) or clear (often described
as 'water clear'). The coloured packages are also available as diffused (the
standard(type)ortransparent.
The most popular type of tri-colour LED has a red and a green LED combined in
one package with three leads. They are called tri-colour because mixed red and green
light appears to be yellow and this is produced when both the red and green LEDs are
on.
The diagram shows the construction of a tri-colour LED. Note the different
lengths of the three leads. The centre lead (k) is the common cathode for both LEDs, the
outer leads (a1 and a2) are the anodes to the LEDs allowing each one to be lit
separately, or both together to give the third colour.
Bi-color LEDs
A bi- colour LED has two LEDs wired in 'inverse parallel' (one forwards, one backwards)
combined in one package with two leads. Only one of the LEDs can be lit at one time and
they are less useful than the tri-colour LEDs described above.
Sizes, Shapes and Viewing angles of LEDs
LEDs are available in a wide variety of sizes and shapes. The 'standard' LED has
a round cross-section of 5mm diameter and this is probably the best type for general use,
but 3mm round LEDs are also popular.
Round cross-section LEDs are frequently used and they are very easy to install on
boxes by drilling a hole of the LED diameter, adding a spot of glue will help to hold the
LED if necessary. LED clips are also available to secure LEDs in holes. Other cross-
section shapes include square, rectangular and triangular.
As well as a variety of colors, sizes and shapes, LEDs also vary in their viewing
angle. This tells you how much the beam of light spreads out. Standard LEDs have a
viewing angle of 60° but others have a narrow beam of 30° or less. Rapid Electronics
stock a wide selection of LEDs and their catalogue is a good guide to the range available.
Calculating an LED resistor value
An LED must have a resistor connected in series to limit the current through the
LED, otherwise it will burn out almost instantly.
The resistor value, R is given by
R = (VS - VL) / I
VS = supply voltage
VL = LED voltage (usually 2V, but 4V for blue and white LEDs)
I = LED current (e.g. 20mA), this must be less than the maximum permitted
If the calculated value is not available choose the nearest standard resistor value
which is greater, so that the current will be a little less than you chose. In fact you may
wish to choose a greater resistor value to reduce the current (to increase battery life for
example) but this will make the LED less bright.
Working out the LED resistor formula using Ohm's law
Ohm's law says that the resistance of the resistor, R = V/I,
where:
V = voltage across the resistor (= VS - VL in this case)
I = the current through the resistor
So R = (VS - VL) / I
Connecting LEDs in series
If you wish to have several LEDs on at the same time it may be possible to
connect them in series. This prolongs battery life by lighting several LEDs with the same
current as just one LED.
All the LEDs connected in series pass the same current so it is best if they are all
the same type. The power supply must have sufficient voltage to provide about 2V for
each LED (4V for blue and white) plus at least another 2V for the resistor. To work out a
value for the resistor you must add up all the LED voltages and use this for VL.
Avoid connecting LEDs in parallel
Connecting several LEDs in parallel with just one resistor shared between them is
generally not a good idea.
If the LEDs require slightly different voltages only the lowest voltage LED will
light and it may be destroyed by the larger current flowing through it. Although identical
LEDs can be successfully connected in parallel with one resistor this rarely offers any
useful benefit because resistors are very cheap and the current used is the same as
connecting the LEDs individually.
SOFTWARE DESCRIPTION
ABOUT SOFTWARE
Software used:*Keil software for c programming
ABOUT KEIL SOFTWARE:
It is possible to create the source files in a text editor such as Notepad, run the Compiler on each C source file, specifying a list of controls, run the Assembler on each Assembler source file, specifying another list of controls, run either the Library Manager or Linker (again specifying a list of controls) and finally running the Object-HEX Converter to convert the Linker output file to an Intel Hex File. Once that has been completed the Hex File can be downloaded to the target hardware and debugged. Alternatively KEIL can be used to create source files; automatically compile, link and covert using options set with an easy to use user interface and finally simulate or perform debugging on the hardware with access to C variables and memory. Unless you have to use the tolls on the command line, the choice is clear. KEIL Greatly simplifies the process of creating and testing an embedded application.
Projects:
The user of KEIL centers on “projects”. A project is a list of all the source files required to build a single application, all the tool options which specify exactly how to build the application, and – if required – how the application should be simulated. A project contains enough information to take a set of source files and generate exactly the binary code required for the application. Because of the high degree of flexibility required from the tools, there are many options that can be set to configure the tools to operate in a specific manner. It would be tedious to have to set these options up every time the application is being built; therefore they are stored in a project file. Loading the project file into KEIL informs KEIL which source files are required, where they are, and how to configure the tools in the correct way. KEIL can then execute each tool with the correct options. It is also possible to create new projects in KEIL. Source files are added to the project and the tool options are set as required. The project can then be saved to preserve the settings. The project is reloaded and the simulator or debugger started, all the desired windows are opened. KEIL project files have the extension Simulator/Debugger:
The simulator/ debugger in KEIL can perform a very detailed simulation of a micro controller along with external signals. It is possible to view the precise execution time of a single assembly instruction, or a single line of C code, all the way up to the entire application, simply by entering the crystal frequency. A window can be opened for each peripheral on the device, showing the state of the peripheral. This enables quick trouble shooting of mis-configured peripherals. Breakpoints may be set on either assembly instructions or lines of C code, and execution may be stepped through one
instruction or C line at a time. The contents of all the memory areas may be viewed along with ability to find specific variables. In addition the registers may be viewed allowing a detailed view of what the microcontroller is doing at any point in time. The Keil Software 8051 development tools listed below are the programs you use to compile your C code, assemble your assembler source files, link your program together, create HEX files, and debug your target program. µVision2 for Windows™ Integrated Development Environment: combines Project Management, Source Code Editing, and Program Debugging in one powerful environment. C51 ANSI Optimizing C Cross Compiler: creates relocatable object modules from
your C source code, A51 Macro Assembler: creates relocatable object modules from your 8051
assembler source code, BL51 Linker/Locator: combines relocatable object modules created by the compiler
and assembler into the final absolute object module, LIB51 Library Manager: combines object modules into a library, which may be used
by the linker, OH51 Object-HEX Converter: creates Intel HEX files from absolute object modules.
What's New in µVision3?
µVision3 adds many new features to the Editor like Text Templates, Quick Function Navigation, and Syntax Coloring with brace high lighting Configuration Wizard for dialog based startup and debugger setup. µVision3 is fully compatible to µVision2 and can be used in parallel with µVision2.
What is µVision3?
µVision3 is an IDE (Integrated Development Environment) that helps you write, compile, and debug embedded programs. It encapsulates the following components:
A project manager. A make facility. Tool configuration. Editor. A powerful debugger.
To help you get started, several example programs (located in the \C51\Examples, \C251\Examples, \C166\Examples, and \ARM\...\Examples) are provided.
HELLO is a simple program that prints the string "Hello World" using the Serial Interface.
MEASURE is a data acquisition system for analog and digital systems. TRAFFIC is a traffic light controller with the RTX Tiny operating system. SIEVE is the SIEVE Benchmark. DHRY is the Dhrystone Benchmark. WHETS is the Single-Precision Whetstone Benchmark.
Additional example programs not listed here are provided for each device architecture.
Building an Application in µVision2
To build (compile, assemble, and link) an application in µVision2, you must:1. Select Project -(forexample,166\EXAMPLES\HELLO\HELLO.UV2).2. Select Project - Rebuild all target files or Build target.
µVision2 compiles, assembles, and links the files in your project
Creating Your Own Application in µVision2
To create a new project in µVision2, you must:1. Select Project - New Project.2. Select a directory and enter the name of the project file.3. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device Database™.4. Create source files to add to the project.5. Select Project - Targets, Groups, Files. Add/Files, select Source Group1, and add
the source files to the project.6. Select Project - Options and set the tool options. Note when you select the target
device from the Device Database™ all special options are set automatically. You typically only need to configure the memory map of your target hardware. Default memory model settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
Debugging an Application in µVision2
To debug an application created using µVision2, you must:1. Select Debug - Start/Stop Debug Session.2. Use the Step toolbar buttons to single-step through your program. You may enter
G, main in the Output Window to execute to the main C function.3. Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.Starting µVision2 and Creating a ProjectµVision2 is a standard Windows application and started by clicking on the program icon. To create a new project file select from the µVision2 menuProject – New Project…. This opens a standard Windows dialog that asks youfor the new project file name.We suggest that you use a separate folder for each project. You can simply usethe icon Create New Folder in this dialog to get a new empty folder. Thenselect this folder and enter the file name for the new project, i.e. Project1.µVision2 creates a new project file with the name PROJECT1.UV2 which containsa default target and file group name. You can see these names in the ProjectWindow – Files.Now use from the menu Project – Select Device for Target and select a CPUfor your project. The Select Device dialog box shows the µVision2 devicedatabase. Just select the micro controller you use. We are using for our examples the Philips 80C51RD+ CPU. This selection sets necessary tooloptions for the 80C51RD+ device and simplifies in this way the tool Configuration Building Projects and Creating a HEX FilesTypical, the tool settings under Options – Target are all you need to start a newapplication. You may translate all source files and line the application with aclick on the Build Target toolbar icon. When you build an application withsyntax errors, µVision2 will display errors and warning messages in the OutputWindow – Build page. A double click on a message line opens the source fileon the correct location in a µVision2 editor window.
Once you have successfully generated your application you can start debugging.
After you have tested your application, it is required to create an Intel HEX file to download the software into an EPROM programmer or simulator. µVision2 creates HEX files with each build process when Create HEX files under Options for Target – Output is enabled. You may start your PROM programming utility after the make process when you specify the program under the option Run User Program #1.CPU Simulation:µVision2 simulates up to 16 Mbytes of memory from which areas can bemapped for read, write, or code execution access. The µVision2 simulator trapsand reports illegal memory accesses.In addition to memory mapping, the simulator also provides support for theIntegrated peripherals of the various 8051 derivatives. The on-chip peripheralsof the CPU you have selected are configured from the Device.Database selection:you have made when you create your project target. Refer to page 58 for moreInformation about selecting a device. You may select and display the on-chip peripheral components using the Debug menu. You can also change the aspects of each peripheral using the controls in the dialog boxes.Start Debugging:You start the debug mode of µVision2 with the Debug – Start/Stop DebugSession command. Depending on the Options for Target – DebugConfiguration, µVision2 will load the application program and run the startupcode µVision2 saves the editor screen layout and restores the screen layout of the last debug session. If the program execution stops, µVision2 opens aneditor window with the source text or shows CPU instructions in the disassembly window. The next executable statement is marked with a yellow arrow. During debugging, most editor features are still available. For example, you can use the find command or correct program errors. Program source text of your application is shown in the same windows. The µVision2 debug mode differs from the edit mode in the following aspects:_ The “Debug Menu and Debug Commands” described on page 28 areAvailable. The additional debug windows are discussed in the following._ The project structure or tool parameters cannot be modified. All buildCommands are disabled.
Disassembly WindowThe Disassembly window shows your target program as mixed source and assembly program or just assembly code. A trace history of previously executed instructions may be displayed with Debug – View Trace Records. To enable the trace history, set Debug – Enable/Disable Trace Recording. If you select the Disassembly Window as the active window all program step commands work on CPU instruction level rather than program source lines. You can select a text line and set or modify code breakpoints using toolbar buttons or the context menu commands.
You may use the dialog Debug – Inline Assembly… to modify the CPU instructions. That allows you to correct mistakes or to make temporary changes to the target program you are debugging.
Software components
About Keil
1. Click on the Keil u Vision Icon on Desktop
2. The following fig will appear
3. Click on the Project menu from the title bar
4. Then Click on New Project
5. Save the Project by typing suitable project name with no extension in u r own folder sited in either C:\ or D:\
6. Then Click on Save button above.
7. Select the component for u r project. i.e. Atmel……
8. Click on the + Symbol beside of Atmel
9. Select AT89C51 as shown below
10. Then Click on “OK”
11. The Following fig will appear
12. Then Click either YES or NO………mostly “NO”
13. Now your project is ready to USE
14. Now double click on the Target1, you would get another option “Source
group 1” as shown in next page.
15. Click on the file option from menu bar and select “new”
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
17. Now start writing program in either in “C” or “ASM”
18. For a program written in Assembly, then save it with extension “. asm” and
for “C” based program save it with extension “ .C”
19. Now right click on Source group 1 and click on “Add files to Group Source”
20. Now you will get another window, on which by default “C” files will appear.
21. Now select as per your file extension given while saving the file
22. Click only one time on option “ADD”
23. Now Press function key F7 to compile. Any error will appear if so happen.
24. If the file contains no error, then press Control+F5 simultaneously.
25. The new window is as follows
26. Then Click “OK”
27. Now Click on the Peripherals from menu bar, and check your required port as
shown in fig below
28. Drag the port a side and click in the program file.
29. Now keep Pressing function key “F11” slowly and observe.
30. You are running your program successfully
Embedded C:
Data Types:
U people have already come across the word “Data types” in C- Language. Here
also the functionality and the meaning of the word is same except a small change in the
prefix of their labels. Now we will discuss some of the widely used data types for
embedded C- programming.
Data Types Size in Bits Data Range/Usage
unsigned char 8-bit 0-255
signed char 8-bit -128 to +127
unsigned int 16-bit 0 to 65535
signed int 16-bit -32,768 to +32,767
sbit 1-bit SFR bit addressable only
Bit 1-bit RAM bit addressable only
Sfr 8-bit RAM addresses 80-FFH
only
Unsigned char:
The unsigned char is an 8-bit data type that takes a value in the range of 0-255(00-
FFH). It is used in many situations, such as setting a counter value, where there is no
need for signed data we should use the unsigned char instead of the signed char.
Remember that C compilers use the signed char as the default if we do not put the key
word
Signed char:
The signed char is an 8-bit data type that uses the most significant bit (D7 of D7-
D0) to represent the – or + values. As a result, we have only 7 bits for the magnitude of
the signed number, giving us values from -128 to +127. In situations where + and – are
needed to represent a given quantity such as temperature, the use of the signed char data
type is a must.
Unsigned int:
The unsigned int is a 16-bit data type that takes a value in the range of 0 to 65535
(0000-FFFFH). It is also used to set counter values of more than 256. We must use the int
data type unless we have to. Since registers and memory are in 8-bit chunks, the misuse
of int variables will result in a larger hex file. To overcome this we can use the unsigned
char in place of unsigned int.
Signed int:
Signed int is a 16-bit data type that uses the most significant bit (D15 of D15-D0)
to represent the – or + value. As a result we have only 15 bits for the magnitude of the
number or values from -32,768 to +32,767.
Sbit (single bit):
The sbit data type is widely used and designed specifically to access single bit
addressable registers. It allows access to the single bits of the SFR registers.
RESULT:
Hence, by using this project way will be clearing the traffic signaling for VIP
vehicles in heavy traffic areas by using RF technology.