在线时间3 小时
UID423742
注册时间2013-3-28
NXP金币0
该用户从未签到
注册会员

- 积分
- 159
- 最后登录
- 1970-1-1
|
发表于 2014-9-1 14:48:27
|
显示全部楼层
我看了你的代码, 在下列代码中,你应当清除RDRF flag, 读SCI_STAT寄存器,然后读sci 数据集存期可以清除rdrf FLAG.
Receive Data Register Full Flag
This bit is set when the RX FIFO word count (CTRL2[RFCNT]) rises above the watermark
(CTRL2[RXWM]). Clear RDRF by reading STAT with RDRF set and then reading the SCI data register
until CTRL2[RFCNT] is no longer above CTRL2[RFWM]. If CTRL2[FIFO_EN] or CTRL2[RDE] is set, then
you can clear RDRF by reading the SCI data register without first reading STAT with RDRF set.
void isrQSCI0_Recv(void)
{
uint8 i=0;
uint8 SerialBuff[2]; //´æ·Å½ÓÊÕÊý¾ÝµÄÊý×é
QSCISend1(0,'a');
DisableInterrupt(); //½ûÖ¹×ÜÖжÏ
i = QSCIReN(0,1,SerialBuff); //µÈ´ý½ÓÊÕ1¸öÊý¾Ý
if(i==0) QSCISendN(0,1,SerialBuff);//·¢Ëͽӵ½µÄÊý¾Ý
EnInt(0);
EnableInterrupt(); //¿ª·Å×ÜÖжÏ
} |
|