Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Khoa Nguyen 9a66297eae samples: boards: renesas: Add support comparator for ek_ra8p1 2 weeks ago
..
boards
src
CMakeLists.txt
Kconfig
README.rst
prj.conf
sample.yaml

README.rst

.. zephyr:code-sample:: renesas_comparator
:name: Renesas comparator

Monitor the output of comparator.

Overview
********

A sample that help to monitor the output of comparator.

Hardware Setup
**************

* The IVREF is connected to the internal output of DA0 (DAC module).
By default, DA0 is set to ~1.75V (half of the full-scale voltage).

* For IVCOMP, the user can connect the IVCMP3 input to either:

* Case 1: IVCMP3 with SW0 (button on board, on ek_ra8m1 is P600).
* Case 2: IVCMP3 with external voltage for comparison.

Building and Running
********************

This application can be built and executed on RA boards as follows:

.. zephyr-app-commands::
:zephyr-app: samples/boards/renesas/comparator
:board: ek_ra8m1
:goals: build flash
:compact:

The comparator's output controls LED0:

* If the comparator output is HIGH, LED0 turns on.
* If the comparator output is LOW, LED0 turns off.

Example case:

* Case 1: IVCMP3 connected to SW0 (Pull up)

* SW0 not pressed --> Comparator output HIGH --> LED0 on
* SW0 pressed --> Comparator output LOW --> LED0 off

* Case 2: IVCMP3 connected to another reference voltage

* IVCMP3 HIGH --> Comparator output HIGH --> LED0 on
* IVCMP3 LOW --> Comparator output LOW --> LED0 off