dbout.c

来自「瑞泰TMS320VC33目标板的串口通讯测试程序」· C语言 代码 · 共 68 行

C
68
字号
#define DBOUT			*(int *)0xB00000
#define TIM_CTL     	*(int *)0x808030 /* Timer 1 Global Control */
#define TIM_CNT     	*(int *)0x808034 /* Timer 1 Counter */
#define TIM_PRD	    	*(int *)0x808038 /* Timer 1 Period Register */

#define TIM_CTL_VALUE   0x601 /* TCLK as a timer pin; use internal clock source */
#define TIM_PRD_VALUE   1000  /* 60Mhz/sample frequency */    
#define TIM_START       0xc0   

cregister unsigned int IOF,IE,IF,ST;
void interrupt int1(void); 

main()
{
	int i;  
	int buf;
	ST = 0x00; /* GIE = 0 */
	TIM_CTL = TIM_CTL_VALUE;
	TIM_CNT = 0;
	TIM_PRD = TIM_PRD_VALUE;
	TIM_CTL = TIM_CTL_VALUE | TIM_START; /* Tmier 0 resets and starts */  
	
	/*
	IE=0x2;
	IF=0;
	ST=0x2000; 	
	INT1 = (int )int1|0x60000000;
	*/ 
	
	buf = DBOUT;   
	asm(" NOP"); 
	DBOUT = 0x0000;
    asm(" NOP");  
	asm(" NOP");
	asm(" NOP"); 
	asm(" NOP");  
	for(;;)
	{
		DBOUT = 0xFFFF;		 
		asm(" NOP");  
		asm(" NOP");
		asm(" NOP"); 
		asm(" NOP");
		/* buf = DBOUT; */ /* Read */
		asm(" NOP");
		asm(" NOP");
		asm(" NOP");  	
		DBOUT = 0x0000; 
		asm(" NOP");
		asm(" NOP"); 
		asm(" NOP");
		asm(" NOP");  
		/* buf = DBOUT; */ /*Read */ 
		asm(" NOP");
		asm(" NOP");
		asm(" NOP");	
      }

}

/* void interrupt int1(void)
{
	int i;
	i=0;
	i++;
} */

⌨️ 快捷键说明

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