Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Flowchart
1. FLOW CHART FOR MATER UNIT
START
Initialize ports P0=o/p, P1= i/p
Subroutine to set baud rate
Subroutine to initialize LCD
A
Display default msg on
LCD
EnterKe
y
Subroutine to Initialize LCD
Display Message to select
slave select 1 : Slave1 & 2:
Slave2
EnterKe
y
Subroutine Find key pressed
If
If
Slave2 monitor &
control
EnterKe Slave2 monitor &
y control
Slave 1
Subroutine to initialize LCD
Display Message2 to perform
select 1: Monitor & 2:
Control
2. If Key
pressed
Subroutine to find key
pressed
If
If
Select slave 1 in monitor
mode Select slave 1 in control
mode
Send Req & address to slave
1 Subroutine to Initialize LCD
Read data sent by slave 1 Display Msg3 to control 1: D1
ON 2: D1 OFF, 3: D2 ON, 4: D1
OFF
Display received data on
Subroutine to find key
LCD
pressed
Device 1 ON If
EnterKe
y
Device 1 OFF If
A Device 2 ON If
Device 2 OFF If
EnterKe
y
Slave 2 A EnterKe
y
Subroutine to initialize LCD
Display Message2 to perform
select 1: Monitor & 2:
Control
If Key
pressed
3. Subroutine to find key
pressed
If
If
Select slave 2 in monitor
mode Select slave 2 in control
mode
Send Req & address to slave
2 Subroutine to Initialize LCD
Read data sent by slave 2 Display Msg3 to control 1: D1
ON 2: D1 OFF, 3: D2 ON, 4: D1
OFF
Display received data on
Subroutine to find key
LCD
pressed
Device 1 ON If
EnterKe
y
Device 1 OFF If
A Device 2 ON If
Device 2 OFF If
EnterKe
y
A EnterKe
y
LCD initialize Display
Load commands to accumulator
Wait until LCD is ready
Send commands to the LCD
Load acc content to LCD(port 2
Return Return
4. Key detection
Send logic 1 to columns(P1.4-P1.6) Baudrate
and logic 0 to Rows(P1.0-P1.3)
Copy port 1to Acc Copy TH1= 0FDH
Copy SCON= 50H
IfACC=7
Find key by considering one Copy TMOD= 21H, T1
mode 2 & T2 in mode1
column at logic 1 & read port1
Copy TCON= 40H
If
Add 6 to the key RET
RET
SEND
Clear TI Flag
Copy data(A) to Data reception
SBUF
Copy RX SBUF data to
If TI=0
ACC
Clear TI Flag
ISR RET
Copy ACC content to
22FH loc
If
5. Copy 01H to 30H Loc Copy 30H loc data to
ACC
If
RET Copy RX data[2FH] to ACC
If
Copy ACC content to [R0]loc Copy [30h]=00H &
R0=31H
RET
6. START
Set baud rate
Read Modem
Is Msg1 Yes Activate Relay1
“Locke
No
Is Msg2 Yes Activate Relay2
Unlocke
No
Is msg3 Yes
Activate Relay3
city
No
Yes
Is msg3
Activate Relay4
city limit
No
Track
Yes Send Location
No
Read Sensor
Is helmet Yes
weared & On vehicle
no alcohol
No
Off vehicle
Yes
Is Send Location
Accident
End