Skip to main content
立张.1
Associate II
May 24, 2023
Question

How to use COMP on STM32g431c8T6? I found it not work correctly. The pol is noninverted When INP(1.6V)
  • May 24, 2023
  • 0 replies
  • 572 views

void Comp1Init(void)

{

Comp1GpioInit();

RCC -> APB2ENR |= 1;  //20230506

/////////////////////////////////////////////////////////

COMP1 -> CSR |= 3 << 19;//TIM3 OC3 Banking of CSA p739

///////////////////////////////////////////////////////////

COMP1 -> CSR |= 0 << 8;//PA1 -> COMP1+//

///////////////////////////////////////////20230512

COMP1 -> CSR |= 4 << 4; //DAC3CH1-> COMP1-

 COMP1 -> CSR |= 3 << 2;//high speed

 COMP1 -> CSR |=1; //20230506 EN

}

This topic has been closed for replies.