PIO Input Change interrupt

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

igal.sokolov@gmail.com
Posts: 1
Joined: Thu May 18, 2017 8:37 pm

PIO Input Change interrupt

Thu May 18, 2017 9:32 pm

Hello,

Using CPU SAM9G20 I am trying to get an interrupt on PIO Input Change.
I am using PA26 pin and PIOA controller. Currently having some issues to init the controller.

My code is:

volatile unsigned int reg ;
volatile unsigned int reg1 ;

pioa_clk = clk_get(NULL, "pioA_clk");
clk_enable(pioa_clk);

at91_set_gpio_input(AT91_PIN_PA26, 1);
at91_sys_write(AT91_PIOA + PIO_IER, 1<<26);

reg = at91_sys_read(AT91_PIOA + PIO_IMR);
printk(KERN_ERR "at91_sys_read: %x\n", reg);

reg1 = at91_sys_read(AT91_PIOA + PIO_IMR);
printk(KERN_ERR "one more time at91_sys_read: %x\n", reg1);

Here is the output:
at91_sys_read: 4000000
one more time at91_sys_read: 0

It shows that the mask has gone after the second read of PIO_IMR register. What could happen ?

Thank you,
Igal
blue_z
Location: USA
Posts: 1496
Joined: Thu Apr 19, 2007 10:15 pm

Re: PIO Input Change interrupt

Thu Jun 01, 2017 12:17 am

What does your "code" represent?
It could be old 2.6.xx kernel code, but why is there clock initialization?

Try dumping the entire register block for PIOA before and after.

Regards

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests