Tap sensing with BMA180 accelerometer

Discussion in 'Embedded Systems and Microcontrollers' started by kender, Jun 29, 2012.

  1. kender

    Thread Starter Senior Member

    Jan 17, 2007

    Could anyone post a code snippet, which would show how to initialize BMA180 accelerometer for tap sensing? Doesn't matter whether it's SPI or I2C.

    So far, I was able to communicate with my BMA180 via SPI. I can read chip ID, accelerations. I can set up a new data interrupt.

    When I try to set up the tap sensing interrupt, but the INT pin goes high without tapping and stays high. I've added code, which resets the interrupt every second, but the pin immediately goes back high. I guess, somehow the BMA180 thinks that it's tapped all the time.

    Here are my present settings:
    • interrupt is latching
      range: 2g (default)
      tap duration: 500ms
      tap threshold: 254

    Any suggestion, insight or reference is really appreciated!

    - Nick