Hello,
I currently have another device where the HSCMP2 peripheral is not functioning. I have two identical devices on my table with the same firmware, one of which works and the other does not. To facilitate testing, I connected my laboratory power supply to the positive input of the CMP, allowing me to easily adjust the voltage.
I am comparing the output at 163 mV generated with the DAC sub-module, which creates the reference voltage at the negative input from the 3.5 V supply. The output of the CMP is inverted.
The working device sets the HSCMP_CSR_COUT bit when the voltage is below 160 mV; otherwise, the bit is 0. The non-functioning device sets the HSCMP_CSR_COUT bit below 210 mV and above 780 mV; in between, it remains 0.
I directly readout the status with debugger.
What I would also like to mention is that in the datasheet, the bit fields INPSEL (bits 29-28) and INPSEL (bits 25-24) in the CCR2 register cannot be written to and are always read back as 0. I think that the fields do not exist and that only MSEL and PSEL are used for the input mux.
Is anyone else experiencing a similar problem? Is there a workaround? I'm starting to have a very, very bad feeling about using this mcu in mass-produced devices.
Best regards,
nobodyKnows