标题:
28335 SCI 通信
[打印本页]
作者:
yuyang911220
时间:
2017-6-19 18:07
标题:
28335 SCI 通信
用的是SCI-B,问题是无法进入接收中断,接收引脚上有数据。
程序如下 :
EALLOW ;
GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 0 ;
GpioCtrlRegs.GPAMUX1.bit.GPIO11 = 0 ;
GpioCtrlRegs.GPAMUX1.bit.GPIO14 = 0 ;
GpioCtrlRegs.GPAMUX1.bit.GPIO15 = 0 ;
GpioCtrlRegs.GPAMUX2.bit.GPIO18 = 2 ; //设置为CAN总线,而不是SCI-B
GpioCtrlRegs.GPAMUX2.bit.GPIO19 = 2 ; //设置为CAN总线,而不是SCI-B
GpioCtrlRegs.GPAMUX2.bit.GPIO22 = 3 ; //设置SCI-B引脚
GpioCtrlRegs.GPAMUX2.bit.GPIO23 = 3 ; //设置SCI-B引脚
EDIS ;
ScibRegs.SCICCR.all = 0x07; //1位结束位,无奇偶校验,8位数据位
ScibRegs.SCICTL1.all = 0x03; //使能transmitter和receiver,禁用sleep,屏蔽接收错误中断,复位SCI
ScibRegs.SCIHBAUD = 0;
ScibRegs.SCILBAUD = 80 & 0x00FF; //波特率=37500000/((80+1)*8)=57870
ScibRegs.SCICTL2.all = 0x0002; //起用Receiver-buffer interrupt,禁用SCITXBUF-register interrupt
ScibRegs.SCICTL1.all = 0x0023; //停止复位SCI
PieVectTable.SCIRXINTB = &SCI_RX_ISR; //SCI接收中断处理程序
PieCtrlRegs.PIEIER9.bit.INTx3 = 1; // SCIB接收中断使能
IER |= 0x0100; // enable PIEIER9, and INT9
EINT;
ERTM;//全局中断使能
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/)
Powered by Discuz! 7.0.0