Hannah: accelerometer interrupts

Hi all, quick question: I’ve been playing with the accelerometer on the Hannah board, and it’s happily returning acceleration values. However, I’m trying to use the accelerometer’s “notify on threshold” functionality to signal when acceleration over a certain limit is detected. The FF_WU_SRC_1 register returns seemingly appropriate values, but I can’t persuade the IO Expander on the Hannah board to read anything except “1” on pin 3, which is apparently the accelerometer input line. I have tried various configurations of interrupt pin configurations on the accelerometer, but no joy. Does anybody have a working example?

Gist here: https://gist.github.com/3772907

I’d try enabling only one thing on the pin (ie just FF_WU_1 OR 2, not both), then check you can get the pin to go low - ie, no interrupts enabled, try reading the clear registers, etc.

That did the trick - turned out I was using an inappropriate sensing threshold (it was triggering constantly). Reading the interrupt source register on the accelerometer helped me track it down.

Do you have some accelerometer example that uses unterrupt?

Thanks.

I tried your example, why I always get 0 on pin3? What did I miss?

Thanks.