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  [ 12 posts ] 
Author Message
 Post subject: Urgent help + External interrupt not working on AT91SAM9260
PostPosted: Mon Jun 18, 2007 8:01 am 
Offline

Joined: Mon Jun 04, 2007 6:57 am
Posts: 5
Location: pune
hi all,
i am using my own board having AT91SAM9260 on it. I've connected 1 push-button switch to the pin pc15 to be used as an IRQ1.
i am tryin to make this interrupt work but all in wain....
i've already done the folloein things...
1) on address 0x18 the instruction ldr pc,[pc,#-0xF20] and stack for IRQ,abort,FIQ etc

2) in my INTERRuPT initialization routine...
*PIOC_BSR = (0x01 << 15);
*PIOC_PDR = (0x01 << 15);

*AIC_SMR28 = 0x00000047;
*AIC_SVR28 = (unsigned long)Handler2;


*AIC_IECR = (0x1 << 28);


*PMC_PCER = *PMC_PCER |(0x40000008);

3) in IRQ handler ...
*AIC_ICCR = (0x1 << 28);
some print then..
*AIC_EOICR = ACK;

4) in main function infinite while loop with some print is there
but it is not working .. can any1 help me to make it working ???

_________________
dev


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Wed Mar 21, 2012 2:20 pm 
Offline

Joined: Wed Mar 21, 2012 11:10 am
Posts: 5
hello, i'm wondering whether somebody ever gets any useful answers from this site? 'cause this posting dated 2007 and i did not see any responses down below... similar as many of the other postings i read. well, five years later i'm having similar problems yet still wishing for some miracle help to happen... maybe it's too easy for some other people


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Wed Mar 21, 2012 2:48 pm 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
I found in my resources a similar project but working under a91sam7. Could you have a look at the attachment?


Attachments:
Switch_IRQ.zip [213.06 KiB]
Downloaded 47 times

_________________
Best regards
Przemyslaw Baranski
Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Thu Mar 22, 2012 11:42 am 
Offline

Joined: Wed Mar 21, 2012 11:10 am
Posts: 5
Dear Przemyslaw,
Thank you so much for your effort to help. I really appreciate your gesture. We looked at the example you provided. It seems there must be quite large differencies in terms of the process handling interrupt between ARM7 and ARM9, especially with different chips. For 9260, the datasheet is quite clear on how to configure the registers regarding interrupt handling, as shown by Dev five years ago at the top. We tried similar process but failed to get any responses.
The problem could be just a simple point that we missed, and it should be quite easy for the experienced engineers, if they are willing to look a little bit into it. But I guess most of the experts are bussy and don't have time to deal with the trivial things. Yet, is it the purpose of this website?
Anyway, thanks again and wish you the best too.


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Thu Mar 22, 2012 12:10 pm 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
I do get your point. I know it's frustrating.

I've got some suspicions regarding the ID. IRQ1 has an ID of 30?
*AIC_IECR = (0x1 << 28); ????

_________________
Best regards
Przemyslaw Baranski


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Mon Mar 26, 2012 9:33 am 
Offline

Joined: Wed Mar 21, 2012 11:10 am
Posts: 5
you were right, Przemyslaw,
Dev did get the ID wrong in the original message. but we checked on our project and did not find this kind of mistake.
we actually tried a few interrupt sources, including IRQ0, FIQ, internal DBGU, EMAC, etc., and did not get any of them to work. so it must be something missing in the process. we thought it might be the entrance point at 0x18, we put a value of 0xe71fff20 in it (as ldr pc,[pc,#-0xF20]) as well and it did not work. so we stuck here...
have you got your problem solved?


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Mon Mar 26, 2012 9:53 am 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
I have a similar board with 9263. In 3-4 days I'll be through with one task at work and then we'll try to deal with it together.

_________________
Best regards
Przemyslaw Baranski


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Tue Apr 03, 2012 3:24 pm 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
Finally, I've got some free time and will dive into the problem. I'll let you know ASA I find sth out.

The example I sent you about ARM7 was a misfire. Mea culpa

_________________
Best regards
Przemyslaw Baranski


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Tue Apr 03, 2012 3:56 pm 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
I tested the program on my AT9G45 and it's working. The PD18 pin is connected to IRQ0.

If you happen to experience some problems, let me know.


Attachments:
IRQ.rar [3.07 KiB]
Downloaded 28 times

_________________
Best regards
Przemyslaw Baranski
Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Tue Apr 10, 2012 12:26 pm 
Offline

Joined: Wed Mar 21, 2012 11:10 am
Posts: 5
thanks, Przemyslaw, i just saw your message and started to give it another try. although the pin and the registers are different, the process for interrupt handling in 9G45 and in 9260 should be similar. we tried a simple real time timer interrupt, and used the code below and it did not work:

void set_aic (void (*newHandler) (void))
{
AIC_A_IDCR = 0x2; //sys_ID: system controller = 1
AIC_A_SMR1 = 0x63;
AIC_A_SVR1 = (unsigned int) newHandler;
AIC_A_ICCR = 0x2;
AIC_A_IECR = 0x2;
}
void main(void)
{
set_aic (printf_B); //a handler to print out stuff
RTT_MR = 0x60000; //reset the timer and the interrupt
}

what was missing?


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Tue Apr 10, 2012 9:24 pm 
Offline

Joined: Fri Mar 09, 2012 1:34 pm
Posts: 68
Hi!
With the timer, it is a different story. Could you first try the interrupt from the pin?

_________________
Best regards
Przemyslaw Baranski


Top
 Profile  
 
 Post subject: Re: Urgent help + External interrupt not working on AT91SAM9
PostPosted: Thu Apr 12, 2012 12:48 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 784
I'd avoid blowing away the prescale/divisor (0x8000) in the RTT's RTMR.

You should also be sure to enable the clocks for both the AIC/FIQ and SYS devices in the PMC's PCER, otherwise nothing will function.

Also pay particular attention to the ARM9's interrupt routine requirements, and how the toolchain, AIC, and startup code is handling this uglyness. For example the AIC can call routines marked '__irq' directly in Keil. The code provided by przemekbary includes startup code that wraps the AIC servicing code, and indirectly calls standard ABI 'C' functions. This is particularly important if you mix-n-match code from multiple tool chains with different expectations.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 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: