Part 1
요약·해설
17개 build 명령, MCP4725 조건과 약 4초 period의 출력 사양을 모두 보존합니다.
Sawtooth
About 4 seconds
17
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
2A258B2AB412FE1FE12CA1968EED09D0B7D2CDC8850C74EDD7CBBB0A51E2C500
.. zephyr:code-sample:: dac
:name: Digital-to-Analog Converter (DAC)
:relevant-api: dac_interface
Generate an analog sawtooth signal using the DAC driver API.
Overview
********
This sample demonstrates how to use the :ref:`DAC driver API <dac_api>`.
Building and Running
********************
The DAC output is defined in the board's devicetree and pinmux file.
The board's :ref:`/zephyr,user <dt-zephyr-user>` node must have ``dac``,
``dac-channel-id``, and ``dac-resolution`` properties set. See the predefined
overlays in :zephyr_file:`samples/drivers/dac/boards` for examples.
Building and Running for ST Nucleo L073RZ
=========================================
The sample can be built and executed for the
:ref:`nucleo_l073rz_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: nucleo_l073rz
:goals: build flash
:compact:
Building and Running for ST Nucleo L152RE
=========================================
The sample can be built and executed for the
:ref:`nucleo_l152re_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: nucleo_l152re
:goals: build flash
:compact:
Building and Running for ST Nucleo F767ZI
=========================================
The sample can be built and executed for the
:ref:`nucleo_f767zi_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: nucleo_f767zi
:goals: build flash
:compact:
Building and Running for ST Disco F3
=========================================
The sample can be built and executed for the
:ref:`stm32f3_disco_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: stm32f3_disco
:goals: build flash
:compact:
Building and Running for ST Nucleo F429ZI
=========================================
The sample can be built and executed for the
:ref:`nucleo_f429zi_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: nucleo_f429zi
:goals: build flash
:compact:
Building and Running for STM32L562E DK
======================================
The sample can be built and executed for the
:ref:`stm32l562e_dk_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: stm32l562e_dk
:goals: build flash
:compact:
Building and Running for ST Nucleo L552ZE Q
===========================================
The sample can be built and executed for the
:ref:`nucleo_l552ze_q_board` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: nucleo_l552ze_q
:goals: build flash
:compact:
Building and Running for NXP TWR-KE18F
======================================
The sample can be built and executed for the :ref:`twr_ke18f` as
follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: twr_ke18f
:goals: build flash
:compact:
DAC output is available on pin A32 of the primary TWR elevator
connector.
Building and Running for NXP FRDM-K64F
======================================
The sample can be built and executed for the :ref:`frdm_k64f` as
follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: frdm_k64f
:goals: build flash
:compact:
DAC output is available on connector J4 pin 11.
Building and Running for BL652
==============================
The BL652 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl652_dvk` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: bl652_dvk
:goals: build flash
:compact:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL653
==============================
The BL653 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl653_dvk` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: bl653_dvk
:goals: build flash
:compact:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL654
==============================
The BL654 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl654_dvk` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: bl654_dvk
:goals: build flash
:compact:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL5340
===============================
The BL5340 DVK PCB contains a MCP4725 to use as a DAC. The sample can be
built and executed for the :ref:`bl5340_dvk` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: bl5340_dvk/nrf5340/cpuapp
:goals: build flash
:compact:
DAC output is available on pin 1 of the MCP4725.
Building and Running for GD32450I-EVAL
======================================
The sample can be built and executed for the
:ref:`gd32f450i_eval` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: gd32f450i_eval
:goals: build flash
:compact:
Bridge the JP23 to DAC with the jumper cap, then DAC output will available on JP7.
Building and Running for Longan Nano and Longan Nano Lite
=========================================================
The sample can be built and executed for the
:ref:`longan_nano` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: longan_nano
:goals: build flash
:compact:
also can run for the
:ref: `longan_nano_lite` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: longan_nano/gd32vf103/lite
:goals: build flash
:compact:
Building and Running for NXP LPCXpresso55S36
============================================
The sample can be built and executed for the :ref:`lpcxpresso55s36` as
follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: lpcxpresso55s36
:goals: build flash
:compact:
DAC output is available on connector J12 pin 4.
Sample output
=============
You should see a sawtooth signal with an amplitude of the DAC reference
voltage and a period of approx. 4 seconds at the DAC output pin specified
by the board.
The following output is printed:
.. code-block:: console
Generating sawtooth signal at DAC channel 1.
.. note:: If the DAC is not supported, the output will be an error message.
Part 3
한국어 전문 번역
개요
이 sample은 DAC driver API의 사용법을 보여줍니다.
Build와 실행
DAC output은 board의 devicetree와 pinmux 파일에 정의됩니다.
Board의 /zephyr,user node에는 dac, dac-channel-id, dac-resolution property가 설정되어 있어야 합니다. 예는 samples/drivers/dac/boards의 미리 정의된 overlay를 참조하십시오.
ST Nucleo L073RZ용 Build와 실행
nucleo_l073rz board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b nucleo_l073rz samples/drivers/dac
west flash
ST Nucleo L152RE용 Build와 실행
nucleo_l152re board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b nucleo_l152re samples/drivers/dac
west flash
ST Nucleo F767ZI용 Build와 실행
nucleo_f767zi board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b nucleo_f767zi samples/drivers/dac
west flash
ST Disco F3용 Build와 실행
stm32f3_disco board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b stm32f3_disco samples/drivers/dac
west flash
ST Nucleo F429ZI용 Build와 실행
nucleo_f429zi board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b nucleo_f429zi samples/drivers/dac
west flash
STM32L562E DK용 Build와 실행
stm32l562e_dk board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b stm32l562e_dk samples/drivers/dac
west flash
ST Nucleo L552ZE Q용 Build와 실행
nucleo_l552ze_q board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b nucleo_l552ze_q samples/drivers/dac
west flash
NXP TWR-KE18F용 Build와 실행
twr_ke18f board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b twr_ke18f samples/drivers/dac
west flash
DAC output은 primary TWR elevator connector의 A32 pin에서 사용할 수 있습니다.
NXP FRDM-K64F용 Build와 실행
frdm_k64f board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b frdm_k64f samples/drivers/dac
west flash
DAC output은 connector J4 pin 11에서 사용할 수 있습니다.
BL652용 Build와 실행
bl652_dvk board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b bl652_dvk samples/drivers/dac
west flash
BL652 DVK PCB에는 external DAC로 사용할 MCP4725 footprint가 있지만 기본으로 부품이 장착되어 있지는 않습니다. DAC output은 MCP4725의 pin 1에서 사용할 수 있습니다.
BL653용 Build와 실행
bl653_dvk board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b bl653_dvk samples/drivers/dac
west flash
BL653 DVK PCB에는 external DAC로 사용할 MCP4725 footprint가 있지만 기본으로 부품이 장착되어 있지는 않습니다. DAC output은 MCP4725의 pin 1에서 사용할 수 있습니다.
BL654용 Build와 실행
bl654_dvk board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b bl654_dvk samples/drivers/dac
west flash
BL654 DVK PCB에는 external DAC로 사용할 MCP4725 footprint가 있지만 기본으로 부품이 장착되어 있지는 않습니다. DAC output은 MCP4725의 pin 1에서 사용할 수 있습니다.
BL5340용 Build와 실행
bl5340_dvk/nrf5340/cpuapp board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b bl5340_dvk/nrf5340/cpuapp samples/drivers/dac
west flash
BL5340 DVK PCB에는 DAC로 사용할 MCP4725가 장착되어 있습니다. DAC output은 MCP4725의 pin 1에서 사용할 수 있습니다.
GD32450I-EVAL용 Build와 실행
gd32f450i_eval board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b gd32f450i_eval samples/drivers/dac
west flash
Jumper cap으로 JP23을 DAC 쪽에 연결하면 DAC output을 JP7에서 사용할 수 있습니다.
Longan Nano와 Longan Nano Lite용 Build와 실행
longan_nano에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b longan_nano samples/drivers/dac
west flash
longan_nano_lite에서도 다음과 같이 실행할 수 있습니다.
west build -b longan_nano/gd32vf103/lite samples/drivers/dac
west flash
NXP LPCXpresso55S36용 Build와 실행
lpcxpresso55s36 board에서는 다음과 같이 sample을 build하고 실행할 수 있습니다.
west build -b lpcxpresso55s36 samples/drivers/dac
west flash
DAC output은 connector J12 pin 4에서 사용할 수 있습니다.
Sample 출력
Board에서 지정한 DAC output pin에는 DAC reference voltage와 같은 amplitude, 약 4초 period의 sawtooth signal이 나타나야 합니다.
다음 내용이 출력됩니다.
Generating sawtooth signal at DAC channel 1.
참고: DAC가 지원되지 않으면 오류 message가 출력됩니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.