Chat freely about anything...

User avatar
By gpBen
#54139 Hi Everyone, I need some help please!

I am using an ESP8266 Huzzah from Adafruit, and I want to deep sleep then be woken up with a double tap.

I am trying to use a LIS3DH for this, and have had some success.

I am able to connect with i2c, and configure the LIS3DH. I can read accelerometer data, and create an interrupt on double tap. Great.

Next, I connected the LIS3DH Interrupt pin to the RST pin of the ESP. A double tap resets the ESP. Great!

But the LIS3DH interrupt pin stays low until you read the interrupt register, and the real problem for me - when I read that register, the pin goes high, and the ESP then freezes/hangs.

It seems that the ESP sees the interrupt rising and freaks out about it.

Does anyone have an idea what I can do about this, either a software or hardware based fix?

Notes:
- I am running 0.9.6 firmware (a custom cloud build results in a blue flashing LED)
- The LIS3DH datasheet says you can set CTRL_REG5 to 0x00, and the interrupt should clear itself - but it doesn't!

Thanks a lot.
Ben
User avatar
By Barnabybear
#54158 Hi, can you post a schematic of the connections you are using please. I would be thinking:
10K pull up on RESET.
1K between GPIO 16 & RESET.
A diode between INT 1 (anode) and RESET (cathode).

But the LIS3DH interrupt pin stays low until you read the interrupt register, and the real problem for me - when I read that register, the pin goes high, and the ESP then freezes/hangs. - See more at: viewtopic.php?f=6&t=11564&p=54158#p54158

Hi, have you confirmed that the interupt is active low (an interupt causes INT 1 to go LOW). I understood it was active high (an interupt causes INT 1 to go HIGH).

[Sorry about the link at the end of the quote - the forum puts it on and I don't see why we should have to mess about deleting it when trying to help people - it realy screws things up when it's in code].
User avatar
By gpBen
#54162 Hi @Barnabybear, thanks for the reply.

The schematic is super simple, I'll just write it rather than draw a picture:

- i2c from LIS to ESP on pins 4 & 5
- LIS powered from ESP 3v pin, and ESP GND
- LIS Interrupt to ESP Reset pin (also tested on Enable pin)
- ESP powered by USB over FTDI (also tested on 3.3v battery)

I tested the interrupt with a multimeter. The LIS interrupt pin reads 3.3v normally, then when I double tap, it goes down to 0v until I read the Interrupt register.

Thanks again!