定时器——ARM的Proteus实验.pdfVIP

  • 34
  • 0
  • 约1.17千字
  • 约 2页
  • 2022-04-21 发布于山东
  • 举报
定时器——ARM 的Proteus实验 实验原理 ARM 的定时器实验,定时改变LED 的状态。 Proteus仿真电路图 C语言源程序 #include LPC21xx.H #define LED 0x000001 typedef unsigned int uint32; typedef unsigned char uint8; void timer0_ISR (void) __attribute__ ((interrupt)); uint8 timer0Times = 0; void timer0Init (void) { T0MR0 = 119999;/*匹配寄存器,120000-1为1 秒*/ T0MCR = 3;/*产生中断,重 TC*/ T0TCR = 1;/*使能定时计数器0*/ VICVectAddr0 = (unsigned long)timer0_ISR; VICVectCntl0 = 0x20 | 4;/*定时器计数器0 为4 号中断*/ VICIntEnable = 0/*开定时计数器0 中断*/ } void timer0_ISR (void) {

文档评论(0)

1亿VIP精品文档

相关文档