Postcard
STM32 SPI Register Read Exercise
Task
The bench plays the sensor on SPI1. Bring up SPI1. Once after reset, write 0x42 to the sensor's register 0x20, then read register 0x28 and print the value. The registers and bit fields are on the Datasheet tab.
Circuit
Pass condition
The logic analyzer must show the write and then the read, each in its own CS frame. The terminal must print READ:0x and the value in two hex digits.
Notes
The sensor uses SPI mode 0. Frames start with the register byte, bit 7 set to read. Send 0x00 where a byte has no data. USART1, uart_puts and uart_put_hex are given.