cancel
Showing results for 
Search instead for 
Did you mean: 

asm330lhhxg1 "who_am_i" register is reading back 0x48. Should be 0x6.

arifkhan
Associate II

Connected STEVAL_$MKI243AA board to a nucleo-g491re board using 4 wire spi interface. The spi bus is setup to run @ 146 Kbits/sec. Reading back bad data. 

WHO_AM_I is 0x48

PIN_CTRL is 0x3E

 

Not sure but seem like the device is power

13 REPLIES 13
TDK
Super User

Why should it be 0x6?

Screenshot 2026-04-08 102959.png

 

If you feel a post has answered your question, please click "Accept as Solution".
Federica Bossi
ST Employee

Hi @arifkhan ,

The correct whoami, as reported also by @TDK , is 6Bh.

Probe with a logic analyzer and check:

  • MOSI address byte
  • MISO timing
  • whether the returned byte is shifted by 1 bit
  • whether CS stays stable

Did you try the reading also in I2C or SPI3?

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

hello Federica,

 

Yes, i have the scope connected to the 4 spi signals, I see 0x8F go out on the MOSI and I see 0x48 on the MISO wire every time.  I put a 10k pullup on the CS wire and also a 10K pulldown on the INT1 signal.

 

Yes I tried the I2C bus and I am able to read 0x6B data back from the WHOAMI register.

 

Rgds

hello Federica,

 

Is there some setup to this part at power up ?

 

I am completely at loss right now I would really appreciate some help from ST micro.

 

Rgds

 

Please show your scope trace.

Use the scope's screen capture if possible - it will give much better results than trying to photograph the screen!

 

Are you sure you have the correct SPI Mode?

 

Please post your schematic and show a minimum but complete code example which demonstrates the problem.

 

How to write your question to maximize your chances to find a solution

How to insert source code

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

NewFile1.bmp

ch1- csn,
ch2 = spi clk,
ch3 = mosi,
ch4 = miso.

SPI cycle read of WHOAMI register spiAddr = 0x8F, spiData = 0x48 (should be 0x6B).

 

spi mode 3 i.e. clk polarity high, clock 2nd edge.

Is there initialization code that must be run (write cycles) before the device will respond to reads?

 

I connect the STEVAL_$MKI243AA module into the steval-mki109D board and i can read the whoami register as 0x6B (i see it on the scope also). But if i connect the same  STEVAL_$MKI243AA to my nucleo-g491 eval board with jumpers (4 wire spi), the board is giving 0x48 for the WHOAMI register. 

 

what is the steval-mki109D board doing special to make it work?

 

Any help on this will be greatly appreciated.

arifkhan
Associate II

I am really disappointed with the help i have received from ST micro. 

I should start looking for an alternate solution and and also transition away from using all STmicro parts in the future given there level of support.


@arifkhan wrote:

I am really disappointed with the help i have received from ST micro. 


You still haven't provided your schematic, or any code

How to write your question to maximize your chances to find a solution

 

Something is clearly very wrong with your MISO:


@arifkhan wrote:
AndrewNeil_0-1777278462869.png

Do you have a good ground connection?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.