jlgcumt 发表于 2009-11-23 15:04

为什么进不了中断?

本帖最后由 jlgcumt 于 2009-11-23 15:20 编辑

为什么进不了中断?
keil 写的LPC2292程序
#include<lpc22xx.h>

void Time1Init()
{
T1TC=0;
T1PR=0;
T1MCR=0x03;
T1MR0=55;
T1TCR=0x01;
}
void IRQ_Time1(void) __irq
{

IO2CLR=1<<22;
VICVectAddr=0x00;
}
main()
{
PINSEL2=(PINSEL2&0xffffff0f) | 0x00;
IO2DIR=1<<22;

/* 设置定时器1中断IRQ */
VICIntSelect = 0x00;    /* 所有中断通道设置为IRQ中断   */
VICVectCntl0 = 0x20 | 0x05;   /* 设置定时器1中断通道分配最高优先级 */
VICVectAddr0 = (unsigned int)IRQ_Time1; /* 设置中断服务程序地址   */
VICIntEnable = 1<<0x05;       /* 使能定时器1中断      */
Time1Init();

while (1);
}

Jimdo260122332 发表于 2009-11-24 08:01

:)

yuhuihui 发表于 2009-11-25 13:56

顶下

ma1986 发表于 2009-12-1 18:12

cpsr使能i f了吗???
页: [1]
查看完整版本: 为什么进不了中断?