For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU.
This group is to exchange information to help users get started and learn how to use the devices.
arm926ejs simple interrupts - kumori0 - Mar 6 23:21:30 2008
Hello everyone,
I'm a student, trying to move up from programming PIC micros to
working with ARM microcontrollers.
At the moment I have a lot of problems with the whole concept of
interrupts in ARM. Could someone tell me where I could find a simple
hello world like application that would have only the interrupt on
timer0 or something like that.
Thanks in advance,
Jani

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
AW: arm926ejs simple interrupts - "ICLI, Bekir (EXT)" - Mar 7 1:16:48 2008
Hi Jani,
There are lots of examples in the atmel's corresponding web-site:
http://www.atmel.com/dyn/products/tools_card.asp?family_id=605&family_name=AT91SAM+32%2Dbit+ARM%2Dbased+Microcontrollers&tool_id=3933
You can download the complete cd.
For the sake of simplicity, I have uploaded to rapidshare an example that covers
interrupts with timers
http://rapidshare.com/files/97662092/AT91SAM9260-Interrupt.zip.html
Good luck..
Mit freundlichem Gruß / Best regards
Bekir ICLI
________________________________
Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im Auftrag von kumori0
Gesendet: Donnerstag, 6. März 2008 21:36
An: A...@yahoogroups.com
Betreff: [AT91SAM] arm926ejs simple interrupts
Hello everyone,
I'm a student, trying to move up from programming PIC micros to
working with ARM microcontrollers.
At the moment I have a lot of problems with the whole concept of
interrupts in ARM. Could someone tell me where I could find a simple
hello world like application that would have only the interrupt on
timer0 or something like that.
Thanks in advance,
Jani

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: arm926ejs simple interrupts - Stephen Manion - Mar 7 13:04:57 2008
Google "building bare metal arm systems with GNU" to find a 10 part tutorial
that I found useful.
Steve
On Thu, Mar 6, 2008 at 10:14 PM, ICLI, Bekir (EXT) <
b...@siemens.com> wrote:
> Hi Jani,
>
> There are lots of examples in the atmel's corresponding web-site:
>
>
http://www.atmel.com/dyn/products/tools_card.asp?family_id=605&family_name=AT91SAM+32%2Dbit+ARM%2Dbased+Microcontrollers&tool_id=3933
> You can download the complete cd.
>
> For the sake of simplicity, I have uploaded to rapidshare an example that
> covers interrupts with timers
> http://rapidshare.com/files/97662092/AT91SAM9260-Interrupt.zip.html
>
> Good luck..
>
> Mit freundlichem Gruß / Best regards
>
> Bekir ICLI
>
> ------------------------------
> *Von:* A...@yahoogroups.com [mailto:A...@yahoogroups.com] *Im
> Auftrag von *kumori0
> *Gesendet:* Donnerstag, 6. März 2008 21:36
> *An:* A...@yahoogroups.com
> *Betreff:* [AT91SAM] arm926ejs simple interrupts
>
> Hello everyone,
>
> I'm a student, trying to move up from programming PIC micros to
> working with ARM microcontrollers.
>
> At the moment I have a lot of problems with the whole concept of
> interrupts in ARM. Could someone tell me where I could find a simple
> hello world like application that would have only the interrupt on
> timer0 or something like that.
>
> Thanks in advance,
> Jani
>
>
>
--
******************************
Steve Manion
S...@Metrozet.com
(626) 507-8025
(626) 437-6905
WWW.METROZET.COM
******************************

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: arm926ejs simple interrupts - willoughby_jon - Mar 10 21:59:16 2008
And if you want to dig a little deeper...
http://www.micrium.com/support/application_notes.html#AN1
--- In A...@yahoogroups.com, "ICLI, Bekir (EXT)"=20
wrote:
>
> Hi Jani,
>=20=20
> There are lots of examples in the atmel's corresponding web-site:
> http://www.atmel.com/dyn/products/tools_card.asp?
family_id=3D605&family_name=3DAT91SAM+32%2Dbit+ARM%
2Dbased+Microcontrollers&tool_id=3D3933
> You can download the complete cd.
>=20=20
> For the sake of simplicity, I have uploaded to rapidshare an=20
example that covers interrupts with timers
> http://rapidshare.com/files/97662092/AT91SAM9260-Interrupt.zip.html=20
=20
>=20=20
> Good luck..
>=20=20
> Mit freundlichem Gru=DF / Best regards
>=20
> Bekir ICLI=20
>=20
>=20=20
>=20
> ________________________________
>=20
> Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im=20
Auftrag von kumori0
> Gesendet: Donnerstag, 6. M=E4rz 2008 21:36
> An: A...@yahoogroups.com
> Betreff: [AT91SAM] arm926ejs simple interrupts
>=20
>=20
>=20
> Hello everyone,=20
>=20
> I'm a student, trying to move up from programming PIC micros to
> working with ARM microcontrollers.=20
>=20
> At the moment I have a lot of problems with the whole concept of
> interrupts in ARM. Could someone tell me where I could find a simple
> hello world like application that would have only the interrupt on
> timer0 or something like that.=20
>=20
> Thanks in advance,=20
> Jani
>
=20
=20

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: arm926ejs simple interrupts - kumori0 - Mar 12 3:26:49 2008
Thanks everyone,
I will try and digest all those links and examples today. Would do it
sooner but was at CEBIT...=20
Jani
--- In A...@yahoogroups.com, "willoughby_jon"
wrote:
>
> And if you want to dig a little deeper...
> http://www.micrium.com/support/application_notes.html#AN1
>=20
> --- In A...@yahoogroups.com, "ICLI, Bekir (EXT)"=20
> wrote:
> >
> > Hi Jani,
> >=20=20
> > There are lots of examples in the atmel's corresponding web-site:
> > http://www.atmel.com/dyn/products/tools_card.asp?
> family_id=3D605&family_name=3DAT91SAM+32%2Dbit+ARM%
> 2Dbased+Microcontrollers&tool_id=3D3933
> > You can download the complete cd.
> >=20=20
> > For the sake of simplicity, I have uploaded to rapidshare an=20
> example that covers interrupts with timers
> > http://rapidshare.com/files/97662092/AT91SAM9260-Interrupt.zip.html=20
> =20
> >=20=20
> > Good luck..
> >=20=20
> > Mit freundlichem Gru=DF / Best regards
> >=20
> > Bekir ICLI=20
> >=20
> >=20=20
> >=20
> > ________________________________
> >=20
> > Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im=20
> Auftrag von kumori0
> > Gesendet: Donnerstag, 6. M=E4rz 2008 21:36
> > An: A...@yahoogroups.com
> > Betreff: [AT91SAM] arm926ejs simple interrupts
> >=20
> >=20
> >=20
> > Hello everyone,=20
> >=20
> > I'm a student, trying to move up from programming PIC micros to
> > working with ARM microcontrollers.=20
> >=20
> > At the moment I have a lot of problems with the whole concept of
> > interrupts in ARM. Could someone tell me where I could find a simple
> > hello world like application that would have only the interrupt on
> > timer0 or something like that.=20
> >=20
> > Thanks in advance,=20
> > Jani
>
=20
=20

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: arm926ejs simple interrupts - Johan Ingvast - Apr 4 10:08:06 2008
For the IAR compiler there is an intrisic function
__enable_interrupt();
For all interrupts. You can also set fiq and irq separately with
something like
__enable_irq()
__enable_fiq()
There are of course corresponding __disable commands
Hope this helps.
/johan
kumori0 skrev:
> Thanks, this should be the problem. I now have one very newbie
> question. How do I change the CPSR value in code? I can't find the
> memory location for it in AT91SAM9260 definitions where the memory
> addresses are. Do I have to use some assembly command?
>
> Jani
>
> --- In A...@yahoogroups.com
,
> "ICLI, Bekir (EXT)"
> wrote:
> >
> > Hi Jani,
> >
> > Looking at your CPSR, you are masking I and F (bits 6-7) bits. That
> means, both fiq and irq interrupts are masked..
> >
> >
> > Mit freundlichem Gruß / Best regards
> > Bekir ICLI
> >
> >
> >
> >
> > ________________________________
> >
> > Von: A...@yahoogroups.com
> [mailto:A...@yahoogroups.com ] Im
> Auftrag von kumori0
> > Gesendet: Freitag, 4. April 2008 10:31
> > An: A...@yahoogroups.com
> > Betreff: [AT91SAM] Re: arm926ejs simple interrupts
> >
> >
> >
> > Hello everyone,
> >
> > I'm still trying to get the interrupts working. I have implemented the
> > code from the examples that I got but so far they're still not working.
> >
> > When I check the registers with jtag I can see that there is an
> > interrupt pending (return (pAic->AIC_IPR & (0x1 << irq_id));) but for
> > some reason the active interrupt (return (pAic->AIC_ISR & (0x1 <<
> > irq_id));) is always 0.
> >
> > When I look at the interrupt mask, to see which interrupts are enabled
> > I can see that the PIT interrupt and the software interrupt are
> > enabled (SYS value of AIC_IMR=1).
> >
> > I also tried to trigge the interrupts manually by writing 1 in
> > AIC_ISCR but nothing happens.
> >
> > You can see my source code here:
> > aic.c - http://pastebin.com/m61920f16
> >
> > aic.h - http://pastebin.com/m2653e9ef
> >
> > main.c - http://pastebin.com/m51a7958b
>
> >
> > main.h - http://pastebin.com/m63a31dd0
>
> >
> > pit.c - http://pastebin.com/m13cd9e02
> >
> > pit.h - http://pastebin.com/m54f75450
> >
> > CS1275.c(hw init) - http://pastebin.com/m2fe34e30
>
> >
> >
> > The value of my CPSR is: 00100000 00000000 00000000 11010011
> >
> > I'm runing my code through debugger, does that disable interrupts?
> >
> > Let me know if more info about configuration and/or source code is
> > needed.
> >
> > Thanks in advance,
> > Jani
> >
--
Johan Ingvast, PhD, CEO BioServo Technologies AB
Mob. +46 70 34 34 498 http://www.bioservo.com
Pub. pgp sign.: http://www.md.kth.se/~ingvast/Ingvast_public_key.asc
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: arm926ejs simple interrupts - kumori0 - Apr 5 23:26:02 2008
Hello everyone,
I'm still trying to get the interrupts working. I have implemented the
code from the examples that I got but so far they're still not working.
When I check the registers with jtag I can see that there is an
interrupt pending (return (pAic->AIC_IPR & (0x1 << irq_id));) but for
some reason the active interrupt (return (pAic->AIC_ISR & (0x1 <<
irq_id));) is always 0.
When I look at the interrupt mask, to see which interrupts are enabled
I can see that the PIT interrupt and the software interrupt are
enabled (SYS value of AIC_IMR=1).
I also tried to trigge the interrupts manually by writing 1 in
AIC_ISCR but nothing happens.
You can see my source code here:
aic.c - http://pastebin.com/m61920f16
aic.h - http://pastebin.com/m2653e9ef
main.c - http://pastebin.com/m51a7958b
main.h - http://pastebin.com/m63a31dd0
pit.c - http://pastebin.com/m13cd9e02
pit.h - http://pastebin.com/m54f75450
CS1275.c(hw init) - http://pastebin.com/m2fe34e30
The value of my CPSR is: 00100000 00000000 00000000 11010011
I'm runing my code through debugger, does that disable interrupts?
Let me know if more info about configuration and/or source code is
needed.
Thanks in advance,
Jani
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: arm926ejs simple interrupts - kumori0 - Apr 8 6:08:00 2008
Thank you,
That helped a lot. I looked but I didn't look hard enough it seems.
I'm still trying to understand everything in C, I planed to learn more
about assembly after I can get the thing workng in c, because it
should be easier that way.
Does anyone know what
void ARM_reset(void);
void ARM_undef(void);
void ARM_swi(void);
void ARM_pAbort(void);
void ARM_dAbort(void);
void ARM_reserved(void);
void ARM_irq(void);
void ARM_fiq(void);
are for?
Jani
--- In A...@yahoogroups.com, 42Bastian
wrote:
>
> kumori0 schrieb:
> > I'm afraid I don't have IAR compiler, I'm using gcc, after Lynch's
> > tutorial. I have located the macros that should enable and disable the
> > interrupts in my hello world example, but I can't figure out what
> > exactly do they do.
>
> Did you look at the ARM assembly syntax ?
>
> The macros just copy the CPSR into key lock interrupts (and change to
> SYS-mode) or key into CPSR.
>
> --
> 42Bastian
>
> Note: SPAM-only account, direct mail to bs42@
>
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )AW: Re: arm926ejs simple interrupts - "ICLI, Bekir (EXT)" - Apr 8 7:42:01 2008
Hi Jani,
They are the exception vector handlers, as it seems.
When there is, for example, a prefetch abort exception, the pc is loaded with the address
0xC.
And you probably have a branch to your ARM_pAbort() function at that address..
Mit freundlichem Gruß / Best regards
Bekir ICLI
________________________________
Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im Auftrag von kumori0
Gesendet: Dienstag, 8. April 2008 11:34
An: A...@yahoogroups.com
Betreff: [AT91SAM] Re: arm926ejs simple interrupts
Thank you,
That helped a lot. I looked but I didn't look hard enough it seems.
I'm still trying to understand everything in C, I planed to learn more
about assembly after I can get the thing workng in c, because it
should be easier that way.
Does anyone know what
void ARM_reset(void);
void ARM_undef(void);
void ARM_swi(void);
void ARM_pAbort(void);
void ARM_dAbort(void);
void ARM_reserved(void);
void ARM_irq(void);
void ARM_fiq(void);
are for?
Jani
--- In A...@yahoogroups.com
, 42Bastian
wrote:
>
> kumori0 schrieb:
> > I'm afraid I don't have IAR compiler, I'm using gcc, after Lynch's
> > tutorial. I have located the macros that should enable and disable the
> > interrupts in my hello world example, but I can't figure out what
> > exactly do they do.
>
> Did you look at the ARM assembly syntax ?
>
> The macros just copy the CPSR into key lock interrupts (and change to
> SYS-mode) or key into CPSR.
>
> --
> 42Bastian
>
> Note: SPAM-only account, direct mail to bs42@
>

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )Re: Re: arm926ejs simple interrupts - 42Bastian - Apr 8 11:45:13 2008
kumori0 schrieb:
> I'm afraid I don't have IAR compiler, I'm using gcc, after Lynch's
> tutorial. I have located the macros that should enable and disable the
> interrupts in my hello world example, but I can't figure out what
> exactly do they do.
Did you look at the ARM assembly syntax ?
The macros just copy the CPSR into key lock interrupts (and change to
SYS-mode) or key into CPSR.
--
42Bastian
Note: SPAM-only account, direct mail to bs42@...
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
Re: arm926ejs simple interrupts - kumori0 - Apr 9 1:51:30 2008
I'm afraid I don't have IAR compiler, I'm using gcc, after Lynch's
tutorial. I have located the macros that should enable and disable the
interrupts in my hello world example, but I can't figure out what
exactly do they do.=20
Could someone help me with this?
I have the following code: http://pastebin.com/m663dc4d
And I can't figure out how exactly to use them. Macro demands some
sort of key as an input argument. What is that key? I tried to enter 1
for it and it seems to unlock the interrupts in status register but I
would feel a lot better if I knew what exactly is it that I should input.=20
I'm saying that is seems to unlock the interrupts because now when I'm
debugging with jtag the my program gets lost somewhere. When I halt it
I get a message source not found which I think is probably caused by
staying in the interrupt forever. Problem is, I have breakpoints set
in all my interrupt handling routines so I think it should stop when
it reaches them.=20
One other thing, at the bottom of the file for enabling and disabling
interrupts I have this:
void ARM_reset(void);
void ARM_undef(void);
void ARM_swi(void);
void ARM_pAbort(void);
void ARM_dAbort(void);
void ARM_reserved(void);
void ARM_irq(void);
void ARM_fiq(void);
What is that for? I thought that all you have to do is declare the
interrupt handler like this:
static void PIT_IRQ_isr(void) __attribute__ ((interrupt("IRQ")));
Then create the routine itself like this:
void PIT_IRQ_isr ( void ) {
//Acknowledge interrupt by reading Periodic Interval Value
Register(PIT_PIVR);
unsigned int dummy =3D pitGetPIVR();
numINT++;
uart0_putc('Z');
(void)dummy; //suppress warning "dummy" was set but never used=20
}
Thanks in advance,=20
Jani
--- In A...@yahoogroups.com, Johan Ingvast
wrote:
>
> For the IAR compiler there is an intrisic function
> __enable_interrupt();
> For all interrupts. You can also set fiq and irq separately with=20
> something like
> __enable_irq()
> __enable_fiq()
> There are of course corresponding __disable commands
> Hope this helps.
> /johan
>=20
> kumori0 skrev:
> >=20
> >=20
> > Thanks, this should be the problem. I now have one very newbie
> > question. How do I change the CPSR value in code? I can't find the
> > memory location for it in AT91SAM9260 definitions where the memory
> > addresses are. Do I have to use some assembly command?
> >=20
> > Jani
> >=20
> > --- In A...@yahoogroups.com ,=20
> > "ICLI, Bekir (EXT)"
> > wrote:
> > >
> > > Hi Jani,
> > >
> > > Looking at your CPSR, you are masking I and F (bits 6-7) bits. That
> > means, both fiq and irq interrupts are masked..
> > >
> > >
> > > Mit freundlichem Gru=DF / Best regards
> > > Bekir ICLI
> > >
> > >
> > >
> > >
> > > ________________________________
> > >
> > > Von: A...@yahoogroups.com =20
> > [mailto:A...@yahoogroups.com ] Im
> > Auftrag von kumori0
> > > Gesendet: Freitag, 4. April 2008 10:31
> > > An: A...@yahoogroups.com
> > > Betreff: [AT91SAM] Re: arm926ejs simple interrupts
> > >
> > >
> > >
> > > Hello everyone,
> > >
> > > I'm still trying to get the interrupts working. I have
implemented the
> > > code from the examples that I got but so far they're still not
working.
> > >
> > > When I check the registers with jtag I can see that there is an
> > > interrupt pending (return (pAic->AIC_IPR & (0x1 << irq_id));)
but for
> > > some reason the active interrupt (return (pAic->AIC_ISR & (0x1 <<
> > > irq_id));) is always 0.
> > >
> > > When I look at the interrupt mask, to see which interrupts are
enabled
> > > I can see that the PIT interrupt and the software interrupt are
> > > enabled (SYS value of AIC_IMR=3D1).
> > >
> > > I also tried to trigge the interrupts manually by writing 1 in
> > > AIC_ISCR but nothing happens.
> > >
> > > You can see my source code here:
> > > aic.c - http://pastebin.com/m61920f16
=20
> > >
> > > aic.h - http://pastebin.com/m2653e9ef
=20
> > >
> > > main.c - http://pastebin.com/m51a7958b=20
> >
> > >
> > > main.h - http://pastebin.com/m63a31dd0=20
> >
> > >
> > > pit.c - http://pastebin.com/m13cd9e02
=20
> > >
> > > pit.h - http://pastebin.com/m54f75450
=20
> > >
> > > CS1275.c(hw init) - http://pastebin.com/m2fe34e30=20
> >
> > >
> > >
> > > The value of my CPSR is: 00100000 00000000 00000000 11010011
> > >
> > > I'm runing my code through debugger, does that disable interrupts?
> > >
> > > Let me know if more info about configuration and/or source code is
> > > needed.
> > >
> > > Thanks in advance,
> > > Jani
> > >
> >=20
> >=20
>=20
> --=20
> Johan Ingvast, PhD, CEO BioServo Technologies AB
> Mob. +46 70 34 34 498 http://www.bioservo.com
> Pub. pgp sign.: http://www.md.kth.se/~ingvast/Ingvast_public_key.asc
>
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )