public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] How to handle IRQ0 interrupt?
@ 2007-03-08 10:34 Neeraja
  2007-03-08 17:38 ` Paul D. DeRocco
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Neeraja @ 2007-03-08 10:34 UTC (permalink / raw)
  To: ecos-discuss


Hi,
    I am working on at91rm9200 board. I want to catch the interrupt when the
button is pressed which is connected to IRQ0 line.
  But what is happening is that when I run the application the interrupt isr
is being called always irrespective of the button press. 
 
Can anyone suggest me how to configure so that the interrupt comes only when
the button is pressed ?

Here is the part of the code I am using 

interrupt = CYGNUM_HAL_INTERRUPT_IRQ0;
cyg_interrupt_create(interrupt,
                             0,                     // Priority - what goes
here?
                             (cyg_addrword_t)0,     //  Data item passed to
interrupt handler
                             (cyg_ISR_t *)IRQ0_isr,
                             (cyg_DSR_t *)IRQ0_dsr,
                             &interrupt_handle,
                             &interrupt_object);

cyg_interrupt_attach(interrupt_handle);
cyg_interrupt_acknowledge(interrupt);
cyg_interrupt_unmask(interrupt);  

Thanks,
Neeraja.

-- 
View this message in context: http://www.nabble.com/How-to-handle-IRQ0-interrupt--tf3368441.html#a9372163
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [ECOS] How to handle IRQ0 interrupt?
  2007-03-08 10:34 [ECOS] How to handle IRQ0 interrupt? Neeraja
@ 2007-03-08 17:38 ` Paul D. DeRocco
  2007-03-09 12:55   ` [ECOS] " Neeraja
  2007-03-08 17:40 ` [ECOS] " Andrew Lunn
  2007-03-09  0:19 ` jiang jet
  2 siblings, 1 reply; 5+ messages in thread
From: Paul D. DeRocco @ 2007-03-08 17:38 UTC (permalink / raw)
  To: eCos Discuss

> From: Neeraja
> 
>     I am working on at91rm9200 board. I want to catch the 
> interrupt when the button is pressed which is connected to IRQ0 line.
>   But what is happening is that when I run the application 
> the interrupt isr is being called always irrespective of the 
> button press. 

Do you mean it interrupts over and over, and never leaves time for the
application? This can happen if it's programmed to be level-sensitive
instead of edge-sensitive.

Also, remember that mechanical switches need debouncing. This is why I
prefer polling switches at a 10ms-20ms rate, since that's fast enough for
human input, and slow enough not to see the bounce.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] How to handle IRQ0 interrupt?
  2007-03-08 10:34 [ECOS] How to handle IRQ0 interrupt? Neeraja
  2007-03-08 17:38 ` Paul D. DeRocco
@ 2007-03-08 17:40 ` Andrew Lunn
  2007-03-09  0:19 ` jiang jet
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2007-03-08 17:40 UTC (permalink / raw)
  To: Neeraja; +Cc: ecos-discuss

On Thu, Mar 08, 2007 at 02:34:26AM -0800, Neeraja wrote:
> 
> Hi,
>     I am working on at91rm9200 board. I want to catch the interrupt when the
> button is pressed which is connected to IRQ0 line.
>   But what is happening is that when I run the application the interrupt isr
> is being called always irrespective of the button press. 
>  
> Can anyone suggest me how to configure so that the interrupt comes only when
> the button is pressed ?
> 
> Here is the part of the code I am using 
> 
> interrupt = CYGNUM_HAL_INTERRUPT_IRQ0;
> cyg_interrupt_create(interrupt,
>                              0,                     // Priority - what goes
> here?
>                              (cyg_addrword_t)0,     //  Data item passed to
> interrupt handler
>                              (cyg_ISR_t *)IRQ0_isr,
>                              (cyg_DSR_t *)IRQ0_dsr,
>                              &interrupt_handle,
>                              &interrupt_object);
> 
> cyg_interrupt_attach(interrupt_handle);
> cyg_interrupt_acknowledge(interrupt);
> cyg_interrupt_unmask(interrupt);  

Please show us the code which you use the setup the PIO.

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [ECOS] How to handle IRQ0 interrupt?
  2007-03-08 10:34 [ECOS] How to handle IRQ0 interrupt? Neeraja
  2007-03-08 17:38 ` Paul D. DeRocco
  2007-03-08 17:40 ` [ECOS] " Andrew Lunn
@ 2007-03-09  0:19 ` jiang jet
  2 siblings, 0 replies; 5+ messages in thread
From: jiang jet @ 2007-03-09  0:19 UTC (permalink / raw)
  To: neeraja.kothala; +Cc: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312; format=flowed, Size: 1980 bytes --]




>From: Neeraja <neeraja.kothala@gmail.com>
>To: ecos-discuss@ecos.sourceware.org
>Subject: [ECOS] How to handle IRQ0 interrupt?
>Date: Thu, 8 Mar 2007 02:34:26 -0800 (PST)
>
>
>Hi,
>     I am working on at91rm9200 board. I want to catch the interrupt when 
the
>button is pressed which is connected to IRQ0 line.
>   But what is happening is that when I run the application the interrupt 
isr
>is being called always irrespective of the button press.
>
>Can anyone suggest me how to configure so that the interrupt comes only 
when
>the button is pressed ?
>
I think it's hardware related..you have to assign interrupt number 0 to 
indicate the press of button
>Here is the part of the code I am using
>
>interrupt = CYGNUM_HAL_INTERRUPT_IRQ0;
>cyg_interrupt_create(interrupt,
>                              0,                     // Priority - what 
goes
>here?
>                              (cyg_addrword_t)0,     //  Data item passed 
to
>interrupt handler
>                              (cyg_ISR_t *)IRQ0_isr,
>                              (cyg_DSR_t *)IRQ0_dsr,
>                              &interrupt_handle,
>                              &interrupt_object);
>
>cyg_interrupt_attach(interrupt_handle);
>cyg_interrupt_acknowledge(interrupt);
>cyg_interrupt_unmask(interrupt);
>
>Thanks,
>Neeraja.
>
>--
>View this message in context: 
http://www.nabble.com/How-to-handle-IRQ0-interrupt--tf3368441.html#a9372163
>Sent from the Sourceware - ecos-discuss mailing list archive at 
Nabble.com.
>
>
>--
>Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
>and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
>

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£  http://www.hotmail.com  


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ECOS] RE: How to handle IRQ0 interrupt?
  2007-03-08 17:38 ` Paul D. DeRocco
@ 2007-03-09 12:55   ` Neeraja
  0 siblings, 0 replies; 5+ messages in thread
From: Neeraja @ 2007-03-09 12:55 UTC (permalink / raw)
  To: ecos-discuss


Hi,

    I have confiured the interrupt as positive edge triggered interrupt
using the api 
  cyg_interrupt_configure(interrupt,level,up);
  
    Then it stopped giving interrupt continuously and not interrupting even
when the button is pressed.
 This is the code I am using to set up the PIO

*AT91C_PIOB_PDR = 0x20000000; //PB29 - corresponds to IRQ0 
 *AT91C_PIOB_ASR = 0x20000000;
*AT91C_PIOB_BSR = 0x0;

Is there any thing that I am missing? Any suggestions what else can be done?

Regards,
Neeraja.


Paul D. DeRocco wrote:
> 
>> From: Neeraja
>> 
>>     I am working on at91rm9200 board. I want to catch the 
>> interrupt when the button is pressed which is connected to IRQ0 line.
>>   But what is happening is that when I run the application 
>> the interrupt isr is being called always irrespective of the 
>> button press. 
> 
> Do you mean it interrupts over and over, and never leaves time for the
> application? This can happen if it's programmed to be level-sensitive
> instead of edge-sensitive.
> 
> Also, remember that mechanical switches need debouncing. This is why I
> prefer polling switches at a 10ms-20ms rate, since that's fast enough for
> human input, and slow enough not to see the bounce.
> 
> -- 
> 
> Ciao,               Paul D. DeRocco
> Paul                mailto:pderocco@ix.netcom.com
> 
> 
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-handle-IRQ0-interrupt--tf3368441.html#a9393816
Sent from the Sourceware - ecos-discuss mailing list archive at Nabble.com.


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-09 12:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-08 10:34 [ECOS] How to handle IRQ0 interrupt? Neeraja
2007-03-08 17:38 ` Paul D. DeRocco
2007-03-09 12:55   ` [ECOS] " Neeraja
2007-03-08 17:40 ` [ECOS] " Andrew Lunn
2007-03-09  0:19 ` jiang jet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).