cancel
Showing results for 
Search instead for 
Did you mean: 

How to read SPI_MISO from sensor (A111) to STM32G071CBx MCU? (XE132/XM132 from aconeer)

SKvan.1
Associate

Have tried using hal_spi_transmit and receive but cant figure it out, any suggestions?

5 REPLIES 5

Try to bit-bang it first, through pins set as GPIO Output (SCK) and Input (MISO).

Observe the pins using oscilloscope, compare waveforms to what's in the datasheet.

JW

Andrew Neil
Evangelist III

@SKvan.1​  "Have tried using hal_spi_transmit and receive but cant figure it out"

What, exactly, can you not figure out?

  • Do you understand how the XE132/XM132 works? See the manufacturer's documentation for help on this.

  • Is it just how to use the hal_spi_transmit() function that you're stuck on?

Surely Aconeer provides examples for their own HW combo A111+STM32F071CBU6 device?

Work with them directly, and with whatever SDK / DDK they provide.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I want to use the digital value from the A111, into the DAC (MCU). Thought first about gpio read but its only high/low.(?) I think i know how XE132/XM132 works, and the value should come from SPI_MISO, which goes into MCU (17, PA6). I cant figure out how to get that specific digital value.

@SKvan.1​ "I cant figure out how to get that specific digital value"

So, again, where are you stuck on that?

The XE132/XM132 documentation will tell you how to read stuff from it over its SPI interface.

The XE132/XM132 SPI interface neither knows nor cares what microcontroller you use - its operation will be the same whatever Master you use.

Similarly, the STM32's SPI controller neither knows nor cares what slave you are using; its operation will be the same irrespective - in Master mode, it clocks stuff out on MOSI, and in on MISO.