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

📄 dec5502_uartonchip.c

📁 TMS320VC5502的外部串口通信程序验证
💻 C
字号:
/******************************************************************************/
/*  Copyright 2004 by SEED Electronic Technology LTD.                         */
/*  All rights reserved. SEED Electronic Technology LTD.                      */
/*  Restricted rights to use, duplicate or disclose this code are             */
/*  granted through contract.                                                 */
/*	MODULE NAME... UART														  */
/*	PROJECT....... Communicate with PC by on-chip UART of 5502			      */
/*	FILENAME...... DEC5502_UART0NCHIP.c										  */
/*	DESCRIPTION:This is an example for on-chip UART of C5502				  */
/*  作者:韩敬                                                                */
/*  版本:1.0                                                                 */
/*	时间:2006-08-11                                                          */
/******************************************************************************/
#include <stdio.h>
#include <csl.h>
#include <csl_pll.h>
#include <csl_chip.h>
#include <csl_irq.h>
#include <csl_uart.h>
#include "Uart_Function.h"
#include "Timer.h"


#define SYSCNTL0 (*(volatile unsigned int *)(0x280000))	
Uint16 i=0;
Uint16 Temp;

void main(void)
{
	/* Initialize CSL library - This is REQUIRED !!! */
	CSL_init();
	
	/* Config PLL */
	PLL_setFreq(1,		// PLL mode
	 		  0xF, 		// Multiply factor, Valid values are (multiply by)10
	 		    0,		// Sysclk 0 Divide Down
	 		    1,		// Sysclk1 Divider 150MHz
	 		    3,		// Sysclk2 Divider 75MHz
	 		    3,		// Sysclk3 Divider
	 		    0);		// CLKOUT3(DSP core clock) divider 300MHz	 
	 		    
	/* 配置定时器 */
	Config_Timer();
	
	/* Select on-chip uart */
	SYSCNTL0 = 0x0;
	
	/* Perform two dummy read */
	Temp = (*(volatile ioport Uint16*)(0x9C00)); 
	Temp = (*(volatile ioport Uint16*)(0x9C00));
	
	/* Configure UART registers */
    Uart_Config();
    
	/* Clear recerver data structure
	for(i=0; i<LENGTH; i++)
	{
	 	DestData[i] = 0;
	} */
		
	DataCount = 0;
	
	for(;;)
	{ 
		
		if(PctoDsp == TRUE)
	 	{
	 		Write_Uart(LENGTH);
	 		PctoDsp = FALSE;
	 	}
	}	

}

/*****************************************************************************************/
//	No	more
/*****************************************************************************************/

⌨️ 快捷键说明

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