Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it work
like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when
EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
LPC2101 EINT problem
Started by ●October 23, 2006
Reply by ●October 24, 20062006-10-24
Even more strange. When I launch the code below in Keil, it reacts on LOW level.
However when I run it on my board = no interrupts at all.
I mailed NXP several times for support, but could not get any answer still.
Does anyone else have this issue ?
Thank you,
Dmitry/
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Sunday, October 22, 2006 4:27 PM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
However when I run it on my board = no interrupts at all.
I mailed NXP several times for support, but could not get any answer still.
Does anyone else have this issue ?
Thank you,
Dmitry/
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Sunday, October 22, 2006 4:27 PM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
>However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
>However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
I've not read the data sheets for this LPC variant however I do know that
a
number of others in the family have an issue with the setting of EXTMODE and
EXTPOLAR.
Have you checked your errata for these particular writes as you may not
actually be getting the behaviour you are expecting. There's an issue
between them and VPBDIV.
>From memory (and this may well be wrong so check the errata) the work around
is something like:
VPBDIV = 0;
EXTMODE = 0x9; // set EINT0 and EINT3 to edge detection
VPBDIV = 0x9; // Errata requirement to get the above register setting to
work
VPBDIV = 0;
VPBDIV = 1;
VPBDIV = 0;
EXTPOLAR = 0x9; // set EINT0 and EINT3 to rising edge detection
VPBDIV = 0x9; // Errata requirement to get the above register setting to
work
VPBDIV = 0;
VPBDIV = 1;
Long and short of it is to check your errata... Hopefully however this might
well help you.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Dmitry Borisov
Sent: 24 October 2006 06:26
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Even more strange. When I launch the code below in Keil, it reacts on LOW
level.
However when I run it on my board = no interrupts at all.
I mailed NXP several times for support, but could not get any answer
still.
Does anyone else have this issue ?
Thank you,
Dmitry/
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Sunday, October 22, 2006 4:27 PM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
number of others in the family have an issue with the setting of EXTMODE and
EXTPOLAR.
Have you checked your errata for these particular writes as you may not
actually be getting the behaviour you are expecting. There's an issue
between them and VPBDIV.
>From memory (and this may well be wrong so check the errata) the work around
is something like:
VPBDIV = 0;
EXTMODE = 0x9; // set EINT0 and EINT3 to edge detection
VPBDIV = 0x9; // Errata requirement to get the above register setting to
work
VPBDIV = 0;
VPBDIV = 1;
VPBDIV = 0;
EXTPOLAR = 0x9; // set EINT0 and EINT3 to rising edge detection
VPBDIV = 0x9; // Errata requirement to get the above register setting to
work
VPBDIV = 0;
VPBDIV = 1;
Long and short of it is to check your errata... Hopefully however this might
well help you.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Dmitry Borisov
Sent: 24 October 2006 06:26
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Even more strange. When I launch the code below in Keil, it reacts on LOW
level.
However when I run it on my board = no interrupts at all.
I mailed NXP several times for support, but could not get any answer
still.
Does anyone else have this issue ?
Thank you,
Dmitry/
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Sunday, October 22, 2006 4:27 PM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
No, although I agree his shifting 0x2 looks a little odd :)
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
Andrew Berney wrote:
>No, although I agree his shifting 0x2 looks a little odd :)
I don't think so.
>he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
>PINSEL0 which he will in effect do with his code.
>
>1<<30 would turn on RI(UART1) instead of EINT2.
>
Hmm, in _MY_ ( ;-) ) user guide (UM10161)
1 << 30 EINT2
2 << 30 Reserved
3 << 30 UART1
Albert
----------
No, although I agree his shifting 0x2 looks a little odd :)
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
>No, although I agree his shifting 0x2 looks a little odd :)
I don't think so.
>he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
>PINSEL0 which he will in effect do with his code.
>
>1<<30 would turn on RI(UART1) instead of EINT2.
>
Hmm, in _MY_ ( ;-) ) user guide (UM10161)
1 << 30 EINT2
2 << 30 Reserved
3 << 30 UART1
Albert
----------
No, although I agree his shifting 0x2 looks a little odd :)
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
Yes,
It looks odd to me too now ;)
I changed that to 1 and it works now just fine. The problem was that I did not look spec closely and relied on Keil simulator only.
The lesson to learn is to check the source first !
Thanks to everyone how replied, really appreciate it. The correct example is:
//------------
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
//------------
int main_( void )
{
PINSEL0 |= (unsigned int)1 << 30; // Select pin block for EINT2 <--- as in datasheet (not Keil) !!!
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
Dmitry/
----- Original Message -----
From: a...@vp.pl
To: l...
Sent: Tuesday, October 24, 2006 5:43 AM
Subject: Re: RE: [lpc2000] LPC2101 EINT problem
Andrew Berney wrote:
>No, although I agree his shifting 0x2 looks a little odd :)
I don't think so.
>he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
>PINSEL0 which he will in effect do with his code.
>
>1<<30 would turn on RI(UART1) instead of EINT2.
>
Hmm, in _MY_ ( ;-) ) user guide (UM10161)
1 << 30 EINT2
2 << 30 Reserved
3 << 30 UART1
Albert
----------
No, although I agree his shifting 0x2 looks a little odd :)
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
It looks odd to me too now ;)
I changed that to 1 and it works now just fine. The problem was that I did not look spec closely and relied on Keil simulator only.
The lesson to learn is to check the source first !
Thanks to everyone how replied, really appreciate it. The correct example is:
//------------
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
//------------
int main_( void )
{
PINSEL0 |= (unsigned int)1 << 30; // Select pin block for EINT2 <--- as in datasheet (not Keil) !!!
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
Dmitry/
----- Original Message -----
From: a...@vp.pl
To: l...
Sent: Tuesday, October 24, 2006 5:43 AM
Subject: Re: RE: [lpc2000] LPC2101 EINT problem
Andrew Berney wrote:
>No, although I agree his shifting 0x2 looks a little odd :)
I don't think so.
>he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
>PINSEL0 which he will in effect do with his code.
>
>1<<30 would turn on RI(UART1) instead of EINT2.
>
Hmm, in _MY_ ( ;-) ) user guide (UM10161)
1 << 30 EINT2
2 << 30 Reserved
3 << 30 UART1
Albert
----------
No, although I agree his shifting 0x2 looks a little odd :)
he's trying to set bit 31 to 1 and bit 30 to 0 in order to turn on EINT2 in
PINSEL0 which he will in effect do with his code.
1<<30 would turn on RI(UART1) instead of EINT2.
Andy
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
a...@vp.pl
Sent: 24 October 2006 09:11
To: l...
Subject: Re: [lpc2000] LPC2101 EINT problem
Dmitry Borisov wrote:
>Hi,
>I have a problem with my custom PCB based on LPC2101.
>I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
>However when I write a program to do that in Keil, I got no way to have
it work like I wish it to.
>The simple program is shown below:
>
>void EINT2Interrupt(void) __irq
>{
> EXTINT= 4;
> VICVectAddr = 0x0; // clear this interrupt from the VIC
>}
>int main_( void )
>{
> PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
Hmm, not
PINSEL0 |= (unsigned int)1 << 30;
?
Albert
----------
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to
happen.
However when I write a program to do that in Keil, I got no way to have it
work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still
interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
Reply by ●October 24, 20062006-10-24
--- In l..., "Dmitry Borisov" wrote:
>
> Yes,
> It looks odd to me too now ;)
> I changed that to 1 and it works now just fine. The problem was that
I did not look spec closely and relied on Keil simulator only.
> The lesson to learn is to check the source first !
> Thanks to everyone how replied, really appreciate it. The correct
example is:
There's a line in the movie Ronin where Robert DeNiro says something
like: "The map's not the terrain".
"The simulator's not the hardware" immediately comes to mind.
Richard
>
> Yes,
> It looks odd to me too now ;)
> I changed that to 1 and it works now just fine. The problem was that
I did not look spec closely and relied on Keil simulator only.
> The lesson to learn is to check the source first !
> Thanks to everyone how replied, really appreciate it. The correct
example is:
There's a line in the movie Ronin where Robert DeNiro says something
like: "The map's not the terrain".
"The simulator's not the hardware" immediately comes to mind.
Richard
Reply by ●October 30, 20062006-10-30
hi
try this ,its blinky using eint
There is something wrong in the simulator tools
i got this issue before , my app was running on the board, but not on the simulator
this may help you
http://www.keil.com/forum/docs/thread5104.asp
http://www.keil.com/forum/docs/thread7100.asp
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Monday, October 23, 2006 12:27 AM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/
try this ,its blinky using eint
There is something wrong in the simulator tools
i got this issue before , my app was running on the board, but not on the simulator
this may help you
http://www.keil.com/forum/docs/thread5104.asp
http://www.keil.com/forum/docs/thread7100.asp
----- Original Message -----
From: Dmitry Borisov
To: l...
Sent: Monday, October 23, 2006 12:27 AM
Subject: [lpc2000] LPC2101 EINT problem
Hi,
I have a problem with my custom PCB based on LPC2101.
I have an external signal on P0.15 that goes HIGH when interrupt need to happen.
However when I write a program to do that in Keil, I got no way to have it work like I wish it to.
The simple program is shown below:
void EINT2Interrupt(void) __irq
{
EXTINT= 4;
VICVectAddr = 0x0; // clear this interrupt from the VIC
}
int main_( void )
{
PINSEL0 |= (unsigned int)2 << 30; // Select pin block for EINT2
EXTMODE= 0; // Level triggered
EXTPOLAR= 4; // Polarity
VICVectAddr0 = (unsigned int)EINT2Interrupt; // address of the ISR
VICVectCntl0 = 0x20 | 0x10;
VICIntEnable |= (1<<16); // Enable EINT2
while(1);
}
No matter what values I specify in EXTMODE and EXTPOLAR it still interrupts when EINT2 goes LOW instead.
Is there any way to make it work on HIGH 0.15 pin ?
I searched for 2 days without any definite answer.
Can anyone shed the light on the issue ?
Thanks a lot,
Dmitry/