13213 初始化时 irq总是0 怎么回事,请高人指教
- UID
- 341895
- 性别
- 男
|
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;
} |
|
|
|
|
|
- UID
- 104380
- 性别
- 男
|
|
|
|
|
|