⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer2c.bas

📁 82 sample programs written in BASCOM-8051 for 8051 developement
💻 BAS
字号:
'--------------------------------------------------------------
'                     (c) 1998-2000 MCS Electronics
'--------------------------------------------------------------
'  file: TIMER2c.BAS
'  *TIMER2 used as a clockgenerator
'  Select 8052.dat or 89s8252.dat
'--------------------------------------------------------------
Dim C As Word

'--------------- TIMER 2 modes ------------------
'0=16-bit auto reload
'1=16-bit capture
'2=baudrate generator
'3=receive only
'4=transmit only
'5=clock output
'------------------------------------------------
Config Timer2 = Timer , Mode = 5
' The output frequency = (fOSC / 4) / (65536-CAPTURE)
' So when used with 12Mhz clock the minimum freq would be
' (12/4)=3000000 / (65535)=
' The maximum freq would be : 46 Hz
' 3000000 / 1 = 3 MHz.

Capture = 65535                         'will produce 3MHz
End

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -