You are on page 1of 33

Mch K thit b in dng remode jvc

Bo co VXL

B GIO DC V O TO
TRNG S PHM K THUT TP.H CH MINH
KHOA IN-IN T
B MN IN T

BO CO THC TP VI X L
ti:
DNG REMODE JVC IU KHIN
THIT B IN


GVHD: Nguyn Vn Hip.
SVTH : L Minh Ph.
Thng 12/2009.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

MC LC
PHN A: T VN
Gii thiu.
Li cm n.
Nhn xt ca gio vin hng dn.

PHN B: NI DUNG
Chng 1: S khi v nhim v tng khi.
Chng 2: Gii thiu linh kin trong mch.
A. IC n p 7805.
B. Vi iu khin AT89C51.
C .IC 74HC14.
D. LED 7 on anod chung.
E. Mt nhn thu hng ngoi ca hng JVC.
F. Gii thiu v mch m ha remode tivi jvc.
Chng 3: Tnh ton thit k.
A. Khi ngun.
B. Khi hin th.
C. Khi giao tip vi thit b cng sut.
D. Khi thu tn hiu remote.
E. Khi phm nhn.
F. Khi x l.
Chng 4: S nguyn l v lu .
A. S nguyn l.
B. Lu .
C. Chng trnh.

PHN C: THI CNG KT LUN V KIN NGH


A. s mch in.
B. kt lun v kin ngh.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

PHN A

T VN
GII THIU
Vo u nhng nm thp nin 60, k thut s a vo ng dng trong thc t
nhng phm vi nh. Cho n ngy hm nay k thut s c pht trin mt cch
mnh m v c ng dng vo mi lnh vc ca cuc sng. Bn cnh k thut vi
iu khin tr nn quen thuc trong cc ngnh k thut v trong dn dng. T cc
dy chuyn sn xut ln n cc thit b gia dng, chng ta u thy s hin din ca
vi iu khin. Cc b vi iu khin c kh nng x l nhiu hot ng phc tp m ch
cn mt chip vi mch nh, n thay th cc t iu khin ln v phc tp bng nhng
mch in gn nh, d dng thao tc s dng. Thm na l i sng vt cht ca ngi
dn ngy cng c nng cao, nhu cu s dng cc thit b c kh nng iu khin t
xa ngy cng cp thit.
Chnh v cc l do trn, em chn ti dng remote tivi JVC iu khin
thit b in thng qua vi x l AT89C15. Theo em, y l mt ti mi, c kh nng
ng dng trong thc t cao, v thng qua ti ny cng gip em hiu su hn v thit
b s ni chung v lnh vc vi iu khin ni ring.
Mt d chng em rt c gng hon thnh tt n ny ng thi hn, nn
khng trnh khi nhng thiu st mong qy thy c thng cm. Em rt mong c n
nhn nhng kin ng gp. Cui cng xin chn thnh cm n qi thy c v cc bn
sinh vin.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

NHN XT CA GIO VIN HNG DN


..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................

TP. H Ch Minh, Ngy 10 thng 12 nm 2009


Gio vin hng dn

Nguyn Vn Hip

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

LI CM N
hon thnh c bo co ny, u tin em xin c gi li cm n n Ban
Gim Hiu, cc Thy C, c bit l Thy C trong b mn in t thuc Khoa in
in T trng i Hc S Phm K Thut TP.HCM, tn tnh ch dy, truyn t
kin thc cng nh to iu kin thun li cho em trong sut qu trnh hc tp va qua.
Em xin chn thnh cm n Thy Nguyn vn Hip quan tm theo di, tn
tnh hng dn v ng vin em thc hin tt bi bo co ny.
Ngoi ra em cng xin gi li cm n n tt c cc bn b cng kha ng
gp kin va gip trong sut qu trnh thc hin bi bo co ny.

TP.HCM _ Thng 12 nm 2009

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

PHN B

NI DUNG

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

CHNG 1: S KHI

NGUN

HIN TH

X L
RELAY GIAO TIP
VI THIT B
CNG SUT
PHM NHN

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

THU TN HIU
REMOTE

Mch K thit b in dng remode jvc

Bo co VXL

Chng 2: GII THIU LINH KIN


A. IC7805

Electrical Characteristics (MC7805/LM7805)


(Refer to test circuit ,0C < TJ < 125C, IO = 500mA, VI = 10V, CI= 0.33F, CO=
0.1uF, unless otherwise specified)

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

B.Vi x l AT89C51

+V c c

P 1 .0

1
2
3
4
5
6
7
8

P
P
P
P
P
P
P
P

3
3
3
3
3
3
3
3

.0
.1
.2
.3
.4
.5
.6
.7

/R XD
/T XD
/IN T 0
/IN T 1
/T 0
/T 1
/W R
/R D

P
P
P
P
P
P
P
P

1
1
1
1
1
1
1
1

.0
.1
.2
.3
.4
.5
.6
.7

/T 2
/T 2 E X
/S
/M
/M
/S

V C C

0
1
2
3
4
5
6
7

40

U 2
1
1
1
1
1
1
1
1

S
O S I
IS O
C K

XTA L1

XTA L2
A T89 S 52

.0
.1
.2
.3
.4
.5
.6
.7

/A
/A
/A
/A
/A
/A
/A
/A

D
D
D
D
D
D
D
D

0
1
2
3
4
5
6
7

E A /V P P
G N D

30 p

C ry s ra l
12M
1 8

0
0
0
0
0
0
0
0

8
9
0
1
2
3
4
5

R S T

2
2
2
2
2
2
2
2

1
2
3
4
5
6
7
8

3
3
3
3
3
3
3
3

9
8
7
6
5
4
3
2

3
3
3
3
3
3
3

3
3
3
3
3
3
3

a
b
c
d
e
f
g

0
0
0
0
0
0
0

29
30

+V c c

31
9

C 5
10 u

20

C 4

1 9

P
P
P
P
P
P
P
P

2 .0 /A
2 .1 /A
.2 /A 1
.3 /A 1
.4 /A 1
.5 /A 1
.6 /A 1
.7 /A 1

P S E N
A L E /P R O G

C 3
30 p

P
P
P
P
P
P

P
P
2
2
2
2
2
2

R 2
1 0k

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

Mch K thit b in dng remode jvc

Bo co VXL

t tnh k thut:
- 4K bytes Flash.
- 128 bytes RAM.
- 32 I/O .
- 2 Timer/counters m 16 bit.
- H tr giao tip ni tip ch song cng.
- 5 vector ngt, c u tin ngt.
- S dng thch anh dao ng t 3-24MHz.
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

10

Mch K thit b in dng remode jvc

Bo co VXL

C.IC 74HC14.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

11

Mch K thit b in dng remode jvc

Bo co VXL

t tnh vo ra ca IC 74HC14

D.LED 7 ON ANODE CHUNG.

S hex

Dp

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

M s Hex

12

Mch K thit b in dng remode jvc


0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

1
1
0
0
0
0
0
1
0
0
0
0
1
0
0

0
1
1
1
0
0
0
1
0
0
0
0
0
1
0

0
1
0
1
1
1
0
1
0
1
0
0
0
0
0

0
1
0
0
1
0
0
1
0
0
1
0
0
0
0
1

Bo co VXL
0
0
1
0
0
0
0
0
0
0
0
0
1
0
1
1

0
0
0
0
0
1
1
0
0
0
0
1
1
0
1
1

0
1
0
0
1
0
0
0
0
0
0
1
0
1
0

C0
F9
A4
B0
99
92
82
F8
80
90
88
83
C6
A1
86
8E

E. TSOP1838
TSOP 1838 l IC thu hng ngoi c tch hp mch lc bng thng, mch gii m,
AGC, mch iu khin, ngun cung cp 5v.

-Chn 1 : DATA OUT.


-Chn 2 : GND
-Chn 3 : VCC 5V

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

13

Mch K thit b in dng remode jvc

Bo co VXL

Dng sng khi remote pht ra:

Dng sng ng ra khi thu tn hiu c tn s 38kHz:

GII THIU V M PHT CA REMOTE TIVI JVC:

1 bit start 7 bit address v 7 bit command .


Bit c iu ch theo di xung.
Tn s sng mang 38kHz
Bit 0 c rng 1.05ms , bit 1 c rng 2.10ms .
JVC s dng rng xung m ha bit. Mi xung c di 526s vi tn
s sng mang l 38kHz (20 chu k)

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

14

Mch K thit b in dng remode jvc

Bo co VXL

Dng sng remote pht ra trong 1 chu trnh:

Dng sng remote pht ra lin tc:

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

15

Mch K thit b in dng remode jvc

Bo co VXL

CHNG 3
NHIN V TNG KHI V TNH TON

A.Khi ngun:

-Khi ngun c th hot ng 12VDC, hoc 9VAC, p 12VDC qua IC 7805 cho ra
in p 5V cung cp cho IC AT89C51, 2LED 7 on, v khi thu tn hiu remote.
- p 9VAC qua cu chnh lu v t lc ngun s cho ra p DC 12V( U*1.4)
Tnh ton:

Linh kin
2 LED an
TSOP1838
AT89C51
8IB C1815
IC 74HC14
Dng tng do L7805CV cung cp

Dng tiu th(max)


2x7x10mA=140mA
5mA
20mA
8x(5:10)=4mA
50mA
199mA

Vy dng qua IC 7805 nm trong gii hn cho php.


Cng sut tiu tn ca 7805=199x(12-5)=1.4W<15W(data sheet)=>tha iu kin v tn nhit.
Dng cn cung cp ca ngun 12V=199mA+8x70mA=759mA.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

16

Mch K thit b in dng remode jvc

Bo co VXL

B.Khi hin th:


Gm 2 LED 7 on, hin th v tr v trng thi ca thit b c chn, ngoi ra
cn hin th trng thi ca qu trnh thu m m remote, m remote sau khi qu trnh thu
hon tt.

Tnh ton:
Dng qua 1LED on l 5.6mA.
p ri trn LED l 1.8V.
p chn vi x l mc thp l 0.45V.
in tr cn chn phn cc cho LED l:
R=(5-1.8-.45):5.6=491
=>Chn R=470
C.Khi giao tip vi thit b cng sut:

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

17

Mch K thit b in dng remode jvc

Bo co VXL

Gm 8 reley 12V c iu khin ng ngt bi 8 transistor C1815. Mi reley c


ni vi 1 CON2(domino) kt ni vi cc thit b in cn iu khin.
IB=0.8+(5-07):10K=1.23mA. chn =100, IBx =123mA.> ICmax=70mA.
=> trasistor chy ch ON-OFF.
D. Khi thu tn hiu remote:

Khi thu tn hiu remote c nhim v l nhn tn hiu hng ngoi t remote dng xung
chm(tn s 38kHz) cho ra tn hiu xung vung .
E. Khi phm nhn:

Phm nhn dng iu khin cc thit b trc tip trn board, mi ln nhn th
thit b tng ng s thay i trng thi. Hot ng ca phm nhn: bnh thng khi
khng c nhn phm cc chn ca vi x l kt ni vi phm c t ln mc cao(5V),
khi c nhn phm th cc ti chn ny p b ko xung 0V. Do s dng port 2 v port 3
c in tr ko ln ngun 5V nn ta khng cn thit phi mc thm in tr ko ln
ngun 5V bn ngoi.
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

18

Mch K thit b in dng remode jvc

Bo co VXL

F. Khi x l:
Dng IC AT89C51, IC ny c nhim v l nhn cc tn hiu iu khin t phm
nhn v t remote iu khin ng ngt cc reley v hin th cc trng thi ca thit
b.

Chng4: S NGYN L, LU V CHNG TRNH


A. S nguyn l v nguyn l hot ng.

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

19

Mch K thit b in dng remode jvc

Bo co VXL

Nguyn l hot ng: mch s thu tn hiu t remote pht ra v ly m


thu c em so snh vi m t trc tng ng vi tng relay nu 2 m
bng nhau th o trng thi ca thit b , khi 2 led 7 on s hin th thit
b c chn v trng thi ca thit b sau khi o trng th thit b ,
tng t nh iu khin t remote ta c c th iu khin bng cc nt nhn
B. LU :
1. LU CHNG TRNH CHNH:

BEGIN

TMOD:=51H(T1 CHY CH COUNTER M


16BIT, T0 CHY CH TIMER 16BIT)
IE:=88H (KHAI BO NGT TIMER1)
P1:=0(TT HT 8RELAY)
BYTE 20H CA RAM =00H
CI T T1: TH1=0FFH, TL1=0F6H, TR1:=1

QUT PHM

X L

HIN TH

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

20

Mch K thit b in dng remode jvc

Bo co VXL

2. LU CA CHNG NGT TIMER1:

TF1=1

TT TIMER1
MATHU=01000000B

P3.5=1

DELAY 550us

P3.5=1
C=1,CH P3.5 LN 1

C=0

XOAY PHI MATHU CUA C C

C=1

TH1=0FFH
TL1=0F6H
QUAY PHI MATHUT QUA C C
COPY MATHUT VAO THANH GHI TT
M TIMER1

RETI

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

21

Mch K thit b in dng remode jvc

Bo co VXL

3. L CHNG TRNH QUT PHM:

QUT PHM

K1=0

K5=0

HIN THI S 1
TT:=0A1H
RET

HIN THI S 5
TT:=0A5H
RET

K2=0

K6=0

HIN THI S 2
TT:=0A2H
RET

HIN THI S 6
TT:=0A6H
RET

K3=0

K7=0

HIN THI S 3
TT:=0A3H
RET

HIN THI S 7
TT:=0A7H
RET

K4=0

K8=0

HIN THI S 4
TT:=0A4H
RET

HIN THI S 8
TT:=0A8H
RET

RET

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

22

Mch K thit b in dng remode jvc

Bo co VXL

4. LU CHNG TRNH X L:
X L

TT=0A1
H

TT=0A5
H

TT:=0FFH
O TT TBI1
O C PH FTBI1
HIN TH TRNG
THI CA TBI1
RET

TT:=0FFH
O TT TBI5
O C PH FTBI5
HIN TH TRNG
THI CA TBI5
RET

TT=0A2
H

TT=0A6
H

TT:=0FFH
O TT TBI2
O C PH FTBI2
HIN TH TRNG
THI CA TBI2
RET

TT:=0FFH
O TT TBI6
O C PH FTBI6
HIN TH TRNG
THI CA TBI6
RET

TT=0A3
H

TT=0A7
H

TT:=0FFH
O TT TBI3
O C PH FTBI3
HIN TH TRNG
THI CA TBI3
RET

TT:=0FFH
O TT TBI7
O C PH FTBI7
HIN TH TRNG
THI CA TBI7
RET

TT=0A4
H

TT=0A8
H

TT:=0FFH
O TT TBI4
O C PH FTBI4
HIN TH TRNG
THI CA TBI4
RET

TT:=0FFH
O TT TBI8
O C PH FTBI8
HIN TH TRNG
THI CA TBI8
RET

RET

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

23

Mch K thit b in dng remode jvc

Bo co VXL

5. CHNG TRNH HIN TH:( HIN TH M THU C T REMOTE


HOC PHM NHN)

HIN TH

LY 4 BIT THP CA M THU, TRA


BNG M LED 7 ON, XUT RA
P2

LY 4 BIT CAO CA M THU, TRA


BNG M LED 7 ON, XUT RA
P0

DELAY 3S

RET
6. NGOI RA CN C CC CHNG TRNH DELAY
C. TON B CHNG TRNH:

RM BIT
MT EQU
TT
EQU
DEM1EQU
DEM EQU
DEM2EQU
TBI1 BIT
TBI2 BIT
TBI3 BIT
TBI4 BIT
TBI5 BIT
TBI6 BIT
TBI7 BIT
TBI8 BIT
FTBI1 BIT
FTBI2 BIT

P3.5
R7
R5
R3
R4
R6
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
0
1

;CHA M THU REMOTE


;MA COMMAND
;CHA D LIU IU KHIN

;C TRNG THI CA THIT B

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

24

Mch K thit b in dng remode jvc

Bo co VXL

FTBI3 BIT 2
FTBI4 BIT 3
FTBI5 BIT 4
FTBI6 BIT 5
FTBI7 BIT 6
FTBI8 BIT 7
K1
BIT P3.0
K2
BIT P3.1
K3
BIT P3.2
K4
BIT P3.3
K5
BIT P3.4
K6
BIT P3.6
K7
BIT P3.7
K8
BIT P2.7
ORG 0
JMP SUB_MAIN
ORG 1BH
CLR TR1
MOV P2,#086H
;R(A)
MOV P0,#088H
;E
MOV MT,#01000000B
BEGIN:
JB
RM,$
CALL DL1T
;-----------------------------------------JNB RM,B1
JNB RM,B1
JNB RM,B1
JNB RM,B1
B0:
;BIT 0
CLR C
MOV A,MT
RRC A
MOV MT,A
JC
RA
JMP BEGIN
B1:
;BIT 1
JNB RM,$
SETB C
MOV A,MT
RRC A
MOV MT,A
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

25

Mch K thit b in dng remode jvc

Bo co VXL

JNC BEGIN
RA:
MOV A,MT
RRC A
MOV MT,A
MOV TT,A ; MOV TT,MT
CALL
DL1S
MOV P2,#0CFH ;F
MOV P0,#08EH ;I
CALL
DL1S
MOV TH1,#0FFH
MOV TL1,#0F6H
SETB TR1
RETI
;>>>>>>>>>>>>>>>>>>>>>>>>
SUB_MAIN:
MOV DPTR,#MA7SEG
SETB ET1
SETB EA
MOV P1,#00H
; TAT HET TBI
MOV P3,#0FFH
MOV 20H,#0
;BYTE CHUA FTBIX
SETB K1
MOV TMOD,#51H ;TIMER 1 COUNTER,T0 DEM 16 BIT
MOV TH1,#0FFH
MOV TL1,#0F6H
SETB TR1
MAIN:
CALL
GETKEY
CALL XULY
CALL
HIENTHI
SJMP MAIN
;-----------------------------------------HIENTHI:
MOV A,MT
ANL A,#0FH
MOVC
A,@A+DPTR
MOV P2,A
MOV A,MT
ANL A,#0F0H
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

26

Mch K thit b in dng remode jvc

Bo co VXL

SWAP
A
MOVC
A,@A+DPTR
MOV P0,A
CALL
DL3S
RET
XULY:
;THIETBI1:
CJNE TT,#0A1H,THIETBI2
MOV TT,#0FFH
CPL TBI1
CPL FTBI1
MOV P0,#0F9H
JNB FTBI1,N1
MOV P2,#0C8H ;ON
CALL DL3S
RET
N1: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI2:
CJNE TT,#0A2H,THIETBI3
MOV TT,#0FFH
CPL TBI2
CPL FTBI2
MOV P0,#0A4H
JNB FTBI2,N2
MOV P2,#0C8H ;ON
CALL DL3S
RET
N2: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI3:
CJNE TT,#0A3H,THIETBI4
MOV TT,#0FFH
CPL TBI3
CPL FTBI3
MOV P0,#0B0H
JNB FTBI3,N3
MOV P2,#0C8H ;ON
CALL DL3S
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

27

Mch K thit b in dng remode jvc

Bo co VXL

RET
N3: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI4:
CJNE TT,#0A4H,THIETBI5
MOV TT,#0FFH
CPL TBI4
CPL FTBI4
MOV P0,#99H
JNB FTBI4,N4
MOV P2,#0C8H ;ON
CALL DL3S
RET
N4: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI5:
CJNE TT,#0A5H,THIETBI6
MOV TT,#0FFH
CPL TBI5
CPL FTBI5
MOV P0,#92H
JNB FTBI5,N5
MOV P2,#0C8H ;ON
CALL DL3S
RET
N5: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI6:
CJNE TT,#0A6H,THIETBI7
MOV TT,#0FFH
CPL TBI6
CPL FTBI6
MOV P0,#82H
JNB FTBI6,N6
MOV P2,#0C8H ;ON
CALL DL3S
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

28

Mch K thit b in dng remode jvc

Bo co VXL

RET
N6: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI7:
CJNE TT,#0A7H,THIETBI8
MOV TT,#0FFH
CPL TBI7
CPL FTBI7
MOV P0,#0F8H
JNB FTBI7,N7
MOV P2,#0C8H ;ON
CALL DL3S
RET
N7: MOV P2,#08EH ;OFF
CALL DL3S
RET
;-----------------------------------------THIETBI8:
CJNE TT,#0A8H,THIETBI0
MOV TT,#0FFH
CPL TBI8
CPL FTBI8
MOV P0,#080H
JNB FTBI8,N8
MOV P2,#0C8H ;ON
CALL DL3S
RET
N8: MOV P2,#08EH ;OFF
CALL DL3S
THIETBI0:
RET
;////////////////////////////////////////////
GETKEY:
MOV P2,#0FFH
MOV P0,#0F9H
JB
P2.0,KEY2
CALL DL10MS
JB
P2.0,KEY2
MOV TT,#0A1H
MOV 7,5
JNB P2.0,$
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

29

Mch K thit b in dng remode jvc

Bo co VXL

RET
;++++++++++++++++++++++++
KEY2:
MOV P0,#0A4H
JB
K2,KEY3
CALL DL10MS
JB
K2,KEY3
MOV TT,#0A2H
MOV 7,5
JNB K2,$
RET
;++++++++++++++++++++++++
KEY3:
MOV P0,#0B0H
JB
K3,KEY4
CALL DL10MS
JB
K3,KEY4
MOV TT,#0A3H
MOV 7,5
JNB K3,$
RET
;++++++++++++++++++++++++
KEY4:
MOV P0,#99H
JB
K4,KEY5
CALL DL10MS
JB
K4,KEY5
MOV TT,#0A4H
MOV 7,5
JNB K4,$
RET
;++++++++++++++++++++++++
KEY5:
MOV P0,#92H
JB
K5,KEY6
CALL DL10MS
JB
K5,KEY6
MOV TT,#0A5H
MOV 7,5
JNB K5,$
RET
;++++++++++++++++++++++++
KEY6:
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

30

Mch K thit b in dng remode jvc

Bo co VXL

MOV P0,#82H
JB
K6,KEY7
CALL DL10MS
JB
K6,KEY7
MOV TT,#0A6H
MOV 7,5
JNB K6,$
RET
;++++++++++++++++++++++++
KEY7:
MOV P0,#0F8H
JB
K7,KEY8
CALL DL10MS
JB
K7,KEY8
MOV TT,#0A7H
MOV 7,5
JNB K7,$
RET
;++++++++++++++++++++++++
KEY8:
MOV P0,#80H
JB
K8,KEY0
CALL DL10MS
JB
K8,KEY0
MOV TT,#0A8H
MOV 7,5
JNB K8,$
;++++++++++++++++++++++++
KEY0:
MOV P0,#0FFH
RET
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DL1T:
MOV TH0,#HIGH(-550)
MOV TL0,#LOW(-550)
SETB TR0
JNB TF0,$
CLR TR0
CLR TF0
RET
;--------------------------------------------DL1S:
MOV R2,#20
GVHD : NGUYN VN HIP
SVTH : L MINH PH
MSSV : 06201046

31

Mch K thit b in dng remode jvc

Bo co VXL

DL:
MOV TH0,#HIGH(-50000)
MOV TL0,#LOW(-50000)
SETB TR0
JNB TF0,$
CLR TR0
CLR TF0
DJNZ R2,DL
RET
;**********************************************
DL3S:
MOV DEM,#10
DLC: MOV DEM1,#250
DLB: MOV DEM2,#250
DLA:
DJNZ DEM2,DLA
DJNZ DEM1,DLB
DJNZ DEM,DLC
RET
DL10MS:
MOV DEM1,#20
DLD: MOV DEM2,#250
DLE: DJNZ DEM2,DLE
DJNZ DEM1,DLD
RET
MA7SEG:
DB 0C0H,0F9H,0A4H,0B0H,99H,92H,082H,0F8H
DB 080H,090H,088H,083H,0C6H,0A1H,086H,08EH
END

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

32

Mch K thit b in dng remode jvc

Bo co VXL

PHN C
THI CNG KT LUN V M RNG
A.S MCH IN:

B. KT LUN V M RNG:
1.Kt lun;
Mch chy tt, tc x l cn chm.
2. kin ngh: Do thi gian cn hng ch theo em th c th m rng them mt s vn
l tng thm s lng LED 7 on v kt hp vi Real time hin th thi gian thc v
phc v cho vic hn gi tt m thit b v.v...

GVHD : NGUYN VN HIP


SVTH : L MINH PH
MSSV : 06201046

33