SCI查询方式
来源:互联网 发布:淘宝网店铺转让协议 编辑:程序博客网 时间:2024/05/16 14:46
281x-SCI和PC间的通讯 // $ Date: 30/11/2009 整理: eyes417 $ // FILE : 281x-SCI_PC.c // // PC发送至串口,DSP再回送至PC // // // ASSUMPTIONS: // # include "DSP281x_Device.h" // DSP281x Headerfile Include File void scia_echoback_init(void); Uint16 LoopCount; Uint16 ReceivedChar; // Step 1. Initialize System Control: InitSysCtrl(); // Step 2. Initalize GPIO: EALLOW; // Step 3. Clear all interrupts and initialize PIE vector table: DINT; // Disable CPU interrupts IER = 0x0000; IFR = 0x0000; InitPieVectTable(); //初始化PIE中断向量表 // Step 4. Initialize all the Device Peripherals: // InitPeripherals(); //初始化所有外设 // Step 5. User specific code: scia_fifo_init(); scia_echoback_init(); //从PC上的串口调试助手输入要发送的数据至DSP msg = "/r/nYou will enter a character, and the DSP will echo it back! /n/0"; for(;;) // 查询方式--接收--使用FIFO // Echo character back LoopCount++; } //end for } //end main //禁止接收错误中断,禁止休眠,使能发送,接收 //波特率设置 SCI-Band=LSPCLK/((BRR+1)*8)---9600K SciaRegs.SCICTL1.all =0x0023; // SCI初始化完成退出复位重启状态 } //串口发送--变量 } //串口发送--字符或字符串 // 初始化 SCI--FIFO } //===========================================================================
//###########################################################################
//
// TITLE: 281x-SCI和PC间的通讯 --- 查询方式,使用FIFO
//
// As supplied, this project is configured for "boot to H0" operation.
// Other then boot mode pin configuration, no other hardware configuration is required.
//###########################################################################
# include "DSP281x_Examples.h" // DSP281x Examples Include File
void scia_fifo_init(void);
void scia_xmit(int a); //串口发送--数据
void scia_msg(char *msg); //串口发送--字符串
void main(void)
{
char *msg;
// InitGpio(); //配置IO口功能为SCIA和SCIB模式
GpioMuxRegs.GPFMUX.bit.SCITXDA_GPIOF4 = 1;
GpioMuxRegs.GPFMUX.bit.SCIRXDA_GPIOF5 = 1;
GpioMuxRegs.GPGMUX.bit.SCITXDB_GPIOG4 = 1;
GpioMuxRegs.GPGMUX.bit.SCIRXDB_GPIOG5 = 1;
EDIS;
InitPieCtrl(); //初始化PIE控制寄存器
scia_msg(msg);
{
msg = "/r/nEnter a character: /0";
scia_msg(msg);
while(SciaRegs.SCIFFRX.bit.RXFIFST!=1) { } // wait for XRDY =1 for empty state
//XRDY =1 (空状态)等待数据发送
// 接收数据
ReceivedChar = SciaRegs.SCIRXBUF.all;
msg = " You sent: /0";
scia_msg(msg);
scia_xmit(ReceivedChar); //串口发送函数
//SCI-A初始化
void scia_echoback_init()
{
//通信控制寄存器,1个停止位,无奇偶校验,自测试禁止,空闲线模式,字符长度8位
SciaRegs.SCICCR.all =0x0007;
SciaRegs.SCICTL1.all =0x0003;
SciaRegs.SCICTL2.all =0x0003;
SciaRegs.SCICTL2.bit.TXINTENA =1; //使能TXRDY中断
SciaRegs.SCICTL2.bit.RXBKINTENA =1; //接收缓冲器中断使能
SciaRegs.SCIHBAUD = 0x0001;
SciaRegs.SCILBAUD = 0x00E7;
void scia_xmit(int a)
{
while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {}
SciaRegs.SCITXBUF=a;
void scia_msg(char * msg)
{
int16 i;
i = 0;
while(msg[i] != '/0')
{
scia_xmit(msg[i]);
i++;
}
}
void scia_fifo_init()
{
SciaRegs.SCIFFTX.all=0xE040; //允许接收,使能FIFO,清除TXFIFINT
SciaRegs.SCIFFRX.all=0x204f; //使能FIFO接收,清除RXFFINT,16级FIFO
SciaRegs.SCIFFCT.all=0x0000; //禁止波特率校验
// No more.
//===========================================================================
- SCI查询方式
- SCI期刊查询
- SCI查询系统
- SCI中断方式
- sci影响因子查询方法
- SCI论文及期刊查询
- SCI
- SCI
- SCI
- SCI
- SCI
- 如何查询SCI和EI索引号
- 如何查询SCI和EI检索号
- 如何查询SCI和EI检索号
- 如何查询SCI和EI检索号
- 通过pubmed查询sci相关信息
- EI 和 SCI 检索号查询
- SCI/EI/ISTP收录号查询方法
- 32位系统下安装windows 64位操作系统
- 2812---通用定时器1初始化程序(启动ADC)
- 雨夜
- 基于Ext+S2SH的企业人力资源管理系统
- DSP---PWM波形源码
- SCI查询方式
- winform怎么实现textbox提示框的效果
- form
- TMS320F2812引脚详细分析
- 精彩评论~~~~
- ASP.NET刷新页面的六种方法
- PCB设计流程--Protel99SE
- 基于MATLAB的FFT仿真
- python之os.walk(’path’)