(LPC1769) Timer Interrupt Application
void TIMER0_IRQHandler (void)
{
if(LPC_TIM0->IR & 0x01)
{
LPC_GPIO1->FIOPIN ^= ( << );
LPC_TIM0->IR = 0x01;
}
} /*
* CPU : LPC1769
* Operate Frequency : 120MHz
* Timer Interrupt Example :
* TCR : Counter Enable/Disable
* PR : PreScale register
* MR0 : when TC(timer counter) match MR0. the cup action are to generator an interrupt, reset the TC
* or stop the timer.
* IR : if an interrupt is generated that the corresponding bit in the IR will be high.
* writing a 1 to corresponding IR bit will reset the interrupt.
* writing a 0 has no effect.
* MCR : it will be control timer function that interrupt enable/disable. reset TC if MR0 matchit.
*
* */
int main(void)
{
CFWInit();
LPC_GPIO1->FIODIR |= (<<);
LPC_GPIO1->FIOPIN &= ~(<<);
LPC_SC->PCONP |= << ; /* power control --> power saving function */
LPC_SC->PCLKSEL0 |= (0x01 << ); /* Enable Timer0 peripheral clock */
LPC_TIM0->TCR = 0x02; /* reset timer */
LPC_TIM0->PR = 0x00; /* set prescaler to zero */
LPC_TIM0->MR0 = ; /* set the count value */
LPC_TIM0->IR = 0xff; /* reset all interrupts */
LPC_TIM0->MCR = 0x03; /* stop timer on match */
NVIC_EnableIRQ(TIMER0_IRQn);
LPC_TIM0->TCR = 0x01; /* start the timer */
while();
}
(LPC1769) Timer Interrupt Application的更多相关文章
- PIC32MZ tutorial -- Timer Interrupt
An interrupt is an internal or external event that requires quick attention from the controller. The ...
- Software UART, Timer, PWM, External Interrupt
How can you add extra hardware UARTs to a 32bit TMS470 ARM7-based microcontroller at zero cost? Solu ...
- ZYNQ. Interrupt(1)Private Timer
Interrupt zynq的中断. The PS is based on ARM architecture, utilizing two Cortex-A9 processors(CPUs) and ...
- MPU/SoC/Application Processor/Embedded OS
Everything has its principles and mechanisms which are designed by its creator and followed by its u ...
- PIC32MZ tutorial -- 32-bit Timer
The microcontroller is PIC32MZ2048ECH144 on the PIC32MZ EC Starter Kit. This microcontroller has fou ...
- Linux时间子系统之(十七):ARM generic timer驱动代码分析
专题文档汇总目录 Notes:ARM平台Clock/Timer架构:System counter.Timer以及两者之间关系:Per cpu timer通过CP15访问,System counter通 ...
- Linux时间子系统(十七) ARM generic timer驱动代码分析
一.前言 关注ARM平台上timer driver(clocksource chip driver和clockevent chip driver)的驱动工程师应该会注意到timer硬件的演化过程.在单 ...
- Zynq-7000 FreeRTOS(二)中断:Timer中断
总结Zynq-7000 这款器件中的Timer定时器中断,为FreeRTOS中断做准备.在 ZYNQ 的纯 PS 里实现私有定时器中断. 每隔一秒中断一次, 在中断函数里计数加 1, 通过串口打印输出 ...
- .net Timer定时执行
System.Timers.Timer可以实现数据库定时更新的功能 Global.asax void Application_Start(object sender, EventArgs e) { / ...
随机推荐
- ThinkPHP5命令行 执行控制器下的某方法
入口文件后加一个空格就行了 1,首先cd到站点目录public下,我的入口文件是默认的index.php,然后执行以下命令,, 2,php要加入环境变量,index.php后面加空格,然后是模块,控制 ...
- schwarz( 施瓦兹)不等式证明
证明 如果: 函数 y=ax^2+2bx+c 对任意x >=0 时 y>=0; 函数图象在全部x轴上方,故二次方程判别式 b^2-4ac<=0;(即方程无实数解) 即(2b)^2&l ...
- java反编译工具jad使用
参考:http://blog.csdn.net/u014472711/article/details/53713269 http://lijingshou.iteye.com/blog/2005717 ...
- 三)mybatis 二级缓存,整合ehcache
mybatis-config.xml <setting name="cacheEnabled" value="true" /> PersonMapp ...
- Js中 关于top、clientTop、scrollTop、offsetTop
网页可见区域宽: document.body.clientWidth; 网页可见区域高: document.body.clientHeight; 网页可见区域宽: document.body.offs ...
- faceswap安装说明
Installing Faceswap Installing Faceswap Prerequisites Hardware Requirements Supported operating syst ...
- 常用的SLAM解决方案
ORB SLAM 可以去Github上自己搜索现成的SLAM程序包 在此基础上做优化 视觉SLAM的分类方法:按摄像头的多少分为单目和双目,按是否使用概率方法分为概率法和图法 链接 学习SLAM重要的 ...
- PriorityQueue源码分析
PriorityQueue其实是一个优先队列,和先进先出(FIFO)的队列的区别在于,优先队列每次出队的元素都是优先级最高的元素.那么怎么确定哪一个元素的优先级最高呢,jdk中使用堆这么一 ...
- x13 vs md5
x13 vs md5 阅读: 评论: 作者:Rybby 日期: 来源:rybby.com 最近在设计巴巴变时想对用户设计的节点模块添加锁定功能,比如你的网站可以让用户发表文章或评论,而你想让用 ...
- delphi字符串固定长度换行
var str,capstr:string; i,j:integer; .................... j:=500; //这个地方可能要根据你显示的宽度来换算对应的字符长度 ...