2701 views|0 replies

140

Posts

0

Resources
The OP
 

14. [Learning LPC1768 library functions] DAC experiment [Copy link]

DAC is a digital to analog converter (English: Digital to analog converter, English abbreviation: DAC) is a device that converts digital signals into analog signals (in the form of current, voltage or charge). In many digital systems (such as computers), signals are stored and transmitted digitally, and digital to analog converters can convert such signals into analog signals so that they can be recognized by the outside world (people or other non-digital systems).

/*******************************************************************************************
** 函 数 名: void DAC_Init(void)
** 函数功能:初始化DAC。
** 输入参数:无                                                                                                                                
** 输出参数:无
** 返回值: 无                                                                                                                                
*******************************************************************************************/


void DAC_Init(void){

        //DAC时钟默认打开,所以不用设置
        Chip_GPIO_Init(LPC_GPIO);//打开GPIO外设时钟
        Chip_IOCON_PinMux(LPC_IOCON, 0, 26, IOCON_MODE_INACT, IOCON_FUNC2);//设置 p0.26 为DAC输出脚
        Chip_DAC_SetBias(LPC_DAC,DAC_MAX_UPDATE_RATE_400kHz);//设置最大更新速率
        
}
/*******************************************************************************************                                                                                                                        
** 函 数 名: void DacConver(uint16_t val)
** 函数功能:数字电压转换模拟电压
** 输入参数:val=电压值         0~3300                                                                                                         
** 输出参数:无
** 返回值: 无                                                                                                                                
*******************************************************************************************/

void DacConver(uint16_t val){

Chip_DAC_UpdateValue(LPC_DAC,val);

}

【14】LPC1768_DAC实验.rar (249.3 KB, downloads: 13)



This content is originally created by EEWORLD forum user Caribbean Pirates . If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

This post is from NXP MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list