Interrupt is not generating in ADXL345 using 4.9 kernel

46 views
Skip to first unread message

Prakash Dash

unread,
Nov 18, 2018, 1:06:43 PM11/18/18
to BeagleBoard
I am using 4.9 kernel which is having ADXL34x driver configured as module.
After cross compile i am able to detect the device in kernel but ADXL345 interrupt is not generating.

I made this below changes in device tree. I mapped interrupt 5 of the interrupt controller to adxl345 device.
i could not able to see any interrupt generating while i am rotating the device.

Actually i porting this device externally with the beaglebone black board.

pin configuration of ADXL345 device with the beaglebone black board.

Header                   Pin             ADXL345 Pin
=======                ===           ===========
P-9                          17             SCL
P-9                          18             SDA
P-9                          01             GND
P-9                          03              VCC

But i did not map INT1 and INT2 pin of ADXL345 device to any of the pin header of Beaglebone black. but i mapped the interrupt number  <5> of Interrupt controller to
ADXL345 in devicetree configuration.

&i2c1 {

          adxl345@0 {
                        
                                compatible = "ti,adxl34x";
                                reg = <0x53>
                                interrupt-parent = <&intc>
                                interrupts = <5>
           };
};

can someone please tell me whether i am following the right procedure or not.
if the procedure is correct then ca someone please tell me why interrupt is not generating.

if the procedure is not correct then can someone please help me on this to how to generate interrupt in ADXL345 device.


Robert Nelson

unread,
Nov 18, 2018, 1:19:09 PM11/18/18
to Beagle Board, danpur...@gmail.com
On Sun, Nov 18, 2018 at 12:06 PM Prakash Dash <danpur...@gmail.com> wrote:
>
> I am using 4.9 kernel which is having ADXL34x driver configured as module.
> After cross compile i am able to detect the device in kernel but ADXL345 interrupt is not generating.
>
> I made this below changes in device tree. I mapped interrupt 5 of the interrupt controller to adxl345 device.
> i could not able to see any interrupt generating while i am rotating the device.
>
> Actually i porting this device externally with the beaglebone black board.
>
> pin configuration of ADXL345 device with the beaglebone black board.
>
> Header Pin ADXL345 Pin
> ======= === ===========
> P-9 17 SCL
> P-9 18 SDA
> P-9 01 GND
> P-9 03 VCC
>
> But i did not map INT1 and INT2 pin of ADXL345 device to any of the pin header of Beaglebone black. but i mapped the interrupt number <5> of Interrupt controller to

Well, try again with INT1 or INT2 routed to a pin..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Prakash Dash

unread,
Nov 18, 2018, 9:11:57 PM11/18/18
to robert...@gmail.com, beagl...@googlegroups.com
Hi Robert,

Will it be fine if i routed INT1 or INT2 to one of the GPIO pin of the P-9 or P-8 header.

If i will do this before that i have to mux that GPIO pin for input mode.
and same pin info i have to configure in device tree under adxl345 node as mentioned below.
as

 interrupt-parent = <&gpio>
 interrupts = <gpio pin no>

could you please suggest whether this is the correct procedure or not what I asked above.
could you please suggest the procedure for mapping the INT1 or INT2 pin to any of the
pin header(P-9 or P-8) of the beaglebone black board.

Please kindly help me on this.
Without this configuration i can not able to collect the X,Y,Z axis data.

Thanks
Prakash

Robert Nelson

unread,
Nov 18, 2018, 10:08:08 PM11/18/18
to danpur...@gmail.com, Beagle Board
On Sun, Nov 18, 2018 at 8:11 PM Prakash Dash <danpur...@gmail.com> wrote:
>
> Hi Robert,
>
> Will it be fine if i routed INT1 or INT2 to one of the GPIO pin of the P-9 or P-8 header.
>
> If i will do this before that i have to mux that GPIO pin for input mode.
> and same pin info i have to configure in device tree under adxl345 node as mentioned below.
> as
>
> interrupt-parent = <&gpio>
> interrupts = <gpio pin no>
>
> could you please suggest whether this is the correct procedure or not what I asked above.
> could you please suggest the procedure for mapping the INT1 or INT2 pin to any of the
> pin header(P-9 or P-8) of the beaglebone black board.

You can map it to any un-used pin, as long as you specifiy it..

>
> Please kindly help me on this.
> Without this configuration i can not able to collect the X,Y,Z axis data.

That's incorrect, you can always "poll" the data.. It's not IRQ
driven, so it's not as efficient..

Robert Nelson

unread,
Nov 19, 2018, 10:55:25 AM11/19/18
to Beagle Board, danpur...@gmail.com
On Mon, Nov 19, 2018 at 12:14 AM Prakash Dash <danpur...@gmail.com> wrote:
>
> Hi Robert,
>
> i ran the evtest tool but i am not getting any data from X,Y,Z axis even after rotating the device.
>
> I followed the same wiki link for the ADXL345 device porting into Beaglebone Black.
> https://wiki.analog.com/resources/tools-software/linux-drivers/input-misc/adxl345
>
> For me device detection is happening but not able to get the data.
> I am registering ISR in ADXL345 probe function.Probe function is called and ISR registration also success
> but no Interrupt related to TAP detection and Freefall detection and others.
>
> i think evtest tool itself following the iNotify framework and Pollfd to monitor and collect the data from device.
>
> Could you please suggest how to collect the X,Y,Z co-ordinate data from device.

I don't have an adxl345, you got to ping the list: beagl...@googlegroups.com

Prakash Dash

unread,
Nov 24, 2018, 12:59:09 AM11/24/18
to BeagleBoard
  For me device pin mapping is done using breddboard to P-9  header of the Beaglebone Black.
  I am able to detect the device but while rotating the device i am not getting the X,Y,Z co-ordinate.
  Even register update also not happening.

 I am trying to read the DATA_READY bit of INT_SOURCE register inside the ISR routine to collect the data of X,Y,Z axis but ISR routine is not calling.


For ISR should run is it required to map INT1 or INT2 pin of ADXL345 from  breadboard to any of the pin of the P-9 header so that CPU will get notified and call the device ISR for run.

Can someone please help me on this.

Prakash Dash

unread,
Nov 24, 2018, 8:41:36 AM11/24/18
to beagl...@googlegroups.com
Hi Robert,

I did mapping the INT1 pin one of the GPIO pin of the BBB now it is working fine.ISR is called and i am able to collect the
X,Y,Z axis data from device.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/k__0uW8DUTM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/4e7e77e0-e688-459e-b5de-abb65fad6e1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages