共2条
1/1 1 跳转至页
问
芯片使用lpc2214,在定时器1中使用了4个匹配值,程序当中动态的改变,但是问题是:有的时候设置的匹配值明明大于当前的TC值,但是就是不能产生匹配中断(匹配中断是开着的),不知道为什么?
答 1:
或者两个匹配值基本相同,会不会在各自匹配的时候置位相应的IR位
答 2:
re.是否使用我们的工程模板,其它的中断是否可以正常产生。
只有匹配值等于TC值时才能发生匹配事件,可以产生中断。 答 3: 好像还是不行我发现当两个匹配值非常近的时候,好像只能匹配一个产生中断,另外一个就无法匹配了,中断程序使用的fiq,进程序后有如下操作:
1、读取IR值到一个临时变量,然后将该变量的值写入IR来清除中断
2、然后按位查询每个中断位,有中断就进行处理
3、退出中断
另外,我还尝试在退出中断之前从新进行以上步骤,再确认没有了中断之后再退出,但是问题依然存在,很奇怪。
当两个匹配值接近到0xff左右的时候,容易发生数值较大的匹配值无法匹配。我将IR清零了之后,按理说就可以再相应新的匹配中断了啊,但是还是不可以,郁闷好几天了。
我用的是keil 答 4: 请把中断服务程序代码贴出来看看。 答 5: 程序MR3是作为虚拟串口的
MR2-MR0作为其他串口的超时
程序注释少了点,麻烦了!
void FIQ_Handler(void) __fiq
{
unsigned char ucTemp;
unsigned char ucTmpPin,ucTmpIR;
static unsigned char s_ucCounter,s_ucParity,s_ucTmpByte,s_test;
T0TC = 0;
T0TCR = 1;
T1TCR = 0;
ucTmpIR = T1IR;
//while (ucTmpIR & 0x0f)
{
T1IR = ucTmpIR;
T1TCR = 1;
if ((ucTmpIR & (1<<3)) == (1<<3))
{
//T1IR = 1<<3;
if (gucSimUARTMode == UART_MODE_SEND) //·¢ËÍÊý¾Ý
{
switch(s_ucCounter)
{
case 0: //Æðʼλ
{
if (gusSimUARTSendLength == 0) //·¢ËͽáÊø
{
gucSimUARTMode = UART_MODE_RECV;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_TXD_SET;
T1MCR &= ~(7<<9);
//T1IR = 1<<3;
}
else //·¢ËÍÆðʼ룬²¢È¡³öÒ»¸ö´ý·¢×Ö½Ú
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
SIM_UART_TXD_CLR;
s_ucTmpByte = *gpucSimUARTSendStart++;
gusSimUARTSendLength--;
s_ucCounter++;
}
break;
}
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8: //Êý¾Ýλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
ucTmpPin = s_ucTmpByte & 0x01;
if (ucTmpPin == 0)
{
SIM_UART_TXD_CLR;
}
else
{
SIM_UART_TXD_SET;
}
s_ucTmpByte >>= 1;
s_ucParity += ucTmpPin;
s_ucCounter++;
break;
}
case 9:
{
switch (gucSimUARTParity)
{
case ODD:
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
if ((s_ucParity & 1) == 0)
{
SIM_UART_TXD_SET;
}
else
{
SIM_UART_TXD_CLR;
}
s_ucCounter++;
break;
}
case EVEN:
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
if ((s_ucParity & 1) == 0)
{
SIM_UART_TXD_CLR;
}
else
{
SIM_UART_TXD_SET;
}
s_ucCounter++;
break;
}
default: //ÎÞУÑé룬·¢Í£Ö¹Î»
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 2);
}
SIM_UART_TXD_SET;
s_ucCounter = 0;
}
}
break;
}
case 10: //ֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 2);
}
SIM_UART_TXD_SET;
s_ucCounter = 0;
break;
}
default:
{
gucSimUARTMode = UART_MODE_RECV;
SIM_UART_TXD_SET;
s_ucCounter = 0;
T1MCR &= ~(7<<9);
//T1IR = 1<<3;
}
}
}
else
{
if (gucSimUARTNewByte == 0) //Ö¡½áÊø
{
if ((gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength > 0) &&
(gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength <= SIM_UART_RECV_BUF_SIZE))
{
gstSimUARTRecv[gucSimUARTRecvCurFrame].ucReady = 1;
ucTemp = (gucSimUARTRecvCurFrame + 1) % SIM_UART_MAX_FRAME_NUM;
gstSimUARTRecv[ucTemp].usStart = ( gstSimUARTRecv[gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE;
gucSimUARTRecvCurFrame = ucTemp;
}
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength = 0;
gstSimUARTRecv[gucSimUARTRecvCurFrame].ucReady = 0;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
T1MCR &= ~(7<<9);
T1IR = 1<<3;
}
else //½ÓÊÕµ½Ò»¸öеÄ×Ö½Ú
{
ucTmpPin = SIM_UART_RXD_READ;
switch (s_ucCounter)
{
case 0: //Æðʼλ
{
if (ucTmpPin == 0) //ÕýÈ·µÄÆðʼλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucParity = 0;
s_ucTmpByte = 0;
s_ucCounter++;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
}
break;
}
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8: //½ÓÊÕµ½8¸öÊý¾Ýλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucTmpByte = (s_ucTmpByte>>1) + ucTmpPin;
s_ucParity += ucTmpPin;
s_ucCounter++;
break;
}
case 9: //½ÓÊÕУÑéλ
{
if (gucSimUARTParity == NONE) //ûÓÐУÑé룬¸Ãλ¾ÍÊÇֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
}
if (ucTmpPin == 0x80) //ÕýÈ·µÄ½ÓÊÕµ½ÁËֹͣ룬±£´æÊý¾Ý
{
gucSimUARTRecvBuf[(gstSimUARTRecv][gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE]=s_ucTmpByte;
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength++;
}
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucParity += ucTmpPin;
s_ucCounter++;
}
break;
}
case 10://ֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
}
if ((ucTmpPin == 0x80) &&
(((gucSimUARTParity == ODD) && (s_ucParity == 0x80)) ||
((gucSimUARTParity == EVEN) && (s_ucParity == 0)))) //½ÓÊÕµ½ÕýÈ·µÄÊý¾Ý
{
gucSimUARTRecvBuf[(gstSimUARTRecv][gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE]=s_ucTmpByte;
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength++;
}
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
break;
}
default:
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
//T1IR = 1<<3;
}
}
}
}
gulTC2 = T1TC;
gulMCR = T1MCR;
gulMR0 = T1MR0;
gulMR1 = T1MR1;
gulMR2 = T1MR2;
gulMR3 = T1MR3;
gulIR = T1IR;
}
if ((ucTmpIR & 1) == 1) //RS485½ÓÊÕ×Ö½Ú³¬Ê±
{
if (gucRS485Mode == UART_MODE_RECV)
{
if ((gstRS485Recv[gucRS485RecvCurFrame].usLength > 0) &&
(gstRS485Recv[gucRS485RecvCurFrame].usLength <= RS485_RECV_BUF_SIZE))
{
gstRS485Recv[gucRS485RecvCurFrame].ucReady = 1;
ucTemp = (gucRS485RecvCurFrame + 1) % RS485_MAX_FRAME_NUM;
gstRS485Recv[ucTemp].usStart = ( gstRS485Recv[gucRS485RecvCurFrame].usStart +
gstRS485Recv[gucRS485RecvCurFrame].usLength)
% RS485_RECV_BUF_SIZE;
gucRS485RecvCurFrame = ucTemp;
}
gstRS485Recv[gucRS485RecvCurFrame].usLength = 0;
gstRS485Recv[gucRS485RecvCurFrame].ucReady = 0;
}
else
{
gucRS485Mode = UART_MODE_RECV;
RS485_RECV;
}
T1MCR &= ~7;
//T1IR = 1;
}
if ((ucTmpIR & (1<<1)) == (1<<1)) //CDMA½ÓÊÕ×Ö½Ú³¬Ê±
{
if ((gstCDMARecv[gucCDMARecvCurFrame].usLength > 0) &&
(gstCDMARecv[gucCDMARecvCurFrame].usLength <= CDMA_RECV_BUF_SIZE))
{
gstCDMARecv[gucCDMARecvCurFrame].ucReady = 1;
ucTemp = (gucCDMARecvCurFrame + 1) % CDMA_MAX_FRAME_NUM;
gstCDMARecv[ucTemp].usStart = ( gstCDMARecv[gucCDMARecvCurFrame].usStart +
gstCDMARecv[gucCDMARecvCurFrame].usLength)
% CDMA_RECV_BUF_SIZE;
gucCDMARecvCurFrame = ucTemp;
}
gstCDMARecv[gucCDMARecvCurFrame].usLength = 0;
gstCDMARecv[gucCDMARecvCurFrame].ucReady = 0;
T1MCR &= ~(7<<3);
//T1IR = 1<<1;
}
if ((ucTmpIR & (1<<2)) == (1<<2)) //CDMA·¢ËÍ×Ö½Ú³¬Ê±
{
//T1IR = 1<<2;
gucCDMASending = 0;
T1MCR &= ~(7<<6);
}
//ucTmpIR = T1IR;
}
gultest = T0TC;
T0TCR = 0;
gulTC3 = T1TC;
} 答 6: 问题多个串口同时收发的时候就会有问题,就是所谓的匹配值相近的时候出现问题,程序当中动态的设置MR值,TC一直计数 答 7: 请各位帮忙看看,郁闷好多天了
只有匹配值等于TC值时才能发生匹配事件,可以产生中断。 答 3: 好像还是不行我发现当两个匹配值非常近的时候,好像只能匹配一个产生中断,另外一个就无法匹配了,中断程序使用的fiq,进程序后有如下操作:
1、读取IR值到一个临时变量,然后将该变量的值写入IR来清除中断
2、然后按位查询每个中断位,有中断就进行处理
3、退出中断
另外,我还尝试在退出中断之前从新进行以上步骤,再确认没有了中断之后再退出,但是问题依然存在,很奇怪。
当两个匹配值接近到0xff左右的时候,容易发生数值较大的匹配值无法匹配。我将IR清零了之后,按理说就可以再相应新的匹配中断了啊,但是还是不可以,郁闷好几天了。
我用的是keil 答 4: 请把中断服务程序代码贴出来看看。 答 5: 程序MR3是作为虚拟串口的
MR2-MR0作为其他串口的超时
程序注释少了点,麻烦了!
void FIQ_Handler(void) __fiq
{
unsigned char ucTemp;
unsigned char ucTmpPin,ucTmpIR;
static unsigned char s_ucCounter,s_ucParity,s_ucTmpByte,s_test;
T0TC = 0;
T0TCR = 1;
T1TCR = 0;
ucTmpIR = T1IR;
//while (ucTmpIR & 0x0f)
{
T1IR = ucTmpIR;
T1TCR = 1;
if ((ucTmpIR & (1<<3)) == (1<<3))
{
//T1IR = 1<<3;
if (gucSimUARTMode == UART_MODE_SEND) //·¢ËÍÊý¾Ý
{
switch(s_ucCounter)
{
case 0: //Æðʼλ
{
if (gusSimUARTSendLength == 0) //·¢ËͽáÊø
{
gucSimUARTMode = UART_MODE_RECV;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_TXD_SET;
T1MCR &= ~(7<<9);
//T1IR = 1<<3;
}
else //·¢ËÍÆðʼ룬²¢È¡³öÒ»¸ö´ý·¢×Ö½Ú
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
SIM_UART_TXD_CLR;
s_ucTmpByte = *gpucSimUARTSendStart++;
gusSimUARTSendLength--;
s_ucCounter++;
}
break;
}
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8: //Êý¾Ýλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
ucTmpPin = s_ucTmpByte & 0x01;
if (ucTmpPin == 0)
{
SIM_UART_TXD_CLR;
}
else
{
SIM_UART_TXD_SET;
}
s_ucTmpByte >>= 1;
s_ucParity += ucTmpPin;
s_ucCounter++;
break;
}
case 9:
{
switch (gucSimUARTParity)
{
case ODD:
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
if ((s_ucParity & 1) == 0)
{
SIM_UART_TXD_SET;
}
else
{
SIM_UART_TXD_CLR;
}
s_ucCounter++;
break;
}
case EVEN:
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
if ((s_ucParity & 1) == 0)
{
SIM_UART_TXD_CLR;
}
else
{
SIM_UART_TXD_SET;
}
s_ucCounter++;
break;
}
default: //ÎÞУÑé룬·¢Í£Ö¹Î»
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 2);
}
SIM_UART_TXD_SET;
s_ucCounter = 0;
}
}
break;
}
case 10: //ֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 2);
}
SIM_UART_TXD_SET;
s_ucCounter = 0;
break;
}
default:
{
gucSimUARTMode = UART_MODE_RECV;
SIM_UART_TXD_SET;
s_ucCounter = 0;
T1MCR &= ~(7<<9);
//T1IR = 1<<3;
}
}
}
else
{
if (gucSimUARTNewByte == 0) //Ö¡½áÊø
{
if ((gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength > 0) &&
(gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength <= SIM_UART_RECV_BUF_SIZE))
{
gstSimUARTRecv[gucSimUARTRecvCurFrame].ucReady = 1;
ucTemp = (gucSimUARTRecvCurFrame + 1) % SIM_UART_MAX_FRAME_NUM;
gstSimUARTRecv[ucTemp].usStart = ( gstSimUARTRecv[gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE;
gucSimUARTRecvCurFrame = ucTemp;
}
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength = 0;
gstSimUARTRecv[gucSimUARTRecvCurFrame].ucReady = 0;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
T1MCR &= ~(7<<9);
T1IR = 1<<3;
}
else //½ÓÊÕµ½Ò»¸öеÄ×Ö½Ú
{
ucTmpPin = SIM_UART_RXD_READ;
switch (s_ucCounter)
{
case 0: //Æðʼλ
{
if (ucTmpPin == 0) //ÕýÈ·µÄÆðʼλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucParity = 0;
s_ucTmpByte = 0;
s_ucCounter++;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
}
break;
}
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8: //½ÓÊÕµ½8¸öÊý¾Ýλ
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucTmpByte = (s_ucTmpByte>>1) + ucTmpPin;
s_ucParity += ucTmpPin;
s_ucCounter++;
break;
}
case 9: //½ÓÊÕУÑéλ
{
if (gucSimUARTParity == NONE) //ûÓÐУÑé룬¸Ãλ¾ÍÊÇֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
}
if (ucTmpPin == 0x80) //ÕýÈ·µÄ½ÓÊÕµ½ÁËֹͣ룬±£´æÊý¾Ý
{
gucSimUARTRecvBuf[(gstSimUARTRecv][gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE]=s_ucTmpByte;
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength++;
}
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
}
else
{
T1MR3 = T1TC + (gulSimUARTBaudRate << 1);
s_ucParity += ucTmpPin;
s_ucCounter++;
}
break;
}
case 10://ֹͣλ
{
if (gucSimUARTStopBit == STOP_BIT1)
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate;
}
else
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
}
if ((ucTmpPin == 0x80) &&
(((gucSimUARTParity == ODD) && (s_ucParity == 0x80)) ||
((gucSimUARTParity == EVEN) && (s_ucParity == 0)))) //½ÓÊÕµ½ÕýÈ·µÄÊý¾Ý
{
gucSimUARTRecvBuf[(gstSimUARTRecv][gucSimUARTRecvCurFrame].usStart +
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength)
% SIM_UART_RECV_BUF_SIZE]=s_ucTmpByte;
gstSimUARTRecv[gucSimUARTRecvCurFrame].usLength++;
}
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
break;
}
default:
{
T1MR3 = T1TC + gulSimUARTTimeOut + gulSimUARTBaudRate * 3;
SIM_UART_RXD_INT;
EXTINT |= (1<<0);
SIM_UART_RXD_EN_INT;
gucSimUARTNewByte = 0;
s_ucCounter = 0;
//T1IR = 1<<3;
}
}
}
}
gulTC2 = T1TC;
gulMCR = T1MCR;
gulMR0 = T1MR0;
gulMR1 = T1MR1;
gulMR2 = T1MR2;
gulMR3 = T1MR3;
gulIR = T1IR;
}
if ((ucTmpIR & 1) == 1) //RS485½ÓÊÕ×Ö½Ú³¬Ê±
{
if (gucRS485Mode == UART_MODE_RECV)
{
if ((gstRS485Recv[gucRS485RecvCurFrame].usLength > 0) &&
(gstRS485Recv[gucRS485RecvCurFrame].usLength <= RS485_RECV_BUF_SIZE))
{
gstRS485Recv[gucRS485RecvCurFrame].ucReady = 1;
ucTemp = (gucRS485RecvCurFrame + 1) % RS485_MAX_FRAME_NUM;
gstRS485Recv[ucTemp].usStart = ( gstRS485Recv[gucRS485RecvCurFrame].usStart +
gstRS485Recv[gucRS485RecvCurFrame].usLength)
% RS485_RECV_BUF_SIZE;
gucRS485RecvCurFrame = ucTemp;
}
gstRS485Recv[gucRS485RecvCurFrame].usLength = 0;
gstRS485Recv[gucRS485RecvCurFrame].ucReady = 0;
}
else
{
gucRS485Mode = UART_MODE_RECV;
RS485_RECV;
}
T1MCR &= ~7;
//T1IR = 1;
}
if ((ucTmpIR & (1<<1)) == (1<<1)) //CDMA½ÓÊÕ×Ö½Ú³¬Ê±
{
if ((gstCDMARecv[gucCDMARecvCurFrame].usLength > 0) &&
(gstCDMARecv[gucCDMARecvCurFrame].usLength <= CDMA_RECV_BUF_SIZE))
{
gstCDMARecv[gucCDMARecvCurFrame].ucReady = 1;
ucTemp = (gucCDMARecvCurFrame + 1) % CDMA_MAX_FRAME_NUM;
gstCDMARecv[ucTemp].usStart = ( gstCDMARecv[gucCDMARecvCurFrame].usStart +
gstCDMARecv[gucCDMARecvCurFrame].usLength)
% CDMA_RECV_BUF_SIZE;
gucCDMARecvCurFrame = ucTemp;
}
gstCDMARecv[gucCDMARecvCurFrame].usLength = 0;
gstCDMARecv[gucCDMARecvCurFrame].ucReady = 0;
T1MCR &= ~(7<<3);
//T1IR = 1<<1;
}
if ((ucTmpIR & (1<<2)) == (1<<2)) //CDMA·¢ËÍ×Ö½Ú³¬Ê±
{
//T1IR = 1<<2;
gucCDMASending = 0;
T1MCR &= ~(7<<6);
}
//ucTmpIR = T1IR;
}
gultest = T0TC;
T0TCR = 0;
gulTC3 = T1TC;
} 答 6: 问题多个串口同时收发的时候就会有问题,就是所谓的匹配值相近的时候出现问题,程序当中动态的设置MR值,TC一直计数 答 7: 请各位帮忙看看,郁闷好多天了
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |