首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

开启MC13192的RX出现的问题

开启MC13192的RX出现的问题

利用SMAC提供的源代码,当我用MLMERXEnableRequest(&rx_packet,0);开启接收器后,程序在执行过程中以比较高的频率进入void interrupt IRQIsr(void);读出的状态是0x0080,满足 ((u16StatusContent & RX_IRQ_MASK) != 0)及(u8DataLength < 3)的条件.如下程序所示


if ((u16StatusContent & RX_IRQ_MASK) != 0)


{


        RTXENDeAssert();            /* Forces the MC13192 to idle. */
        if ((u16StatusContent & CRC_VALID_MASK) == 0)
        {
            /* If an invalid CRC, restart receiver. */
            /* Read the MC13192 trx register. Timer trigger off. */
            u16StatusContent = (SPIDrvRead(MODE_ADDR) & 0xFF7F);
            /* Update the trx register */         
            SPIDrvWrite(MODE_ADDR, u16StatusContent);
            RTXENAssert(); /* Forces the MC13192 to enter the receive mode. */
            return;
        }
        else {
            /* Read received packet length register and mask off length bits */
            u8DataLength = (UINT8) (SPIDrvRead(RX_PKT_LEN) & 0x7F);
            if (u8DataLength < 3) /* Rx_pkt_length is bad when <3 because of CRC */
            {
                /* Read the MC13192 trx register. Timer trigger off. */               
                u16StatusContent = (SPIDrvRead(MODE_ADDR) & 0xFF7F);
                /* Update the trx register. */
                SPIDrvWrite(MODE_ADDR, u16StatusContent);
                /* Forces the MC13192 to enter the receive mode. */
                RTXENAssert(); 
                return;
            }
             /* A valid packet has been received. */
            gu8RTxMode = IDLE_MODE;             /* Set the rtx_state to idle */
            SPIDrvWrite(T1_HI_ADDR, 0x8000);    /*
                                                 * Disables TC1 and clears the
                                                 * IRQ.
                                                 */
            SPIDrvWrite(T1_LO_ADDR, 0x0000);
            RAMDrvReadRx();
            printTRXBuffer(1); //RxBuffer中的数据打印
            return;


所以每次它都在做无为的工作,这种情况大大影响我的执行效率,这是怎么回事呢?我怎么能够让它在真的有数据的情况下才进入IRQIsr().

IRQ中断不光监测接收的情况,还有其他出错等等的情况都靠其监控,所以这个中断是会经常进入的
MC13192SARD工作不正常:在执行下面这段初始化程序(该程序是SMAC中提取出的)时,始终无法检测到IRQFLAG等于1,于是处于该 while (u8AttnIrq == FALSE)死循环中.程序在其他板子上运行正常,请问这块板子可能的问题是什么?我该怎么检测呢?
void MCUInit(void)
{
UINT16 u16IrqReg =0;
UINT8 u8AttnIrq = FALSE;
UINT8 u8TimerHi, u8TimerLo;

SOPT = 0x73; /* Turn off the watchdog. */

gu8RTxMode = RESET_DELAY;

/* Add a delay to debouce the reset switch on development boards ~200ms */
TPM1SC = 0x0D; /*
* Set the Timer module to use BUSCLK as
* reference with Prescaler at / 32
*/
do {
u8TimerHi = TPM1CNTH; /* Get value of timer register (hi byte) */
u8TimerLo = TPM1CNTL; /* Get value of timer register (lo byte) */
} while (u8TimerLo <= 0x80);/*
* Poll for TIMER LO to be greater than
* 0x80 at 4MHz/32
*/
TPM1SC = 0x00; /* Return to reset values */

gu8RTxMode = SYSTEM_RESET_MODE;
GPIOInit();
SPIInit();
IRQInit(); /* Turn on the IRQ pin. */
gu8RTxMode = MC13192_RESET_MODE;
MC13192_RESET = 1; /* Take MC13192 out of reset */

while (u8AttnIrq == FALSE) {
if (IRQFLAG == 1) { /* Check to see if IRQ is asserted */
u16IrqReg = SPIDrvRead(STATUS_ADDR); //IRQ status
/* * Clear MC13192 interrupts and
* check for ATTN IRQ from 13192
*/
u16IrqReg &= 0x400;
if (u16IrqReg == 0) {
u8AttnIrq = FALSE;
}
else {
u8AttnIrq = TRUE;
}
}
}

IRQACK(); /* ACK the pending IRQ interrupt */
IRQPinEnable(); /* Pin Enable, IE, IRQ CLR, negative edge. */
gu8RTxMode = MC13192_CONFIG_MODE;
}

[此贴子已经被作者于2006-7-14 21:59:18编辑过]

说明没有外部中断过来,你可以查看一下IRQ引脚的电平,其他板子可以运行,独独这块不行,看起来应该是硬件上的问题。有可能13192没有正常工作,检查一下焊接
返回列表