logo

Question

difficulty creating interrupt on igepv2 gpio

posted in IGEPv2
Friday, January 27 2017, 12:47 AM
peter
peter
Offline
0
I am trying to create an interrupt for AR1021 touch panel controller using a gpio on JA990. To test, using an "out of the box" igepv2 no wifi, I am wiring a button on a breadboard with one side of the button wired to 1.8v (JA990 Pin1) and the other side through a 1k resistor to pin12 (GPIO156) which also has a 10k pulldown resistor to GND. I always get /sys/class/gpio/gpio156/value=0 whether the button is pushed or not.

cd /sys/class/gpio/
echo 156 > export
cd gpio156
echo in > direction
cat value ==> expect 1 when button pressed but always get 0

Suggestions?

Accepted Answer

Monday, February 06 2017, 03:55 PM - #permalink
0
Hi Peter,

Your hardware setup is OK, but you will need to configure properly software side.

GPIOs like 156 and 158 are muxed as output signals. Before read values you will need to configure them as input/output. Type the following commands:
//Enable Kernel debug filesystem:
mount -t debugfs none /sys/kernel/debug
//Configure GPIO156:
echo 0x104 > /sys/kernel/debug/omap_mux/mcbsp1_clkr
//Configure GPIO158:
echo 0x104 > /sys/kernel/debug/omap_mux/mcbsp1_dx

If you program these GPIOs at kernel board file, commands above are not necessary.

More info at: http://labs.isee.biz/index.php/Mux_configuration

Cheers!
The reply is currently minimized Show
Responses (3)
  • Accepted Answer

    peter
    peter
    Offline
    Wednesday, February 01 2017, 01:24 AM - #permalink
    0
    I tried removing the 1k resistor and then all resistors and hooking gpio directly to 1.8v. There was still no change cat value = 0 still.
    I also tried on gpio158 pin12 but again no change...

    I'm not sure what else to try.
    The reply is currently minimized Show
  • Accepted Answer

    peter
    peter
    Offline
    Tuesday, February 07 2017, 05:39 AM - #permalink
    0
    Thanks Pau. It works!

    I assume adding
    OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),
    OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE4 | OMAP_PIN_INPUT),

    to
    static struct omap_board_mux board_mux[] __initdata ={
    in
    (kernel sources)/arch/arm/mach-omap2/board-igep0020.c
    will also work.

    I did not see GPIO's MODE4 being set up in board-igep0020.c, or board-igep00x0.c or board-igep00x0.h. Is there another file where GPIO's are set up that I would be better to use?

    Peter
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 07 2017, 11:44 AM - #permalink
    0
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat