(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) { / ...
随机推荐
- 美团点评2017校招笔试真题-算法工程师A
美团点评2017校招笔试真题-算法工程师A 1.下面哪种STL容器的实现和其它三个不一样 A. set B. deque C. multimap D. map 正确答案: B STL的容器可以分为以下 ...
- 简单的Java,Python,C,C++
Java 语言 //package main //注意不要添加包名称,否则会报错. import java.io.*; import java.util.*; cin.hasNext(); cin.h ...
- oracle创建新的用户 创建序列 并生成自动自增
1.用有dba权限的用户登录:sys用户 system 口令:manager 2.创建一个新用户:create user abc identified by 123456; 3.授予DBA权限: gr ...
- Codeforces807 B. T-Shirt Hunt 2017-05-08 23:23 175人阅读 评论(0) 收藏
B. T-Shirt Hunt time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- 4张图看懂delphi 10生成ipa和在iPhone虚拟器上调试(教程)
4张图看懂delphi 10生成ipa和在iPhone虚拟器上调试(教程) (2016-02-01 03:21:06) 转载▼ 标签: delphi ios delphi10 教程 编程 分类: 编程 ...
- 【转】C#发送Email邮件
转自:http://hi.baidu.com/bluesky_cn/item/8bb060ace834c53f020a4df2 下面用到的邮件账号和密码都不是真实的,需要测试就换成自己的邮件账号. 需 ...
- paxos ---学习笔记
摘自维基百科:分布式系统中的节点通信存在两种模型:共享内存(Shared memory)和消息传递(Messages passing).基于消息传递通信模型的分布式系统,不可避免的会发生以下错误:进程 ...
- Backup--查看备份还原需要的空间
--====================================================== --使用于SQL SERVER 2008 和SQL SERVER 2008 R2 ) ...
- 将GridView的数据导出Excel
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename ...
- 使用C#创建windows服务续之使用Topshelf优化Windows服务
前言: 之前写了一篇“使用C#创建windows服务”,https://www.cnblogs.com/huangwei1992/p/9693167.html,然后有博友给我推荐了一个开源框架Tops ...