📄 main.c
字号:
/****************************************Copyright (c)****************************************************
** Guangzou ZLG-MCU Development Co.,LTD.
** graduate school
** http://www.zlgmcu.com
**
**--------------File Info---------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: Timer1计数实验--CAP1.1下降沿
**
**--------------------------------------------------------------------------------------------------------
** Created by: zhangmingjie
** Created date: 2007-3-26
** Version: 1.0
** Descriptions: Timer1计数实验--CAP1.1下降沿。
**--------------------------------------------------------------------------------------------------------
** Modified by: Wuzhijian
** Modified date: 2007-09-02
** Version:
** Descriptions: 对程序的风格以及注释略作调整,并检查代码。
**
** Rechecked by: Litiantian
*********************************************************************************************************/
#include "config.h"
/********************************************************************************************************
** 函数名称: main
** 函数功能: Timer1计数实验--CAP1.1下降沿
** 调试说明: 需要使用杜邦线连P1.19和JP1的KEY6
*********************************************************************************************************/
int main(void)
{
PINSEL3 = 3 << 6; /* P1.19连接捕获CAP1.1, */
/*作为计数的外部输入 */
T1CTCR = (0x02) | /* 计数器模式,下降沿捕获 */
(0x01 << 2); /* 选择CAP1.1 */
T1TC = 0; /* 初始化计数器值为0 */
T1TCR = 0x01; /* 启动计数器 */
while (1);
return (0);
}
/*********************************************************************************************************
** End Of File
*********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -