MCUXpresso SDK Documentation

dac_1_buffer_interrupt

dac_1_buffer_interrupt#

Overview#

The dac_buffer_interrupt example shows how to use DAC FIFO interrupt.

When the DAC FIFO empty interrupt is enabled firstly, the application would enter the DAC ISR immediately, since the FIFO is actually empty. Then the FIFO would be feed inside the ISR. Then the DAC interrupt could be restrained. Once the DAC FIFO is triggered in while loop, the data in FIFO is read out, then it becomes empty, so the FIFO would be feed again in DAC ISR.

With this example, user can define the DAC output array to generate the different wave output. Also the software trigger can be called in some timer ISR so that the DAC would output the analog signal in indicated period. Or even use the hardware trigger to release the CPU.

Supported Boards#

FRDM-K32L3A6
Hardware requirements
  • Mini/micro USB cable

  • FRDM-K32L3A6 board

  • Personal Computer

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J4-12).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA156
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA156 Board

  • Personal Computer

Board settings

DAC output pin: J2-9(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA346
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA346 board

  • Personal Computer

Board settings

Connect the USB to TTL converter to FRDM-MCXA346 board.

  • TX of USB2COM to J5-3(P4_2)

  • RX of USB2COM to J5-4(P4_5)

  • GND of the USB2COM to J5-8(GND)

DAC output pin: J1-4(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXN947
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947 board

  • Personal Computer

Board settings

DAC output pin: J1-4(P4_2)

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J1-4).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXN947T
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947T board

  • Personal Computer

Board settings

DAC output pin: J1-4(P4_2)

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J1-4).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

LPCXpresso55S36
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S36 board

  • Personal Computer

Board settings

DAC output pin: J12-4

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J12-4).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

MCX-N5XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N5XX-EVK board

  • Personal Computer

Board settings

DAC output pin: J1-4(P4_2)

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J1-4).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

MCX-N9XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N9XX-EVK board

  • Personal Computer

Board settings

DAC output pin: J1-4(P4_2)

Prepare the Demo
  1. Connect a USB cable between the host PC and the MCU-Link USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage (Connector J1-4).

Running the demo

When the demo runs successfully, the log would be seen on the debug console terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA266
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA266 Board

  • Personal Computer

Board settings

Connect the USB to TTL converter to FRDM-MCXA266 board.

  • TX of USB2COM to J5-3(P4_2)

  • RX of USB2COM to J5-4(P4_5)

  • GND of the USB2COM to J5-8(GND)

DAC output pin: J1-4(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA366
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA366 Board

  • Personal Computer

Board settings

Connect the USB to TTL converter to FRDM-MCXA366 board.

  • TX of USB2COM to J5-3(P4_2)

  • RX of USB2COM to J5-4(P4_5)

  • GND of the USB2COM to J5-8(GND)

DAC output pin: J1-4(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA577
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA577 Board

  • Personal Computer

Board settings

DAC output pin: J8-23(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.

FRDM-MCXA287
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXA287 Board

  • Personal Computer

Board settings

DAC output pin: J8-23(P2_2)

Prepare the Demo
  1. Connect the type-C USB cable between the PC host and the USB ports on the board.

  2. Open a serial terminal on PC for the serial device with these settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  5. A multimeter may be used to measure the DAC output voltage.

Running the demo

When the demo runs successfully, the log would be seen on the MCU-Link terminal like:

DAC buffer interrupt Example. Press any key to trigger the DAC… DAC next output: 200 DAC next output: 300 DAC next output: 400 DAC next output: 500 DAC next output: 600 DAC next output: 700 DAC next output: 800 DAC next output: 900

Then user can measure the DAC output pin to check responding voltage.