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  [ 3 posts ] 
Author Message
 Post subject: Inputpins with Interrupt on AT91SAM9G20
PostPosted: Tue Nov 15, 2011 10:14 am 
Offline

Joined: Tue Nov 15, 2011 9:57 am
Posts: 2
Hello everybody,
I hope I'm right here because I have a very trivial question (which I'm not able to solve at my own).
I'm new to this topic so I hope I get some help here.

I have a singleboardcomputer based on the AT91SAM9G20. Some of its pins are going outside and I want to use them. Some of them as digital outputs and some as inputs.
The pins for digital output are working, but I have a problem with the inputpins.

I'd like to get an interrupt when (i.e. Pin PB17) is HIGH and in the interruptroutine a simple prompt "PB17 is HIGH".

I've read in the datasheet that I need to enable Interrupts in the AIC_IECR, mask them in AIC_IMR and then have to write an interruptroutine.

But I couldn't find out how to refer to the Pins I want to observe.
I want to use the Pins of PIO-Controller B #17, #16, #07, #06, #19, #29 and #18

Is there a tutorial or something?! (I'd like to understand what I'm doing).


Oh, and I program in C. I dont have any idea of Assembler ;-)

Help would be greatly appreciated.

Thanks in advance


Top
 Profile  
 
 Post subject: Re: Inputpins with Interrupt on AT91SAM9G20
PostPosted: Tue Nov 15, 2011 6:33 pm 
Offline

Joined: Thu Dec 02, 2004 2:28 pm
Posts: 454
hello,
download the software package from the atmel homepage (http://www.atmel.com/dyn/resources/prod ... ck-1.9.zip) and take a look at the the "getting-started-project". there you can find the information you need to install an interrupt handler for an input port.

regards
gerhard


Top
 Profile  
 
 Post subject: Re: Inputpins with Interrupt on AT91SAM9G20
PostPosted: Mon Nov 28, 2011 8:39 am 
Offline

Joined: Tue Nov 15, 2011 9:57 am
Posts: 2
hi gerhard,
thank you for your advice about the getting started project.
I read through the code to learn sth. about, then I tried to create my own sourcefile with the parts I need for my application. But when I try to crosscompile with "arm-angstrom-linux-gnueabi-gcc" I got serveral errors:

at91lib/boards/at91sam9g20-ek/board.h:71:6:Error: #error Board does not support the specified chip.
at91lib/peripherals/pio/pio.h:164: Error: expected specifier-qualifier-list before »AT91S_PIO«
InterruptPin.c:16: Error: »AT91C_ID_PIOB« is not declared here
...

So my question is, is it, because I don't use a EK-Board, is there a problem with including the library, or am I just too dumb?
I'm feeling like a Neanderthal sitting in front of a comuter :-/
I don't have any idea about makefiles, so I tried to compile with -o and -I flags in the terminal.

Isn't there a way without using the at91lib (p.e. via the at91samg20.h File)?
I mean, only with writing some registers or smth. like that?
Couldn't be that hard, is it?

I programmed my Outputpins in that way, but I don't know how to do it with Interrupts and Inputpins.

Help would be greatly appreciated.

Thanks in Advance

Edit:
Now I found out, that I need GPIO because on my singleboardcomputer is a linux OS running, and I couldn't handle Interrupts on lowlevel without using the kernel.
Is that right, and could you help me with that too?


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

All times are UTC + 1 hour [ DST ]


Who is online

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