Example description
This example shows how to use DAC peripheral with 2 modes: POLLING mode or DMA mode.
The DAC will be initialized with maximum current is 700uA. This allows a maximum update rate of 1Mhz DAC updated values have range from 0 to 0x3FF. AOUT ouput voltage will change from: Vss to VDD. Run and observe AOUT signal by oscilloscope.
The UART is used with a small menu to start and control the program.
Special connection requirements
- Embedded Artists' LPC1788 Developer's Kit:
- Embedded Artists' LPC4088 Developer's Kit:
Connect P026 to oscilloscope to observe the output signal.
- LPCXpresso LPC1769:
Need to connect with base board for using RS232/UART port.
Connect P026 to oscilloscope to observe the output signal.
J31, J32 on base board should be closed to hear the sound.
Build procedures:
LPC17xx/40xx example quickstart for Keil uVision4
LPC17xx/40xx example quickstart for IAR EWARM
LPC17xx/40xx example quickstart for Code Red Xpresso
Supported boards and board setup:
Embedded Artists' LPC1788 Developer's Kit
Embedded Artists' LPC4088 Developer's Kit
NXP Xpresso LPC1769 board
Submitting LPCOpen issues:
Community support for LPCOpen
| #define DAC_TIMEOUT 0x3FF |
Definition at line 94 of file dac.c.
Definition at line 76 of file dac.c.
| static void App_DMA_Test |
( |
void |
| ) |
|
|
static |
| static void App_Polling_Test |
( |
void |
| ) |
|
|
static |
| void DMA_IRQHandler |
( |
void |
| ) |
|
DMA interrupt handler sub-routine.
- Returns
- Nothing
Definition at line 197 of file dac.c.
Main routine for DAC example.
Main program body.
- Returns
- Nothing
Definition at line 211 of file dac.c.
| volatile uint8_t channelTC |
|
static |
Definition at line 89 of file dac.c.
| volatile uint8_t DAC_Interrupt_Done_Flag |
|
static |
Definition at line 90 of file dac.c.
| const char DirectionMenu[] |
|
static |
Initial value:=
"Press \'o\' or \'p\' to change sound frequency\r\n"
Definition at line 85 of file dac.c.
Definition at line 91 of file dac.c.
| volatile uint8_t dmaChannelNum |
|
static |
Definition at line 89 of file dac.c.
| volatile uint8_t Interrupt_Continue_Flag |
|
static |
Definition at line 90 of file dac.c.
Initial value:=
"Press number 1-2 to choose DAC running mode:\r\n"
"\t1: Polling Mode \r\n"
"\t2: DMA Mode \r\n"
Definition at line 81 of file dac.c.
Initial value:=
"Hello NXP Semiconductors \r\n"
"DAC DEMO \r\n"
"Press \'c\' to continue or \'x\' to quit\r\n"
Definition at line 77 of file dac.c.