| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 172 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 172 Page - STCmicro Technology Co,.Ltd |
|
172 / 377 page ![]() Assembly Program: ;/*-------------------------------------------------------------------------------*/ ;/* --- STC MCU International Limited ----------------------------------*/ ;/* --- STC 1T Series 16-bit Timer Demo --------------------------------*/ ;/* If you want to use the program or the program referenced in the */ ;/* article, please specify in which data and procedures from STC */ ;/*------------------------------------------------------------------------------*/ ;/* define constants */ #define MODE1T ;Timer clock mode, comment this line is 12T mode, uncomment is 1T mode #ifdef MODE1T T1MS EQU 0B800H ;1ms timer calculation method in 1T mode is (65536-18432000/1000) #else T1MS EQU 0FA00H ;1ms timer calculation method in 12T mode is (65536-18432000/12/1000) #endif ;/* define SFR */ AUXR DATA 8EH ;Auxiliary register TEST_LED BIT P1.0 ;work LED, flash once per second ;/* define variables */ COUNT DATA 20H ;1000 times counter (2 bytes) ;----------------------------------------------- ORG 0000H LJMP MAIN ORG 000BH LJMP TM0_ISR ;----------------------------------------------- ;/* main program */ MAIN: #ifdef MODE1T MOV AUXR, #80H ;timer0 work in 1T mode #endif MOV TMOD, #01H ;set timer0 as mode1 (16-bit) MOV TL0, #LOW T1MS ;initial timer0 low byte MOV TH0, #HIGH T1MS ;initial timer0 high byte SETB TR0 ;timer0 start running SETB ET0 ;enable timer0 interrupt SETB EA ;open global interrupt switch CLR A MOV COUNT, A MOV COUNT+1, A ;initial counter SJMP $ 172 |
|
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 |
| 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 |