(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) { / ...
随机推荐
- java网络爬虫实现信息的抓取
转载请注明出处:http://blog.csdn.NET/lmj623565791/article/details/23272657 今天公司有个需求,需要做一些指定网站查询后的数据的抓取,于是花了点 ...
- 2018.09.24 bzoj1486: [HNOI2009]最小圈(01分数规划+spfa判负环)
传送门 答案只保留了6位小数WA了两次233. 这就是一个简单的01分数规划. 直接二分答案,根据图中有没有负环存在进行调整. 注意二分边界. 另外dfs版spfa判负环真心快很多. 代码: #inc ...
- 2018.07.03 POJ 1279Art Gallery(半平面交)
Art Gallery Time Limit: 1000MS Memory Limit: 10000K Description The art galleries of the new and ver ...
- 2018.09.09 bzoj4403: 序列统计(Lucas定理)
传送门 感觉单调不降序列什么的不好做啊. 于是我们序列中下标为i的元素的值加上i,这样就构成了一个单调递增的序列. 问题就变成了: 求出构造长度分别为1 ~ n且每个元素的值在l+1 ~ r+n之间的 ...
- IntelliJ IDEA 2017版 导入项目项目名称为红色
1.导入的项目全部是红色的,原因是版本控制问题,所以修改如下:(File--->settings) 2.找到如图位置的字样,选中当前项目,选择铅笔位置 选择铅笔 弹出对话框(默认选择的是proj ...
- PCL(point cloud library) 学习——简介
Point Cloud Library (PCL) 是开源点云处理库, 包括 filtering, feature estimation, surface reconstruction, regist ...
- Python+Android开发
1 下载Scripting Layer for Android (SL4A) Scripting Layer for Android (SL4A) 是一个开源项目,目标是为android系统提供脚本语 ...
- 基于SceneControl单击查询功能的实现
private void HandleIdentify_MouseDown(object sender, ISceneControlEvents_OnMouseDownEvent e) { this. ...
- MemCachedClient 节点失效时的处理
引入jar包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3 ...
- day4之装饰器进阶、生成器迭代器
装饰器进阶 带参数的装饰器 # 某一种情况# 500个函数加装饰器, 加完后不想再加这个装饰器, 再过一个季度,又想加上去# 你可以设计你的装饰器,来确认是否执行 # 第一种情况 # 想要500个函数 ...