Reading data from L3GD20 (SPI)
Hi,
did anyone try to connect to the gyro (L3GD20) on F303Discovery board over SPI?
I have a problem even with reading the WHO_AM_I register:
My code is generated with Cube and I added the following lines:
𝐮𝐢𝐧𝐭𝟖_𝐭 𝐝𝐚𝐭𝐚_𝐰𝐡𝐨𝐚𝐦𝐢, 𝐚𝐝𝐝𝐫𝐞𝐬𝐬_𝐰𝐡𝐨𝐚𝐦𝐢;
𝐚𝐝𝐝𝐫𝐞𝐬𝐬_𝐰𝐡𝐨𝐚𝐦𝐢 = 𝟎𝐱𝟎𝐟 | 𝟎𝐱𝟖𝟎; -- set RW
𝐇𝐀𝐋_𝐆𝐏𝐈𝐎_𝐖𝐫𝐢𝐭𝐞𝐏𝐢𝐧(𝐆𝐏𝐈𝐎𝐄,𝐆𝐏𝐈𝐎_𝐏𝐈𝐍_𝟑, 𝐆𝐏𝐈𝐎_𝐏𝐈𝐍_𝐑𝐄𝐒𝐄𝐓);--reset CS on SPI
𝐇𝐀𝐋_𝐒𝐏𝐈_𝐓𝐫𝐚𝐧𝐬𝐦𝐢𝐭𝐑𝐞𝐜𝐞𝐢𝐯𝐞(&𝐡𝐬𝐩𝐢𝟏, &𝐚𝐝𝐝𝐫𝐞𝐬𝐬_𝐰𝐡𝐨𝐚𝐦𝐢,&𝐝𝐚𝐭𝐚_𝐰𝐡𝐨𝐚𝐦𝐢,𝟐,𝟓𝟎);
𝐇𝐀𝐋_𝐆𝐏𝐈𝐎_𝐖𝐫𝐢𝐭𝐞𝐏𝐢𝐧(𝐆𝐏𝐈𝐎𝐄,𝐆𝐏𝐈𝐎_𝐏𝐈𝐍_𝟑, 𝐆𝐏𝐈𝐎_𝐏𝐈𝐍_𝐒𝐄𝐓);--set CS on SPI
Having that the 𝐌𝐗_𝐒𝐏𝐈𝟏_𝐈𝐧𝐢𝐭() is called before so that the SPI should be initialized correctly, but the problem I can't read the expected WHO_AM_I value (D4)

