Seminar Topics & Project Ideas On Computer Science Electronics Electrical Mechanical Engineering Civil MBA Medicine Nursing Science Physics Mathematics Chemistry ppt pdf doc presentation downloads and Abstract

Full Version: TRAFFIC CONTROLLER
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
TRAFFIC CONTROLLER
[attachment=28269]
DESCRIPTION:
This Traffic Control System employs simple usage of the microcontroller resources for efficient functioning.
The program uses the concept of Timer for higher accuracy in the generation of delay.
8051 Timer/Counter
• Two internal Timers/Counters.
• 16-bit timer/counter.
• Timer uses system clock as source of input pulses.
• Counter uses external input pulses from port 3 (T0, T1).
• If associated interrupt is enabled, when count overflow an interrupt is generated.
Registers:
• TH0, TL0 : timer/counter register of timer 0
• TH1, TL1 : timer/counter register of timer 1
• TMOD : Mode Select register
• TCON : Control Register
TCON
7 6 5 4 3 2 1 0
Timer/Counter1 Timer/Counter1
GATE C/T# M1 M0 GATE C/T# M1 M0

GATE: OR gate enable which controls RUN/STOP of timer 1/0. Set to 1 by program to enable timer to run if bit TR1/0 in TCON is set and signal on external interrupt INT1/0 pin is high. Cleared to 0 by program to enable timer to run if bit TR1/0 in TCON is set.
C/T#: Set to 1 by program to make timer 1/0 act as counter by counting pulses from external input pins 3.5(T1) or 3.4(T0). Cleared to 0 by program to make timer act as a timer by counting internal frequency (# is not operator).
M1, M0: Set/cleared by program to select mode.
TMOD
7 6 5 4 3 2 1 0
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0
TF1/0: Timer 1/0 Overflow Flag. Set when timer rolls from all 1’s to 0.
TR1/0: Timer 1/0 run control bit. Set to 1 by program to enable timer to count; cleared to 0 by program to halt timer. Does not reset timer.
IE1/0: External interrupt 1/0 Edge Flag.
IT1/0: External Interrupt 1/0 signal type control bit.
Operating modes
Mode 0: 8-bit shift register; f/12.
• 13-bit counter.
• An interrupt is generated when counter overflows.
• It takes 8192 input pulses to generate the next interrupt.
Mode 1: 8-bit UART, variable baud rate.
• 16-bit counter.
• Similar to mode 0.
• But takes 65536 input pulses
Mode 2: 9-bit UART; f/64 or f/32.
• 8-bit reload.
• TLX operates as timer/counter.
• THX stores a number and reloads to TLX when it overflows.
Mode 3: 9-bit UART, variable baud rate.
• Timer 1 is inactive, holds count value.
• TL0 and TH0 operate as 2 separate 8-bit timer/counter.
• TL0 control by timer 0 control bits.
Mode 3 gives us a baud rate of our requirement with the help of SCON register.