⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c54_timer.asm

📁 dsp芯片TMS320C5416实验程序
💻 ASM
字号:
;
; _StartTimer sets up the the C54x Timer registers and enable the
; timer interrupts. It must be called after the OSStart(). Therefore
; the best place to call it is in the first user task.
;
		.def 		_StartTimer
		
		.mmregs
		
TCR_STOP	.set	0x001f
TCR_RUN		.set	0x002f
*PRD_INIT	.set	0x3e7	;  together with TDDR, timer period 0x3e8*0x10/80MHz = 200us                        
*PRD_INIT	.set	0x280	;  together with TDDR, timer period 0x280*0x10/50MHz = 200us                        
PRD_INIT	.set	0x28e	;  together with TDDR, timer period 0x28E*0x10/50MHz = 200us                        
*PRD_INIT	.set	0x7d00	;  together with TDDR, timer period 0x28E*0x10/50MHz = 200us                        

		.text
		
_StartTimer: 
	
;----------------------------------
; Initialize Timer
;----------------------------------
	stm 	#TCR_STOP, TCR
	stm 	#PRD_INIT, PRD
	stm 	#TCR_RUN,  TCR
	                          
	ldm 	IMR, A				; read the IMR
	add 	#8, A				; turn on the TINT bit
	stlm 	A, IMR				; write it back to IMR

    stm   	#0xffff,	IFR    	; Writing a 1 to an IFR bit,
                           		; clears the interrupt flag 
	nop;
	nop; 
                           
    ret;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -