F030F4P6核心板
先说下问题所在:
板子上电后,可控硅会有一个导通的瞬间,想要解决的是,除非程序控制,否则永远也不要通导。
上代码:
//GPIO口定义:#define M1_Pin GPIO_Pin_14
#define M2_Pin GPIO_Pin_13
#define M3_Pin GPIO_Pin_1
#define M4_Pin GPIO_Pin_7
#define M1_Port GPIOA
#define M2_Port GPIOA
#define M3_Port GPIOB
#define M4_Port GPIOA
//GPIO初始化:
GPIO_InitStructure.GPIO_Pin = M1_Pin|M2_Pin|M4_Pin|GPIO_Pin_4;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, GPIO_InitStructure);
GPIO_ResetBits(GPIOA,M1_Pin|M2_Pin|M4_Pin|GPIO_Pin_4);
其中,PA13 PA14是SWD口,如果把这二个口连接到线路中,程序无法下载。除非把核心板从
电路 中取出。