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  [ 2 posts ] 
Author Message
 Post subject: AT91SAM9263 PIO Interrupt
PostPosted: Wed Feb 11, 2009 11:51 pm 
Offline

Joined: Wed Feb 11, 2009 11:42 pm
Posts: 13
Hi,
I need help with establishing a PIOA interrupt. My initialization code is as follows:

/* Enable clock (for interrupt functionality) */
AT91C_BASE_PMC->PMC_PCER |= (0x1 << AT91C_ID_PIOA);

/* Configure PEN_IRQ* PIO configuration. Set as an input. */
AT91C_BASE_PIOA->PIO_PPUER |= PENIRQ_PIOA_CFG;
AT91C_BASE_PIOA->PIO_IFER |= PENIRQ_PIOA_CFG;
AT91C_BASE_PIOA->PIO_ODR |= PENIRQ_PIOA_CFG;
AT91C_BASE_PIOA->PIO_PER |= PENIRQ_PIOA_CFG;

/* Clear and disable any interrupts for PIOA */
AT91C_BASE_PIOA->PIO_ISR;
AT91C_BASE_PIOA->PIO_IDR = 0xFFFFFFFF;

/* Configure PIOA IRQ in AIC */
AT91C_BASE_AIC->AIC_SMR[AT91C_ID_PIOA] = PENIRQ_IRQ_PRIO;
AT91C_BASE_AIC->AIC_SVR[AT91C_ID_PIOA] = (unsigned int)PENIRQ_Handler;

/* Configure PIOA IRQ */
AT91C_BASE_PIOA->PIO_IER = PENIRQ_PIOA_CFG;

/* Enable PIOA Irq in AIC */
AT91C_BASE_AIC->AIC_ICCR = (1 << AT91C_ID_PIOA);
AT91C_BASE_AIC->AIC_IECR = (1 << AT91C_ID_PIOA);

It's important to note that even though I've wired PENIRQ* to IRQ1, I'm not using the AIC IRQ1 but rather the status change interrupt of PIOA (so I can keep track of PENIRQ* states easier). So then, later in code, to "test" if the interrupt is working properly, I call:

AT91C_BASE_AIC->AIC_ISCR = 1 << AT91C_ID_PIOA;

I can tell it's not working because I have written into PENIRQ_Handler to change the display (very drastically). The behavior is, the initial image is displayed, and then nothing happens.

Can anyone please tell me what I'm not doing correctly? I'm guessing there's something I'm not initializing correctly.


Top
 Profile  
 
 Post subject: Re: AT91SAM9263 PIO Interrupt
PostPosted: Fri Jul 29, 2011 9:50 am 
Offline

Joined: Fri May 06, 2011 4:07 am
Posts: 17
Hello,I want to drive 2LEDs connected to PB[5:4] opreate all on and all off repeatly,but I don't know how to config those related registers.Could you tell me ?
1 is on and 0 is off.Please write to armboy@sohu.com.
Thank you for your attention.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


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: