(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) { / ...
随机推荐
- 2018.07.22 codeforces750E(线段树维护状态转移)
传送门 给出一个数字字串,给出若干个询问,询问在字串的一段区间保证出现2017" role="presentation" style="position: re ...
- JPA数据懒加载LAZY和实时加载EAGER(转)
原文:https://www.cnblogs.com/MrSi/p/8081811.html 懒加载LAZY和实时加载EAGER的概念,在各种开发语言中都有广泛应用.其目的是实现关联数据的选择性加载, ...
- C语言之控制台读取上下左右方向键指令
首先,可以检测任何按键键值 // 首先,检测任何按键的代码 #include<stdio.h> #include<conio.h> int main() { char ch; ...
- IOS11下fixed中input光标错位问题
项目遇到了这个问题,故作了个临时解决方案,暂时没有想到更好的方法,查阅了网上的方案,也没有找到完美的解决方案. 方案思路: ①弹窗打开时,阻止 body 滚动,禁用 touchmove ,同时记录当前 ...
- (动态规划 最长有序子序列)Monkey and Banana --HDU --1069
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1069 http://acm.hust.edu.cn/vjudge/contest/view.action ...
- node API assert
1.assert.throws(block, [error], [message]): assert.throws( function(){ throw new Error('wrong'); }, ...
- 【Win10】一些零碎不好归档的小总结(原谅我这个该死的标题吧)
一.同步方式获取设备的屏幕分辨率 public static class ScreenResolution { /// <summary> /// 获取屏幕高度. /// </sum ...
- 执行Docker命令报错解决办法
shim error: docker-runc not installed on system 服务器重启以后,执行docker命令报以上错误,解决办法如下: cd /usr/libexec/do ...
- CSS 温故而知新
如何让文字垂直居中 需要设置div的height,line-height 为一样的值,如下所示: <div class="ui-bar ui-bar-e" style=&qu ...
- 项目笔记---事半功倍之StyleCop(一)
前言 曾几何时,你是否在看别人代码的时候总是在抱怨代码没有注释,命名不规范,代码风格不统一,代码可读性差?是否有一个适合团队开发规范的检查工具? 答案就是大名鼎鼎的StyleCop代码检查插件,有了这 ...