cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the internal comparator COMP2 to work on my Nucleo stm32L073 board? (in Keil)

I try to modify the COMP2_CSR register on addr: 0x4001001C. But it's as if the register is locked to the default value. From the Memory viewer it seems the register is modifiable, but the COMP window still shows default value and I cannot modify the register manually from the COMP window.

APB2 SYSCFG clock is enabled. See screenshot.

0690X0000089dlVQAQ.png

1 REPLY 1

Okay I solved it. There were two things.

  1. Keil is referencing the wrong bits for the COMP_CSR registers. For some reason Keil thinks COMP2_CSR has address 0x40010034.
  2. I had routed the comparator output to PA2, which on the nucleo board is shared with USART_TX. So the short SB63 was not mounted and I was not measuring anything. I changed the output to PA7 and now it works..