Demonstration Program Operation
3.4.3
Digital-to-Analog Conversion
This program uses Digital Potentiometer MCP41010 on the dsPICDEM 80-Pin Starter
Development Board as a D/A converter to generate a sine-wave signal (audio tone) to
the LINE OUT pin. The digital potentiometer is driven by the output of the serial
peripheral interface SPI2 of the dsPIC30F6014A device, which receives its input from
the program.
The program retrieves HEX values from a table in data memory and delivers it to the
SPI. Thirty-two stored values cover the full range of the digital potentiometer. As the
analog output of the digital potentiometer passes through the MCP6022 Operational
Amplifier (configured as a low-pass filter) it results in a 400 Hz sine wave based on a
new table value every 125 μ sec covering all 32 table values. The sine wave is placed
on the LINE OUT pin of the development board.
Figure 3-3 illustrates the digital-to-analog conversion process. Switches S1 and S2 are
used to change the output frequency to 800 Hz and 1600 Hz, respectively, by skipping
over some of the table values.
FIGURE 3-3:
DIGITAL-TO-ANALOG CONVERSION PROGRAM FLOW
START
INIT SPI2
Set Reg W2 to Start of Tone Table
Set Reg W3 to End of Tone Table
Set Reg W1 = W2
Set W4 = Value Pointed to by
W1 Using PSV
Transmit Contents of W4 to
SPI2
Has 150 μ sec Interrupt
Occurred?
Yes
Set W1 = W1 + 2
No
No
S1 Pressed?
Yes
Set W1 = W1 + 2
W1 > W3?
No
S2 Pressed?
Yes
Set W1 = W1 + 4
No
Yes
Set W1 = W2
? 2006 Microchip Technology Inc.
DS51584B-page 29
相关PDF资料
DM300024 KIT DEMO DSPICDEM 1.1
DM330012 KIT USB STARTER FOR DSPIC33E
DM330013 MICROSTICK DSPIC33F/PIC24H BOARD
DNET1 SURGE SUPPRESSOR ETHERNET RJ45
DR-8094 RACK DOUBLE 84"X20.25"X36" BLK
DR-IAC5E INPUT MODULE AC 5VDC
DRIDC24A INPUT MODULE DC 34MA 24VDC
DRODC24 OUTPUT MODULE DC 13MA 24VDC
相关代理商/技术参数
DM300019 制造商:Microchip Technology Inc 功能描述:DEMO BOARD STARTER ((NW))
DM300020 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM MC1 Motor C RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300021 功能描述:开发板和工具包 - PIC / DSPIC High V Pwr Module RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300021 制造商:Microchip Technology Inc 功能描述:MODULE dsPICDEM MC1H 3 PHASE
DM300022 功能描述:开发板和工具包 - PIC / DSPIC Low V Pwr Module RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300023 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM SMPS Buck Demo Brd RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300024 功能描述:开发板和工具包 - PIC / DSPIC dsPICDEM 1.1 GP RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM300027 功能描述:开发板和工具包 - PIC / DSPIC 16-bit Starter Demo Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: