2024-11-05 04:58 AM
Hello, i am trying to use SPI2 on STM32H753VIT6 MCU using PD3 as Clock and PC2_C as MISO. Using the Hal libraries, i can generate clock on PD3 pin, and sensor answers me. But i dont get the sensor value on my software. Strange behaviour is, at its normal state i read 0xFF from PC2_C pin, but when i pull PC2_C to ground i can read 0x00. However i cannot read sensor data. When i changed the MISO pin to PB14 it worked. But i need PC2_C for my design. I have seen there have been people that had problems with PC2_C pin due to it being analog pin i assume. But i dont see anything on errata sheet. How can i solve my problem?
Thank you.
Solved! Go to Solution.
2024-11-05 06:33 AM
You need to ensure you don't exceed 1mA as external load:
From the errata:
+ In the datasheet:
2024-11-05 05:18 AM
Edit: SYSCFG_PMCR PC2_C value is 0.
2024-11-05 05:30 AM
Hello,
Check first the Switch status of PC2_C: https://community.st.com/t5/stm32-mcus-products/stm32h7-pc2-c-and-pc3-c-gpio-not-working/m-p/738739
2024-11-05 05:48 AM
SYSCFG_PMCR registers PC2_C bit is 0. Also when i make SPI2 work at very low speed(20Kbit), i can see somewhat meaningful data but still sometimes it is wrong.
2024-11-05 06:11 AM
Confirm that PC2_C is set to Input mode with a no-pull or pull-up configuration, as floating configurations on certain pins can lead to unstable readings.
2024-11-05 06:30 AM
What do you mean by Input mode? I am assuming you dont mean the value stated in MODER register because i have already stated that i am using PC2_C as SPI2_MISO pin so Alternative Function. Also, pin is configured as no pull up or pull down.
2024-11-05 06:33 AM
You need to ensure you don't exceed 1mA as external load:
From the errata:
+ In the datasheet:
2024-11-05 06:43 AM
How can i make sure that MISO pin sunks less than 1mA of current?
2024-11-05 06:49 AM
You need to measure that current and at any time that should exceed 1mA PK-PK.