28335sci中断接收
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了28335sci中断接收相关的知识,希望对你有一定的参考价值。
#include "DSP2833x_Device.h" // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
void Init_Gpio(void)
{ EALLOW;
GpioCtrlRegs.GPAMUX1.all=0x0000;
GpioCtrlRegs.GPADIR.all=0xffff;
EDIS;
}
interrupt void Scib_init(void)
{ GpioDataRegs.GPADAT.all=ScicRegs.SCIRXBUF.all;
PieCtrlRegs.PIEACK.all=PIEACK_GROUP8;
}
void Init_Sci(void)
{
EALLOW;
InitSysCtrl();
InitSciGpio();
InitPieCtrl();
EDIS;
EALLOW;
ScicRegs.SCIHBAUD=0x01;
ScicRegs.SCILBAUD=0xe7;
ScicRegs.SCICCR.bit.SCICHAR=7;
ScicRegs.SCICCR.bit.STOPBITS=0;
ScicRegs.SCICCR.bit.PARITYENA=0;
ScicRegs.SCICTL1.bit.RXENA=1;
ScicRegs.SCICTL2.bit.RXBKINTENA=1;
PieVectTable.SCIRXINTC=&Scib_init;
ScicRegs.SCICTL1.bit.SWRESET=1;
EDIS;
DINT;
IER=0x0000;
IFR=0x0000;
PieCtrlRegs.PIECTRL.bit.ENPIE=1;
PieCtrlRegs.PIEIER8.bit.INTx5=1;
IER|=M_INT8;
EINT;
ERTM;
}
void main(void)
{ Init_Gpio();
Init_Sci();
GpioDataRegs.GPADAT.all=0xffff;
while(1);
}
以上是关于28335sci中断接收的主要内容,如果未能解决你的问题,请参考以下文章
DSP28335基础教程——SCI串口通信实验(上位机收发显示)