Troubleshooting the KX134-1211

This page describes issues and an approach for troubleshooting the KX134-1211.

Overview of the Problem

The KX134-1211 accelerometer is currently being configured in the code through SPI to trigger a hardware interrupt when there are samples ready in the buffer. There are two ways this is set up; one is when the buffer is full, and the other is when the buffer reaches the watermark of halfway (see register info in the Wiki for more information). Configurations for the register are set with help from the Kionix Technical Reference Manual.

I can also change the interrupt to trigger at pulsed intervals in order to troubleshoot at a slower rate. When I do this, I can see that there is a pulse going off at 1.88 MHz, despite the configurations being set for 20MHz. The voltage for this pulse is low, at about 700mV, however it should be close to 2.7V since the voltage should be 0.8*IO_VDD = 0.8*3.3V = ~2.7V.

I have had great success setting this accelerometer to asynchronous mode and reading data from the buffers. However I have not had success from any of the hardware interrupt configurations.

This leads me to believe that one of the following must be happening:

  1. The hardware interrupt is not being configured properly before it is being implemented.
  2. There is something weird about the way the GPIO pin is configured that makes it unable to catch the triggered hardware interrupt (note: when I disconnect the hardware interrupt output from the accelerometer and read it with the scope, I get slightly higher voltage, but not enough to compensate for the distance.)
  3. There is something wrong with this particular board.

Pictures of Physical Setup

Evidence

The following photo shows the value of the 3.3 V rail (in blue) and the hardware interrupt pin (in yellow) when the program is not running.

scope_photo_1.jpg

This photo shows the value of the 3.3 V rail (in blue) and the hardware interrupt pin (in yellow) when the program is supposedly running. There is a pulse in both signals that is measured to be about 2MHz, and the voltage of the interrupt is only at 600mV at it's highest.

scope_photo_2.jpg

Suggestions from Kionix

I emailed Kionix and received the following suggestions:

What you see on INT1 line, is not really a signal [from the hardware interrupt].

  1. Make sure the code is really running (are you sure you are getting valid outputs, that are changing in the output registers?)
  2. Follow AN101 Getting Started to properly setup the synchronous data reading
  3. Basic C driver can be found here: https://github.com/RohmSemiconductor/Arduino/tree/master/kx13x
  4. Minimize the number of connection if possible and keep the SPI clock at or under 1MHz. The lower the rate, the more reliable it is.
  5. Start with some basic operation, at default 50Hz Output Data Rate (ODR), and go from there.

Steps Taken

  1. Measured the VDD and IO_VDD lines (both on the same 3.3V rail), checked scope settings (pictures to follow), and switched breadboards that I have been using to debug.
  2. Changing GPIO mode to input instead of InputPull (no filtering)
  3. Changing from pull-up to pull-down
  4. Suggestions from the KX134 tech manual:
    1. Read the INT_REL register to clear (in latched mode, which is what we are using).
    2. Added to the interrupt handler
    3. Follow the following procedure in an interrupt: disable GPIO int, clear GPIO int and generate functionality, enable GPIO int. —-> Haven't tried this yes.
    4. Make sure the interrupt output is configured to be the same as the interrupt read function on the pin.
    5. Use a scope to double-check that the hardware pin is working.

Possible Leads

These sources have not been thoroughly pursued, but I found them while trying to investigate.

See Also

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License