AnsweredAssumed Answered

STM8L151G4U6 PD problom

Question asked by Ni Qichang on Feb 1, 2018

i use stm8l151g4 pd4 to control external ADC converter,when pd4=1,ADC converter start,and pd4=0,ADC converter stop,pd4 initialized as below:

PD_DDR_DDR4 = 1;       //PD4- Output

PD_CR1_C14 = 1;          //PD4 - Push-pull
PD_CR2_C24 = 0;          //PD4 - Output speed up to 2 MHz

...

PD_ODR_ODR4 = 1;      //ADC start convert

...

PD_ODR_ODR4 = 0;      //ADC stop convert

 

but when PD_ODR_ODR4 = 1, the PD4 pin  is still 0,why?

 

btw:The circuit and the program work good at the beginning.

Outcomes