EEWORLDEEWORLDEEWORLD

Part Number

Search

AN123

Description
USING THE DAC AS A FUNCTION GENERATOR
File Size195KB,16 Pages
ManufacturerSILABS
Websitehttp://www.silabs.com
Download Datasheet View All

AN123 Overview

USING THE DAC AS A FUNCTION GENERATOR

AN123
U
S I N G T H E
DAC
A S A
F
U N C T I O N
G
E N E R A T O R
Relevant Devices
This application note applies to the following devices:
Implementation
The main routine of this program is a command
C8051F020, C8051F021, C8051F022, and
interpreter that sets parameters for the Timer 4
C8051F023.
interrupt service routine (ISR) which manages the
DAC updates. The Timer 4 interrupts occur at a
predetermined rate set at compile time. In the
Introduction
included software example, this value is stored in
This document describes how to implement an the constant <SAMPLE_RATE_DAC>. The
interrupt driven multifunction generator on C8051 Timer 4 ISR updates the DAC and calculates or
devices using the on-chip digital-to-analog con- looks up the next output value based on the wave-
verter (DAC).
form settings.
Features
Four different waveforms expandable to any
periodic function defined in a table.
- Sine Wave (Table Defined)
- Square Wave (Calculated)
- Triangle Wave (Calculated)
- Saw Tooth Wave (Calculated)
Allows selection of the frequency and ampli-
tude of waveform at run time.
An interactive interface with a PC using the
serial communications port and HyperTerminal
or an equivalent program.
Setting up the DAC
Any free DAC, referred to as DACn, may be used
to generate waveforms. In this example DACn is
used in left-justified mode with output scheduling
based on Timer 4 overflows. Refer to the data sheet
for specific information on how to set the DAC-
nCN register to specify DACn modes.
When the DAC is configured to left-justified mode,
16-bit data can be written to the 12-bit data register
with no shifting required. In this case, the 4 least
significant bits are ignored.
In this example, DACn updates occur on Timer 4
overflows, meaning writes to DACnH and DACnL
have no immediate effect on the DAC output, but
instead are held until the next Timer 4 overflow.
Another important note is that the internal voltage
reference must be enabled by setting the appropri-
ate bits in the REFnCN register before the DAC
can be used.
Key Points
Output waveforms have 16-bit frequency reso-
lution using the phase accumulator approach.
The on-chip DAC’s can support waveform gen-
eration up to 50 kHz.
By using a 16-bit lookup table with a 12-bit
DAC, error in the amplitude is virtually elimi-
nated.
Sampling Rate
The sampling rate is configured by initializing the
Timer 4 reload value with the number of SYSCLK
Rev. 1.1 12/03
Copyright © 2003 by Silicon Laboratories
AN123-DS11
Why does the TIMERA count of MSP430 have missing numbers?
The pulse period is about 0.1S, and the TimerA clock is 1M after division.There are 2 groups of counts. Each time a pulse is sent, n7 or n8 +1 is triggered after the interruption.Could you please tell...
simonprince Microcontroller MCU
Why can't the project run successfully after a slight modification on ISE11.1?
I created a project on ISE11.1, and after I slightly changed the pin position, the project either failed to run, but reported an error: the timing could not be met or some signal lines could not be ro...
eeleader FPGA/CPLD
USB Development Materials
Some information used in USB development~~...
chirongbo FPGA/CPLD
How to combine several pads into one block in PCB?
I feel that it is possible to create it in the library, but it is a bit troublesome....
ena PCB Design
[Wireless digital intercom based on GDF350] 2. SPI communication of NRF24L01
[size=4]nRF24L01 is a single-chip wireless transceiver chip produced by NORDIC that works in the 2.4GHz~2.5GHz ISM band. The wireless transceiver includes: frequency generator, enhanced "SchockBurst" ...
ketose GD32 MCU
[Original] Complex waveform generator based on AD9858
【Production Date】2005 What time is it? 【Number of layers】 4 【Description】Analog Devices introduces the frequency synthesizer AD9858, which is the first single-chip solution with 1GSPS (Gigasamples/sec...
yhftiger RF/Wirelessly

Technical ResourceMore

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Robot
development
community

Index Files: 2304  573  2316  1192  291  47  12  24  6  37 
Datasheet   0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Room 1530, 15th Floor, Building B, No. 18 Zhongguancun Street, Haidian District, Beijing Telephone: (010) 82350740 Postal Code: 100190
Copyright © 2005-2026 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号