2015-12-16 07:05 AM
Hello,
There are apparently some inconsistencies concerning COMP1_SW1 in the RM0038 Reference Manual (Rev 13).Which controllers do actually have this switch and the connection, and if they are present, does it mean that one can use PC3 as a more direct input to COMP1, bypassing the ADC switch matrix?
#comparator #stm32l12015-12-17 03:02 AM
OK, I've tested it with a STM32L151VCT6A, which is a mere Cat.3 device, it looks like COMP1_SW1 is there. Enabled the clocks, set PC3 to analog, then set
COMP->CSR = COMP_CSR_CMP1EN|COMP_CSR_SW1;
connected an adjustable voltage source to PC3, and it just worked, the comparison result available inCOMP->CSR&COMP_CSR_CMP1OUT
Now, it would be nice to see it properly documented.
2015-12-17 03:17 AM
Hi berendi.peter,
It seems that the cause of the confusion is the OPAMP3 which is available only on Cat4.I agree with you that documentation needs to be cleaned in order to provide the exact information.I check this deeply and then I will keep you informed.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-12-17 07:31 AM
==> OPAMP3 connection with COMP1_SW1 is available only in Cat1. The RM0038 will be aupdated accordingly.
==> COMP1_SW1 is connected to the positive input as described in the figures. So the text will be corrected.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-12-18 01:13 AM
2015-12-18 02:33 AM
Did one more test (with the code above) on a 32L152CDISCOVERY board, which is equipped with STM32L152RCT6 (without the -A suffix), and it did not work. That actually makes sense, because the -xCT6A are actually dumbed-down Cat.4 devices labeled as Cat.3, but the ones without -A are meant to be Cat.3 by design.