Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

STC12LE5616AD Datasheet(PDF) 352 Page - STCmicro Technology Co,.Ltd

Part # STC12LE5616AD
Description  Enhanced 8051 Central Processing Unit ,1T per machine cycle, faster 8~12 times than the rate of a standard 8051.
PDF  377 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STC [STCmicro Technology Co,.Ltd]
Direct Link  http://www.stcmicro.com/
Logo STC - STCmicro Technology Co,.Ltd

STC12LE5616AD Datasheet(HTML) 352 Page - STCmicro Technology Co,.Ltd

Back Button STC12LE5616AD Datasheet HTML 348Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 349Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 350Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 351Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 352Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 353Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 354Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 355Page - STCmicro Technology Co,.Ltd STC12LE5616AD Datasheet HTML 356Page - STCmicro Technology Co,.Ltd Next Button
Zoom Inzoom in Zoom Outzoom out
 352 / 377 page
background image
Appendix B: 8051 C Programming
ADVANTAGES AND DISADVANTAGES OF 8051 C
The advantages of programming the 8051 in C as compared to assembly are:
Offers all the benefits of high-level, structured programming languages such as C, including the ease of
writing subroutines
Often relieves the programmer of the hardware details that the complier handles on behalf of the
programmer
Easier to write, especially for large and complex programs
Produces more readable program source codes
Nevertheless, 8051 C, being very similar to the conventional C language, also suffers from the following
disadvantages:
Processes the disadvantages of high-level, structured programming languages.
Generally generates larger machine codes
Programmer has less control and less ability to directly interact with hardware
To compare between 8051 C and assembly language, consider the solutions to the Example—Write a program
using Timer 0 to create a 1KHz square wave on P1.0.
A solution written below in 8051 C language:
sbit portbit = P1^0;
/*Use variable portbit to refer to P1.0*/
main ( )
{
TMOD = 1;
while (1)
{
TH0 = 0xFE;
TL0 = 0xC;
TR0 = 1;
while (TF0 !=1);
TR0 = 0;
TF0 = 0;
portbit = !(P1.^0);
}
}
A solution written below in assembly language:
ORG
8100H
MOV
TMOD, #01H
;16-bit timer mode
LOOP:
MOV
TH0, #0FEH
;-500 (high byte)
MOV
TL0, #0CH
;-500 (low byte)
SETB
TR0
;start timer
WAIT:
JNB
TF0, WAIT
;wait for overflow
CLR
TR0
;stop timer
CLR
TF0
;clear timer overflow flag
CPL
P1.0
;toggle port bit
SJMP
LOOP
;repeat
END
•
•
•
•
•
•
•
352



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com