| 数据搜索系统,热门电子元器件搜索 |
|
STC89LE52RC 数据表(PDF) 107 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC89LE52RC 数据表(HTML) 107 Page - STCmicro Technology Co,.Ltd |
|
107 / 165 page ![]() The following program is an assembly language code that domestrates Timer 2 programable clock/pulse out function on P1.0. ;/*------------------------------------------------------------------------------------------------------------*/ ;/* --- STC MCU International Limited ----------------------------------------------------------------*/ ;/* --- STC 89xx Series MCU Timer 2 in programmable clock/pulse output mode,on P1.0------------*/ ;/* If you want to use the program or the program referenced in the */ ;/* article, please specify in which data and procedures from STC */ ;/*--------------------------------------------------------------------------------------------------------------*/ ;Declare STC89xx series MCU SFRs ;SFRs associated with Timer 2 and RS232 port T2CON EQU 0C8H T2MOD EQU 0C9H TR2 EQU T2CON.2 ;TR2 is the second bit in SFR—T2CON RCAP2L EQU 0CAH RCAP2H EQU 0CBH TH2 EQU 0CDH TL2 EQU 0CCH ;Timer/Counter 2 control register T2CON ; B7 B6 B5 B4 B3 B2 B1 B0 Reset Value ;bit-address CF CE CD CC CB CA C9 C8 ;T2CON(C8H) TF2 EXF2 RCLK TCLK EXEN2 TR2 C//T2 CP//RL2 00 ;T2MOD Register ; B7 B6 B5 B4 B3 B2 B1 B0 Reset Value ;T2CON(C9H) - - - - - - T2OE DCEN xxxxxx00B ;--------------------------------------------------------------------------------------------------------------- ORG 0000H AJMP MAIN ;--------------------------------------------------------------------------------------------------------------- ORG 0100H MAIN: MOV SP, #0E0H MOV P1, #0FFH ;turn off P1 port LED ACALL SET_T2_OUT_MODE ;Set Timer 2 as high-speed pulse output mode MOV DPTR, #0FFF0H ;Set Timer pulse output velocity ACALL SET_T2_OUT_SPEED WAIT1: SJMP WAIT1 ACALL DELAY ACALL PAUSE ;Pause in order to observation MOV DPTR, #0FFE0H ;Set Timer pulse output velocity,lower 1/2 than last ACALL SET_T2_OUT_SPEED ACALL DELAY ACALL PAUSE ;Pause in order to observation MOV DPTR #0FFD0H ;Set Timer pulse output velocity,lower 1/3 than last 107 |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |