Fork Me on GitHub

源码开放学ARM

LASO - Learn ARM with Source Open

首页         目录索引         资料下载         代码下载         联系作者        
下载PDF打印版本

定时器寄存器配置

Register  Address 
TCFG0 	0xE250_0000 	65
	PCLK = 66M 	66000000 -> 分频
	Timer Input Clock Frequency = PCLK / ( {prescaler value + 1} ) / {divider value} 
		{prescaler value} = 1~255  
		{divider value} = 1, 2, 4, 8, 16, TCLK 
	66M/66(65+1)	= 1M = 1000000
	
TCFG1  	0xE250_0004 	0100=0x4
	1M/16 = 62500
	
TCON  	0xE250_0008 
	*[3] Timer 0 Auto Reload on/off  
			0 = One-Shot  
			1 = Interval Mode(Auto-Reload) 
	[2]	Timer 0 Output Inverter on/off    
			0 = Inverter Off  
			1 = TOUT_0 Inverter-On 
	*[1]	Timer 0 Manual Update    
			0 = No Operation    
			1 = Update TCNTB0,TCMPB0 
	*[0] Timer 0 Start/Stop  
			0 = Stop     
			1 = Start Timer 0 
	
TCNTB0  0xE250_000C 
	val = 62500 (=1s)
	
TCMPB0  0xE250_0010 
	
TCNTO0  0xE250_0014 
	read value -> TCNT0's value

TINT_CSTAT, R/W, Address = 0xE250_0044)
	Interrupt Control and Status Register 
	Timer 0 Interrupt Status  
		[5]  Timer 0 Interrupt Status Bit. 
		Clears by writing ‘1’ on this bit. 	

	Timer 0 interrupt Enable  
		[0]   Enables Timer 0 Interrupt. 
			1 = Enables                  
			0 = Disabled 		

上一节 | 目录索引 | 下一节

blog comments powered by Disqus