Vous êtes sur la page 1sur 8

c

c c c
c

8051 Tutorial
c

Scope
c cc
c cc  c 
cc c c
c  c cc
 c
c  ccc

c  cc c
 c
 c c  cc
 
c
c c   c cc  cc  
cc c cc
c c

Introduction
 ccc
c c cc ccc
 c
c
c
c

c cc
 cc 
c c c  c !"c

 c 
cc
c c
cc  c

cc ccc
c c cccc c
c  c#$c c % 
 c c
c
ccc

c c cc 
c&cc#c'()*c c 
c % cc
  c+c

c c 
c


cc+c'()c

  c
c,c c-c
ccc  c cc
 
c c c c+c
&,./*c
cc c

 
cc  c c#c
c 0
 c  c
c'"1c
c c#c&,/*c c'c  cc
 c
cc
 c c 
 c c  c

ccc
 
c
 c c
  c c ccc
c  c  c

c&cc c
c
 
c


*cc   c c
c cc  
cc

c cc  
c
  c
c
c cccc
c 

c c c ccc
 c  c c c  c c  c
cc  c c
cc 

 cdatabase°rcc c c c  c  cc


 cc  c c cc
 c
cc

Kemory and I/O


 cc  c
c  c c
c  c/+$ c c&  c
*c
c/+$ c c
&  ! *c cc  cc c
 
 cc ccc % 
 ccc

c c ccc c
c cc ccc ccc  c c c  c
cc
 c/+$c c2c
c3 c c 
c c
c c cc c
cc 
 c c
c c
  c 3
c
c c45'c c  c  
c 
c
c c
 c c
c
6c
cccc c c 2c cc  cccc#c
ccccc  cc
c
c

c cc
cc c c cc cc  c c
 c 
c c  c c
 c
c c cc c
 c 
c c c
 c cc+c
c c c c
 c
Internal Kemory
 c
 c-!cc c#c c c
2c4!7c c c#cc

  ccc#/c c c cc cc 82c
9c
3c c ccc4  c&c c c
3c 
c  cccc
c c17*c
/c: c&#c*c cc
  ccc c c  c
c  ccc
 c


c
; c c2c   c c
c 2c45'cc
  c
c c 
c
5c3ccc c
c c) cc  cc c  c cc c 

c
 
 c
 cc#/c
ccccccccc3cc
c %
cc 2c c
cc ccc 
c3c c 

c
 c
c c
 c

c
cccccccc'
cc c c c c3c c 

c
c
cc c cc
 
 cc
c cc
c c  c  c4c
c4c c  c  cc c
c c cc
 c
c
 cc

I/O
!"cc
c   c c cc
cc c  c
c c#c1  c9

c
4  c&194*c c1
 c

c
c  c c  cc ! ! c
 cc
c
 c c
 ccc !"c  c
 ccccc54 c ccc !"c  c
cc/cc
 
 c
 c&cc
 cc
 c cc
cc c c  *cc
c cc
 c
c
c c c c
!"cc c  cc %  c 

c c % 8c
cc c cc  c c % 
 c c
c cc c 0 c
#cc c54 c
 c c c
c+ccc c
c c#c % 
 c
 c
c#c

cc(
 cc cc 0 c c  c  c c c cc
ccc c c
!"c
rcc
   cc 
c  c   cc cc !"cccc cc
 c
c c  % c  c
c ccc cccc
c 0 c c45'!4"'c

cc
cc 
cc cc
cc
   c c
c cccc cc

 c
cc

·ddressing modes
<cc
cc ccc c
c !"=ccc c
 ccc cc
cc cc
 c
 c c ccc cc cccc c c %c cc
cc cc  c
 ccc
Direct ·ddressing
"">6c ?c?c?c
@22222222222c: c222222222Ac @2222ccc/c222Ac c  c  cc c 
 cc c
c
> 

c
c c

cc  c
c 
 c8c
*c: c
c c194c& c  c cc???cc#c2Ac#*c
#*c:c
c c194c& c  c cc???cc#c2Ac#*c
-*c: c
c c  c#c c c
 
 c45'c& c  cc cc???ccc2Ac#.*c
+*c:c
c c:c  c c&c c  cc cc???ccc2Ac#.*c
Register Indirect ·ddressing
"">6c 46Bc
@22222222222222222222222222c: c2222222222222222222
22Ac
cc
*c4  c4c4cc1c
c
cc
c 
c
c
 
 c>c' c
#*c4  c4cc4c
c
ccc 
c
c cc#/c c c c6% 
 c>c
' c
-*c> 4c
c
cc
c 
c
c6% 
 c>c' c
Base + Index
c  c5  ccCc

c c> 4cccDc

c c5 c
cc
Instruction Set
 cc  Ec

c c
c c
 c c"2">6c   cc!!#c cc
  c cc
ccc/cc  cc

c3 c#cc 3c c&/Fc c *cc#+c
 3c c
7 c
c
c--c

c c c c  
c  
c c 
cc


c
cc
c c c c

cc cKOV? R1,XXXc
c c???c
c
 cGccc 
c
c c#/c
 
 c' ccc c !"cccc cc#/c c c
6% 
 c45'cc
c c

c c

c c 
c4  cccccc
 c
c#/c c c % 
 cc
 
 c c c   c c
 
c 
c
cc
  
c c c

c c
c c&c
c c
cc  c
c cc  c


c *ccc   cc c c

c c
cc c cc3 c+c c
c  cccc c
ccc 
 c cc
cc cc
c
c
 3
 c
H c cccccccccccc cccc5 ccc5ccccccccc cc5 c4  cc46Bcccccc
cccccccccccccccccccccccccc c !"cccc194ccccccccccccccccccccc cc#/c c c c6% 
 c' ccc
6?'c
cccccccccccccccccccccccccc c
 
 c' c < c&c cc cc  c   c2c cc c cc
%c  c 0 cc  c*c
cccccccccccccccccccccccccc
c  c c
c c/cc c
 c
c c c cc 

c c
 c

cc&> 4*c
cc
1
 c

cc
<c
c>6c c5cc
c c c46Bc194c < c
c&> 4*c 
c
H ccc5<>cc"4cc?"4c
c c 
c 
c &c5c46Bc194c < c  c
  c*c
cc c 

c 
c 
c 

&c5c !"c < c*c
cc:>c
c

c: c c3 c  c 
c c5c
cc &c46Bc194c
< c  c  c*cc c  c 
c
c c5c
5
cccccc

c  ccc/cc  cc cc
ccc  cccc


c
c
c c 
c 
cc c  c
c5c&3 c+c 3c *c
5
c c c c
2c c&/c c#c*c
c c
  cc c  c  c
 
 c
c5<>!"4 cc ccc
cc
 c

ccc c  cc
c   c cc
 c
c
c c c

c c cc   cc
c c cc
1 &c5c46Bc194c6?'c  c  cc&> 4**c
c 

&c5c46Bc194c
6?'cc&> 4*c*cc  c c c
  c

c
cc
 c cc c c
 c cc c
c 

c2cc
cc c4+4cccc c194cc194cc  cc
3 cc

c
ccc5ccc  cc
Oontrol instructions
Ic
c cc/cc   c c
 cccc
cc c c/+$c c cc
ccIc
c c c cc c+c
c 
c 
c
cc#$c
  c9c

 cIc c cD!2c#c c c c
c  c
ccIcc
 cc c c5cc c

c c c> 4cc c  cc c
cc
B c
cc c

c c
'c c c c 
c ccc#c c c
c

cc c c
cc
'
 
c cc
c cc c
!"c
c c
2c#cc#/c c45'c c  c
c03 c  c
c
c
1c
c
c  c
c  c cc cc
c !"c c
: c
ccc
c
cc c 
c  cc cc cc cc c
cc
c  c c
 c
cc c c cc c5 c
c cc
 
c
3c
  c
 c
c c c c4  cc
 c
(

c  cc
c  c
 c ccc  c) ccc   c
cc
 c c cccc c
cc c
c c
c c
c c c cc 
c
:c
c 
 cc c
c c 
c
c cccc 
cc
c !"c

 c
cc c cc
cc

Interrupts
 ccc cc

23 c4  c
 c
c
  c  c
 cc
cc  ccc 2c
c c
2c c

Power consumption
 c
 c('"1cc
 c&c *c/c5cc#c'()c
cc  c 
c


c c'"1c#c
 c-c5c&c#')*cc' 
c 
c c c

c c

c c  cc
 cc  ccc5c
c
cc#c c

c 
c  c c

ccc c c#c
c
c
c c c
 cc cc
 c c c
c  c

c c
cc
% 
cc  
c c  c& 

cc
 c % 
c
c  c c
c
 *c
c c

c c c
2c45'c
!c c   c

Pinouts
c
c c cc c  cJ
 Jc
cc

 
c
cc c
 
 cc  
 c 

c c !"c
c  c c c3c   c c c+c
c
> c
c c++c
cHc& c c ccc
cc %c
 c < -2c
cc
 
c54 c c
 cc !"c*cc> 

c
c c 
c c ccc
  cc
c c !"cc
cc c  c3 c cc
c
c c


c 
cc
c++c
c
c

5cc
c cc
c c  
 c 

c

cccc cc
ccccccc5cc5  ccccc5>cc c  % c  c5  c
c>c
cc

Performance
 c
 cc  cc#'()c
c3c#c cc %  cc
 c

cc
 c cc cc
 cc
cc  c&cK1 *ccc#cK1 cc c
c
% c c c
% 
 c cc c5 c c c
c % c cc c %c 0
 c c c
cc  cc
 c
cc cc
c c
c c c
c c c % 
 c45'cc

 c
c c c3 cL/cK1 c
c c c
cLcK1 c
(  c c
c

cc c  
 ccc
 
c c 
c
 0
cc+'()c
cc 
c c
 c c c 0 c c
c

cccc#c
(
 c
 c
 
c c c c

c % 
c cc cc 
cc
c
 c#c

c 
c
cc

Enhancement
 cccc c cc  cc cc
c
c c3 Gcc c c
 c c3
c c cc  
cc
c cc  
c
  c5c

 0
 c cc ccc  cc
c
 c
  c c cccc
 cc
c 

cc c
c cc c cc ccc ccc
c c
c
cc c  cc 
 cdatabasec  ccc cc

cc %  c c  c cc


 c  ccc
: c c c c c c
c

 
8c
7
c ccc
  c c
c c
c  c  c+$c c4"'cc
664"'c
c#c c
2c45'cc 
 cc c
c 
c9 c c c
/+$cc c
cc45'c c#$cc+$c 
c
c
 c#c
c
c c
cc
  c
c 
 c
 c&
c-*c
c
  c c3c
 cc#/c c2c
c 
 c45'cc cc 3c 3 c % 
 c c2ccc


 c+$c45'c  c
c  c
c+$c c3c
1 c 
c c 
 c c
 cc ccc c
1 c c 
 c
 c
c c c  c c   c
c  cc

 c
6

 c  c  
 cc c  c c/cc  !  cc 
c

cc

c  c c
ccc c  c !"ccc5!>c>!5cH6>c
cH>c  cc
 cc ccc Mc1 c5<c1:c
c 
c6 
c
 c  c
 c c

 
c c c
  c
c 
ccc  c
c c
  cherec
5
 c
ccc  c cc  c 
ccc
 c cc cc
 c 
c c ccc 
c" c cc c ccc
 cc
c c c
 cc
  c cc  c
c

 c  cccc c c

cc
  c c cc
 c c c 
 c
c9B5c
  cc cc 
 cc
cc
c c
 c2c cc c cc8051 IP Ooresc
cc

Oost
5c
c#cc
c
2cc c
c c c cRSc cN#c
cc
 cc&"/*ccc
c cc cc
cc
c
 cc cc$c c c c c c c
 
c
9cN+/ccc cc cc cc-c
c3 cc./c c45'c
c/$c c9 c


 c c
c5!>c c c0 c
 
c
 cc 
c
5c c  c c  c  c cc c c c
c c c c  c c

cc
c c c   c c   c c  c cc c c
cc

Development Tools
 cc c c c  c
c cc c  
cc2c c
c c c % 
 c

 cc  c cc
c c cc
c
c
 c c c
cc  
c c c

c c cc  c
c
c
c c c
c c
c45'c
 
c  c

 cc  c 3
cc  c  c  
c c c cc
 c c
c
c6 c& 6*c  c c  c cc
cccc  cc
c cc
 c 6c c 
 c cc 
c c
5  c
c c
cc c c   c  c
c c c  c c
 c
cc cccc
c  
c c c
 cc  c
>  
c  c c  ccc4  c  c6%  c ! c3c
c9 c
 c c
cc
c
c