Академический Документы
Профессиональный Документы
Культура Документы
Embedded system
Seminar 6
Multi-state systems
Dr. Tran Thanh Hung
Department of Automation Technology,
College of Engineering Technology, Can Tho University
Email: tthung@ctu.edu.vn
Review
In the seminar 5, we have used EOS to
implement periodic functions for one state
system.
In this seminar, we will use EOS to implement
multi-state systems.
Outline
How to implement for multi-state systems?
multi-state systems
implement for multi-state systems: type 1
implement for multi-state systems: type 2
Seminar objectives
At the end of this seminar, by referring the
lecture notes, students will be able to:
understand issue of multi-state systems
implement multi-state systems, using EOS
3 state system
4 state system
EOS: Review
#include "Main.h"
#include "EOS.h"
void main (void)
{
}
}
EOS_ISR() interrupt INTERRUPT_Timer_2_Overflow //in file EOS.c
{
TF2 = 0;
// Put your code here
RED_DURATION 10
RED_YELLOW_DURATION 2
GREEN_DURATION 15
YELLOW _DURATION 3
Exercise 1
Write a program to control a complete traffic light
system with states and hardware configuration as
following:
Exercise 2
Vit chng trnh cho my git, theo m t trn
Quy c: Dng
- phm SW7 lm nt Start
- phm SW6 lm cm bin mc nc (bm = nc y)
- phm SW5 lm cm bin nhit (bm = nhit t yu cu)
- phm SW4 lm cm bin ht nc (bm = ht nc)
- LED 7 lm van nc
- LED 6 lm hp ng bt git
- LED 5 lm b un nc
- LED 4 lm motor lng git
- LED 3 lm bm nc
Trng thi ERROR: Chp tt tt c cc LED
Trng thi WASH, RINSE: ko di 20s