Author Topic: KXTJ3-1057 accelerometer issue.  (Read 235 times)

0 Members and 1 Guest are viewing this topic.

Offline VK3DRBTopic starter

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: au
KXTJ3-1057 accelerometer issue.
« on: March 11, 2024, 12:23:45 am »
Hi.

I am using a KXTJ3-1057 accelerometer with an MSP430G2533.

Using I2C, I can read the device ID (WhoAmI) and it appears I can write to the device. The I2C waveform looks fine on the oscilloscope with its I2C decode function.

    InitI2C(MEMS_ADDR);

    memsData[0] = 0x22; // Set CTRL_REG1: Standby mode, low current, acceleration data as interrupt, Range +/-2g, Wake-up function enabled
    I2C_Master_WriteReg(MEMS_ADDR, 0x1B, memsData, 1);

    memsData[0] = 0x18; // Set INT_CTRL_REG1: Physical interrupt pin enabled, polarity active high, interrupt pin latch until cleared by reading INT_REL, no self test polarity
    I2C_Master_WriteReg(MEMS_ADDR, 0x1E, memsData, 1);


    while(1);


The attached code should set the accelerometer's interrupt to trigger, but it does not when I move or shake the device. The interrupt output is always low. I don't know why and I have spent hours trying to find out why. The schematics are attached. On the MSP430, port 2.6 is set for interrupt triggering on a falling edge, set as an input with an internal pullup resistor.

This is a long shot, but anyone who has had to use a KXT accelerometer, might know what is wrong. I will owe you a beer if you can help solve this.

It is unfortunate I had to use this part. It was due to the global chip shortage - it was the only one we could get. In retrospect I would have used an ST or even a TI accelerometer, but it is too late now.
 

Offline VK3DRBTopic starter

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: au
Re: KXTJ3-1057 accelerometer issue.
« Reply #1 on: March 17, 2024, 06:44:42 am »
Found the fault.

The Salaea Logic Pro 8 has a bug. I set SCL is channel 4, and SDA to channel 7. The data it sniffed and reported was corrupted, leading me astray. Proved this by checking with data decode feature on the oscilloscope. Changed to channel 1 for SDA and channel 2 for SCL and the problem was gone!

To make matters worse, there were a couple of effing spurious 8ns pulses at the falling edge of the clock. I thought this was ringing, but I could not see it on the oscilloscope. Nope, it was the Salaea Logic Pro 8 issue. When I moved to ch1/ch2, these spurious pulses disappeared!

By the way, driving the KXT chip is a little complicated, but I have sorted all those registers out now the logic probe is "working".

Feeling a lot better, thank you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf