电路图部分:![]() ![]() 软件部分: ![]() ![]() #define HC165_PL PCout(13) //pl #define HC165_CLK PCout(14) //cp #define HC165_DAT HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_15) //Q7 探物传感器的状态是:电平为高(没有物品) 低电平(有物品) 各位大佬帮看看什么原因 |
1. HC165_DAT!=0 2. 你确定你那个for循环中CLK的波形没问题? CLK拉高之后稍微延时一下
PC14, PC15 -> 在部分 STM32F1 的封装中, 对应到LSE Crystal 32.768KHz 会不会是AFIO 没切换到GPIO?
PC14, PC15 -> 在部分 STM32F1 的封装中, 对应到LSE Crystal 32.768KHz 会不会是AFIO 设定接脚, 没切换到GPIO? UsingOSC32_IN/OSC32_OUT pins as GPIO ports PC14/PC15 The LSEoscillator pins OSC32_IN and OSC32_OUT can be used as general-purpose I/O PC14 and PC15,respectively, when the LSE oscillator is off. The LSE has priority over the GP IOs function. Note: ThePC14/PC15 GPIO functionality is lost when the 1.8 V domain is powered off (by enteringstandby mode) or when the backup domain is supplied by VBAT (VDD no more supplied).In this case the IOs are set in analog mode. Refer to the note on IO usage restrictions in Section5.1.2: Battery backup domain.