Board logo

标题: 13213 初始化时 irq总是0 怎么回事,请高人指教 [打印本页]

作者: titanzgq    时间: 2007-7-19 23:09     标题: 13213 初始化时 irq总是0 怎么回事,请高人指教

void mcu_init(void)
{
__uint16__ irq_reg =0;
__uint8__ attn_irq = FALSE, timer_hi, timer_lo;

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

rtx_mode = 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 Prescalar at / 32 */

do
{
timer_hi = TPM1CNTH; /* Get the value of the timer register (hi byte) */
timer_lo = TPM1CNTL; /* Get the value of the timer register (lo byte) */
}
while (timer_lo <= 0x80); /* Poll for TIMER LO to be greater than 0x80 at 4MHz/32*/

TPM1SC = 0x00; /* Return to reset values */

rtx_mode = SYSTEM_RESET_MODE;
init_gpio();
SPI1C1 = 0x50; /* Init SPI */
SPI1C2 = 0x00;
SPI1BR = 0x00;
IRQSC = 0x14; /* Turn on the IRQ pin. */
rtx_mode = MC13192_RESET_MODE;
MC13192_RESET = 1; /* Take MC13192 out of reset */


程序每次跑到下面这里就走不下去了,单步中断发现
if (IRQSC_IRQF == 1) { /* Check to see if IRQ is asserted */
IRQSC_IRQF总是=0,试了旧的13213板程序没问题,新作的机贴的却有这个问题,请问是不是没焊好啊?


while (attn_irq == FALSE) {
if (IRQSC_IRQF == 1) { /* Check to see if IRQ is asserted */
irq_reg = drv_read_spi_1(0x24); /* Clear MC13192 interrupts and check for ATTN IRQ from 13192*/
irq_reg &= 0x400;
if (irq_reg == 0)
attn_irq = FALSE;
else
attn_irq = TRUE;
}
}
IRQSC |= 0x04; /* ACK the pending IRQ interrupt */
IRQSC = 0x16; /* Pin Enable, IE, IRQ CLR, negative edge. */
rtx_mode = MC13192_CONFIG_MODE;
}
作者: strongchen    时间: 2007-7-20 14:10

量过IRQ引脚的电平没有?




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0