(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) { / ...
随机推荐
- jquery统计显示或隐藏的元素个数
统计显示的checkbox的数量: 统计隐藏的checkbox数量:
- 2018.09.27 bzoj4300: 绝世好题(二进制dp)
传送门 简单dp. 根据题目的描述. 如果数列bn{b_n}bn合法. 那么有:bi−1b_{i-1}bi−1&bi!=0b_i!=0bi!=0,因此我们用f[i]f[i]f[i]表示数 ...
- 2018.09.11 loj#10216.五指山(exgcd)
传送门 就是一个exgcd的板子. 但注意算距离差的时候是在一个环上面算. 还有,答案要开long long233... 注意这两点之后就是exgcd板子了. 代码: #include<bits ...
- Linux服务器部署系列之五—Webmin篇
对于很多习惯使用windows的用户,在刚接触Linux的时候,要使用命令行配置Linux服务器可能会感觉难以适应.今天我们来讲解一下,Linux下的图形配置工具—Webmin,通过这款工具,用户可以 ...
- 7系列GTX中的疑惑
1.PCOMMA与MCOMMA指什么? PCOMMA是指RD-部分的数据,MCOMMA是指RD+部分的数据. 2.risk信号作用? risk信号来指示有效的K码. 如果不选择用8b10b来编码,是需 ...
- autolayout之后获取uiview的frame
这个只要一行代码就搞定了.详细请看: In order to get the right frame/bounds of your UIImageView after resizing, you ne ...
- HDU1181 变形课(DFS) 2016-07-24 13:31 73人阅读 评论(0) 收藏
变形课 Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒 ...
- AXI总线(转)
AXI(Advanced eXtensible Interface)是一种总协议,该协议是ARM公司提出的AMBA(Advanced Microcontroller Bus Architecture) ...
- Java实现wc部分功能
GitHub仓库:https://github.com/TaoTaoLv1/WcProject 一.开发前PSP表格预估* PSP2.1 Personal Software Process Stage ...
- Android sdcard文件读写操作
这次演示以,安卓原生操作系统 Nexus_6手机进行操作: AndroidManifest.xml配置相关权限: <!-- 增加权限 --> <uses-permission and ...