Hi I'm working on detecting voltage change direction(up or down) by using LPCOMP or COMP. LPCOMP initiates as following settings: detection: NRF_LPCOMP_DETECT_UP. reference: NRF_LPCOMP_REF_SUPPLY_11_16.
Toggle the detection direction in the LPCOMP IRQ handler by uninit LPCOMP and re-init it.
Like the picture showing:
Case 1 Selector selects GND Disconnect the switch, the input voltage to LPCOMP changes from GND to ~3.0v. Connect the switch , the input voltage to LPCOMP changes from ~3.0v to GND. In this case the LPCOMP working well.
Case 2 Selector selects 1.8v (Reference chip output). Disconnect the switch, the input voltage to LPCOMP changes from 1.8v to ~3.0v. Connect the switch , the input voltage to LPCOMP changes from ~3.0v to 1.8v. In this case, regardless, which state of the switch is in, the the LPCOMP won't generate any interrupt.
I have tried to use COMP Single End mode to be instead, I got the same problem. It seems to be if the voltage change range become narrow on VIN+, then the LPCOMP/COMP stops working.
Please help me to correct the problem.