1.. zephyr:code-sample:: mcux_lpcmp 2 :name: NXP MCUX Low-power Analog Comparator (LPCMP) 3 :relevant-api: sensor_interface 4 5 Get analog comparator data from an NXP MCUX Low-power Analog Comparator (LPCMP). 6 7Overview 8******** 9 10This sample show how to use the NXP MCUX Low-power Analog Comparator (LPCMP) driver. 11 12In this application, the negative input port of the LPCMP is set with 13:kconfig:option:`CONFIG_LPCMP_NEGATIVE_PORT` which means the input voltage comes 14from the LPCMP internal DAC. The reference voltage of the DAC is set to 0 (check 15the reference manual to confirm the voltage source for your specific chip). The 16output voltage of the DAC equals (VREF/256)*(data+1), where data is set through 17the attribute ``SENSOR_ATTR_MCUX_LPCMP_DAC_OUTPUT_VOLTAGE``. The positive input 18port is set with :kconfig:option:`CONFIG_LPCMP_POSITIVE_PORT`. Check the reference 19manual and board schematic to confirm which specific port is used. You can connect 20an external voltage to that port and change the input voltage to see the output 21change of the LPCMP. 22 23The output value of the LPCMP is reported on the console. 24 25Building and Running 26******************** 27 28Building and Running for NXP FRDM-MCXN947 29========================================= 30Build the application for the :zephyr:board:`frdm_mcxn947` board, and adjust the 31LPCMP positive input port voltage by changing the voltage input to J2-17. 32 33.. zephyr-app-commands:: 34 :zephyr-app: samples/sensor/mcux_lpcmp 35 :board: frdm_mcxn947//cpu0 36 :goals: build flash 37 :compact: 38 39Building and Running for NXP FRDM-MCXN236 40========================================= 41Build the application for the :zephyr:board:`frdm_mcxn236` board, and adjust the 42LPCMP positive input port voltage by changing the voltage input to J2-8. 43 44.. zephyr-app-commands:: 45 :zephyr-app: samples/sensor/mcux_lpcmp 46 :board: frdm_mcxn236 47 :goals: build flash 48 :compact: 49 50Building and Running for NXP FRDM-MCXA156 51========================================= 52Build the application for the :zephyr:board:`frdm_mcxa156` board, and adjust the 53LPCMP positive input port voltage by changing the voltage input to J2-9. 54 55.. zephyr-app-commands:: 56 :zephyr-app: samples/sensor/mcux_lpcmp 57 :board: frdm_mcxa156 58 :goals: build flash 59 :compact: 60 61Building and Running for NXP FRDM-MCXA153 62========================================= 63Build the application for the :zephyr:board:`frdm_mcxa153` board, and adjust the 64LPCMP positive input port voltage by changing the voltage input to J2-9. 65 66.. zephyr-app-commands:: 67 :zephyr-app: samples/sensor/mcux_lpcmp 68 :board: frdm_mcxa153 69 :goals: build flash 70 :compact: 71 72Building and Running for NXP FRDM-MCXA346 73========================================= 74Build the application for the :zephyr:board:`frdm_mcxa346` board, and adjust the 75LPCMP positive input port voltage by changing the voltage input to J2-17. 76 77.. zephyr-app-commands:: 78 :zephyr-app: samples/sensor/mcux_lpcmp 79 :board: frdm_mcxa346 80 :goals: build flash 81 :compact: 82 83Building and Running for NXP FRDM-MCXA266 84========================================= 85Build the application for the :zephyr:board:`frdm_mcxa266` board, and adjust the 86LPCMP positive input port voltage by changing the voltage input to J2-17. 87 88.. zephyr-app-commands:: 89 :zephyr-app: samples/sensor/mcux_lpcmp 90 :board: frdm_mcxa266 91 :goals: build flash 92 :compact: 93