2016-09-02 10:53 AM
I am unable to get any output from the COMP1 comparator on an STM32F072RB on any pin other than PA0. The datasheet ''STM32F072x8 STM32F072xB'' states on pg 41 that COMP1_OUT should be available on pins PA0 PA6 and PA11 through the alternate function channels.
I have tried developing my own code writing directly to the registers with CMSIS, and also modifying the low level examples (Examples_LL) from the STM32CubeF0 for the STM32F072RB-Nucleo. Specifically the ''COMP_CompareGpioVsVrefInt_OutputGpio'' example. Has anyone ran into this issue or does anyone know a fix?2016-09-05 04:40 AM
Hi jones.jim.002,
I have made a quick test on the Nucelo-F072 using the example that you mentionned. All COMP_OUT pins works well and the example is OK. Just ensure the following: * For case PA6 as COMP_OUT pin : - Replace all ''LL_GPIO_PIN_0'' with ''LL_GPIO_PIN_6'' * For case PA11 as COMP_OUT pin : -Replace all ''LL_GPIO_PIN_0'' with ''LL_GPIO_PIN_11'' - Replace fucntion ''LL_GPIO_SetAFPin_0_7'' with ''LL_GPIO_SetAFPin_8_15'' -Hannibal-2016-09-06 09:10 AM
Thank you for the response Hannibal.
In the example listed I changed line 143 to: ''LL_GPIO_SetPinOutputType(GPIOA, LL_GPIO_PIN_11, LL_GPIO_OUTPUT_PUSHPULL);'', line 146 to: ''LL_GPIO_SetPinSpeed(GPIOA, LL_GPIO_PIN_11, LL_GPIO_SPEED_FREQ_VERY_HIGH);'', line 149 to: ''LL_GPIO_SetPinMode(GPIOA, LL_GPIO_PIN_11, LL_GPIO_MODE_ALTERNATE);, and line 150 to: ''LL_GPIO_SetAFPin_8_15(GPIOA, LL_GPIO_PIN_11, LL_GPIO_AF_7);'' It still doesn't work for me and as when I change everything back to pin 0 it works correctly. Either I am missing something, or I have defective/damaged silicon because I get nothing for either pin 6 or pin 11.2016-09-06 09:26 AM
Hi,
Don't forget to make change inside the while(1) like folllowing :if (LL_GPIO_IsInputPinSet(GPIOA, LL_GPIO_PIN_11) != 0)
{
LED_On();
}
else
{
LED_Off();
}
-Hannibal-
2016-09-06 11:29 AM
I tried to change this as well. It still doesn't seem to work.
2016-09-22 03:23 AM
Hi jones.jim.002,
Are you testing that on the ready-to-use example of STM32Cube. If yes, you surely hardware issue , try to change the NUCLEO by other one and see. -Hannibal-