Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: AT91SAM9263 Interrupt
PostPosted: Wed Feb 11, 2009 5:49 pm 
Offline

Joined: Thu Sep 18, 2008 10:36 am
Posts: 3
How to setup the interrupt on falling edge of the PIO pin.
When we setup an interrupt using the function "KernelIoControl", is it possible to specify that we want the interrupt on either the falling/rising edge or at level detect.


Top
 Profile  
 
 Post subject: Re: AT91SAM9263 Interrupt
PostPosted: Wed Feb 18, 2009 3:46 pm 
Offline

Joined: Thu Sep 18, 2008 10:36 am
Posts: 3
I came to know that we can configure the interrupt either on edge or level both positive and negative by configuring the AIC register AIC_SMR[i] in OALIntrInit()

But it can only be configured for the whole port.
___________________________________________________

I wolud like to know how to configure the FIQ , IRQ0 and IRQ1.
I tried configuring the FIQ.
I am able to get the PIO interrupt from the corresponding pin PD4.
But i was not able to configure the FIQ for the same pin.
I configured PD4 as PIO_PERIPH_A
I used
Pin_IRQ =0;
KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &Pin_IRQ, sizeof(Pin_IRQ), &Pin_IRQ_Intr, sizeof(Pin_IRQ_Intr),0);

Is it correct?
Any help regarding this matter is highly awaited.

Thanks,
som


Top
 Profile  
 
 Post subject: Re: AT91SAM9263 Interrupt
PostPosted: Sat Aug 29, 2009 11:07 am 
Offline

Joined: Fri Jan 16, 2009 10:46 pm
Posts: 44
hello,

Just a clarification using a I/O pin as interrupt source, how I can configure it as level or edge interrupt source:

I have this code

static const struct pio_desc hw_pio[] = {
{"SCIRQ", AT91C_PIN_PD(4), 0, PIO_PULLUP, PIO_INPUT},
};

//set the PD4 as input for interrupt
pio_setup(hw_pio, (sizeof(hw_pio)/sizeof(struct pio_desc)));

// Request SysIntr for IRQ PD4
dwLogIntr = (LOGINTR_BASE_PIOD + 4);
SetLastError(ERROR_SUCCESS);

if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &dwLogIntr, sizeof(DWORD), &Sysintr, sizeof(DWORD), &dwBytesReturned))
{
RETAILMSG(1, (TEXT("ERROR: Failed to request the sysintr, errorcode = %d \r\n"),GetLastError()));
Sysintr = SYSINTR_UNDEFINED;
return (FALSE);
}

That's enough to set the pin as level interrupt?
thanks!


Top
 Profile  
 
 Post subject: Re: AT91SAM9263 Interrupt
PostPosted: Wed Sep 09, 2009 2:39 pm 
Offline

Joined: Fri May 14, 2004 9:58 am
Posts: 183
Location: France - USA
Hello bob and somappu,

If you implement the code of bob, PD4 is used as a standard GPIO interrupt source, not as a FIQ !

FIQ is a special interrupt source which is not natively managed by WinCE. To enable it, you need to set PD4 as a PERIPH_A pin and set the AIC to handling FIQ. OEMInterruptHandlerFIQ() routine (located in %_TARGETPLATROOT%\SRC\OAL\OALLIB\fiq.c) is called when FIQ is triggered, but, in this function, consider you are OSless !!!

IRQ0 or IRQ1 can be used as WinCE standard interrupt sources. You need to set the IRQx pin as PERIPH_B, request a SysIntr, change the SRCTYPE of the corresponding AIC_SMR[] to the desired type of trigger.

HTH


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: