Missing interrupts

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Missing interrupts

659件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rborozco on Fri Feb 04 15:32:19 MST 2011
I implemented this code for a LPC2148, but only AD0 is generating interruptions, AD1 does not.

Any idea?

#include <LPC214X.H>
#define AD0CR_INIT 0x002107DE //HW scan of valid channels with 3.33MHz
#define AD1CR_INIT 0x0021078F //HW scan of valid channels with 3.33MHz
void ADC_Init(void)
{
    AD0INTEN=0x100;
    AD1INTEN=0x100;
    AD0CR   = AD0CR_INIT;
    AD1CR   = AD1CR_INIT;
}


void IRQ_Init(void)
{
VICIntSelect=0x0;
/*ADC0*/
VICVectCntl0 = 0x20 | 0x12;
VICVectAddr0 = (unsigned)AD0_ISR;
VICIntEnable |= 0x00040000;
/*ADC1*/
VICVectCntl1 = 0x20 | 0x15;
VICVectAddr1 = (unsigned)AD1_ISR;
VICIntEnable |= 0x00200000;
}

/*********************Interrupt vector for AD0******************/
void AD0_ISR(void) __irq
{
unsigned val,chan;
val=AD0GDR;
chan=(val>>24)&0x07;
val=((val>>8) & 0x03FF);
ad0_event_counter++;
SMC_power_sequencer(chan,val);
AD0STAT&=~(1<<16);//Clears interruption
VICVectAddr=0x00000000;
}

/*********************Interrupt vector for AD1******************/
void AD1_ISR(void) __irq
{
unsigned val,chan;
val=AD1GDR;
chan=0x08|((val>>24)&0x07);
val=((val>>8) & 0x03FF);
ad1_event_counter++;
SMC_power_sequencer(chan,val);
AD1STAT&=~(1<<16);//Clears interruption
VICVectAddr=0x00000000;
}

Thanks
Roberto B
0 件の賞賛
返信
1 返信

596件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Feb 04 19:34:55 MST 2011
[FONT=Arial]Hi Roberto,[/FONT]

[FONT=Arial]this forum is called 'LPCXpresso Forum' and AFAIK LPC2148 is not supported.[/FONT]

[FONT=Arial]Perhaps you get more support in LPC2000 Forum:[/FONT]

[FONT=Arial]http://tech.groups.yahoo.com/group/lpc2000/[/FONT]
0 件の賞賛
返信