首页 > 技术 > S3C2410 定时计数器的使用

S3C2410 定时计数器的使用

2006年12月26日

调试定时计数器成功,根据手册上的方法

1) Write the initial value into TCNTBn and TCMPBn.
2) Set the manual update bit of the corresponding timer. It is recommended that you configure the inverter on/off bit.
(whether use inverter or not).
3) Set start bit of the corresponding timer to start the timer (and clear the manual update bit).

代码如下:

#include “2410addr.h”
void Delay(void);
int Main()
{
rGPBCON=0×2aa;
rTCFG0=0xff;
rTCFG1=0×0;
rTCNTB0=0xa0;
rTCMPB0=0×6e;
rTCON|=0×0a;
rTCON|=0×1;
rTCON&=0xfffffffd;

}

Jacob 技术

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.

*

Anti-spam image