FXLS8471Q - SPI communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FXLS8471Q - SPI communication

2,376 Views
leonardocarvalh
Contributor II

Hello,

I'm having some trouble to configure the SPI communication in FXLS8471Q accelerometer.

I'll need to get the data to each second, so, to do that, i configure a interrupt timer to send a request to read WHO_I_AM register each 1 sec, but reading the MISO pin with oscilloscope i've got this stranger signal.  

Sinal acelerometro.jpg

But, changing the time that interrupt occurs for about 30us I get the correct signal, but i get the data more times than i need. 

Another problem is that the accelerometer's configuration is very unstable. Sometimes, the accelerometer is sending some data and, when I turn off the power and turn it again, it does not send any data.

I suspect that the selection of the accelerometer as SPI is giving an error. What does it mean MISO pin floating? He will receive different voltage values?

This is the  schematic:

Esquemático.png

The RST pin is welded to ground.

I'd like to know if someone has a code example of the accelerometer configuration as SPI using a microcontroller. I use a DSP TMS320F, then it don't has a library ready for accelerometer, like a breakout board has.

Well, the last question, what means to say that register is auto-incremented? This means that when I read the OUT_X_MSB register the device will send me OUT_X_MSB value, than OUT_X_LSB, OUT_Y_MSB and so on?

Thanks!!

Labels (1)
Tags (1)
0 Kudos
7 Replies

1,472 Views
anthonyduhamel
NXP Employee
NXP Employee

Hi Leonardo,

You must ensure the FXLS8471 is reset (RST to '1') while you're configuring the SPI pins (on the MCU side). To allow the the FXLS8471 SPI auto-detection, the MISO pin must be to High Impedance so Floatting (Mcu MISO pin as an input). Then you can wait for few milliseconds and release the RST pin to '0'. If you don't use the rest pin, you can't be sure the MISO pin is floatting at the FXLS8471 POR, so at the BOOT, the auto-detection may not work well.

I also suggest you to remove R13 and R14 from the SPI SCLK and MOSI lines. They are not required, because the MCU drives those pins.

Anthony

1,472 Views
leonardocarvalh
Contributor II

Hi Tomas and Anthony,

Thanks for your support,

Well, about VDDIO pin it would be easy to solve connecting some supply voltage in the positive pin of capacitor, but i can't see any solution to solve the wrong connection of reset pin.

I contacted who designed the PCB and and he said that datasheet doesn't make clear that we should not connect the rst pin on ground if we desire to use SPI.

So, to use this accelerometer i will need route another PCB.

Would have some reason for auto-detection work that way? Why who created the accelerometer doesn't do 0 in SA0 pin during power up

select I2C and 1 select SPI, for example? hahahhah

thanks for your attention,

Leonardo Gabrich

0 Kudos

1,472 Views
anthonyduhamel
NXP Employee
NXP Employee

Hi Leonardo,

You may not need to connect the RST pin to the MCU. It is just a potential issue you could be faced. First fix the VDDIO and try. Normally, all MCU inputs would be at "HZ" (input) at the MCU startup, so you would not have problem with that.

Anthony

1,472 Views
leonardocarvalh
Contributor II

Ok,

I already fixed vddio, but I have not had time to test. I will test this week and I tell you.

thks

0 Kudos

1,472 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello Leonardo,

I would recommend taking a closer look at my FRDMSTBC-A8471 - Bare metal example project which demonstrates how to get an acceleration data using an interrupt technique.

If you are still facing any problems, please post here your complete schematic (including an MCU), oscilloscope plots illustrating both write and read transactions and SPI routines.

Yes, auto-incrementing means that the register address is internally auto-incremented by FXLS8471Q so that every eighth next clock edges will latch the address for the next register. Just note that if the CTRL_REG1[f_read] bit is set, auto-increment will skip over the LSB registers.

Best regards,

Tomas

PS: If my answer helps to solve your question, please mark it as "Correct". Thank you.

1,472 Views
leonardocarvalh
Contributor II

Hey Tomas,

Before testing some changes that I made in my code, i wonder about the VDDIO connection.

This pin is connected like the schematic below:

I guess who planned the accelerometer schematic forgot to connect VDDIO pin on a power supply, as suggested in device datasheet.

Could this be the problem?

Thanks man

0 Kudos

1,472 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

Hi Leonardo,

Yes, the VDDIO pin must be connected to the interface supply voltage (1.62V - 3.6V). For single-supply operation, VDDIO can be the same as the main supply, VDD.

Best regards,

Tomas