2021-10-23 18:51:39 索煒達電子 1163
項目編號:E1710
文件大?。?82K
源碼說明:帶中文注釋
開發(fā)環(huán)境:C編譯器
簡要概述:
此款DAC芯片是SOP6封裝的12位的軌對軌片子,正好補償小容量STM32沒有DAC功能的缺陷,IIC接口,外圍電路很簡單。輸出函數(shù)直接調(diào)用:MCP4725_WriteData_Voltage(u16 Vout) 這個函數(shù)。補充一下:最大輸出為5V,用到了電平轉(zhuǎn)換。例如:****
頭文件/初始化文件忽略
****
int main(void)
{
delay_init(); //延時函數(shù)初始化
MCP4725_Init(); //MCP4725初始化
while(1)
{
MCP4725_WriteData_Voltage(4095); //輸出最大 一般要求在100-4000之間
}
}
制作出來的實物圖如下:
目錄│文件列表:
└ MCP4725驅(qū)動
│ keilkilll.bat
│ README.TXT
├ CORE
│ │ core_cm3.c
│ │ core_cm3.h
│ └ startup_stm32f10x_hd.s
├ HARDWARE
│ ├ DAC
│ │ │ DAC_MCP4725.c
│ │ └ DAC_MCP4725.h
│ ├ IIC
│ │ │ myiic.c
│ │ └ myiic.h
│ ├ KEY
│ │ │ key.c
│ │ └ key.h
│ ├ LED
│ │ │ led.c
│ │ └ led.h
│ └ MCP4725
│ │ MCP4725.c
│ └ MCP4725.h
├ OBJ
│ └ LED.hex
├ STM32F10x_FWLib
│ ├ inc
│ │ │ misc.h
│ │ │ stm32f10x_adc.h
│ │ │ stm32f10x_bkp.h
│ │ │ stm32f10x_can.h
│ │ │ stm32f10x_cec.h
│ │ │ stm32f10x_crc.h
│ │ │ stm32f10x_dac.h
│ │ │ stm32f10x_dbgmcu.h
│ │ │ stm32f10x_dma.h
│ │ │ stm32f10x_exti.h
│ │ │ stm32f10x_flash.h
│ │ │ stm32f10x_fsmc.h
│ │ │ stm32f10x_gpio.h
│ │ │ stm32f10x_i2c.h
│ │ │ stm32f10x_iwdg.h
│ │ │ stm32f10x_pwr.h
│ │ │ stm32f10x_rcc.h
│ │ │ stm32f10x_rtc.h
│ │ │ stm32f10x_sdio.h
│ │ │ stm32f10x_spi.h
│ │ │ stm32f10x_tim.h
│ │ │ stm32f10x_usart.h
│ │ └ stm32f10x_wwdg.h
│ └ src
│ │ misc.c
│ │ stm32f10x_adc.c
│ │ stm32f10x_bkp.c
│ │ stm32f10x_can.c
│ │ stm32f10x_cec.c
│ │ stm32f10x_crc.c
│ │ stm32f10x_dac.c
│ │ stm32f10x_dbgmcu.c
│ │ stm32f10x_dma.c
│ │ stm32f10x_exti.c
│ │ stm32f10x_flash.c
│ │ stm32f10x_fsmc.c
│ │ stm32f10x_gpio.c
│ │ stm32f10x_i2c.c
│ │ stm32f10x_iwdg.c
│ │ stm32f10x_pwr.c
│ │ stm32f10x_rcc.c
│ │ stm32f10x_rtc.c
│ │ stm32f10x_sdio.c
│ │ stm32f10x_spi.c
│ │ stm32f10x_tim.c
│ │ stm32f10x_usart.c
│ └ stm32f10x_wwdg.c
├ SYSTEM
│ ├ delay
│ │ │ delay.c
│ │ └ delay.h
│ ├ sys
│ │ │ sys.c
│ │ └ sys.h
│ └ usart
│ │ usart.c
│ └ usart.h
└ USER
│ JLinkSettings.ini
│ LED.uvguix.A
│ LED.uvguix.Administrator
│ LED.uvoptx
│ LED.uvprojx
│ main.c
│ stm32f10x.h
│ stm32f10x_conf.h
│ stm32f10x_it.c
│ stm32f10x_it.h
│ system_stm32f10x.c
│ system_stm32f10x.h