STM32F407单片机16bit_DAC_AD5689模拟量(0V~10V)电压输出实验KEIL工程源码: int main(void) { uint16_t data=0; double temp,opa; /* 复位所有外设,初始化Flash接口和系统滴答定时器 */ HAL_Init(); /* 配置系统时钟 */ SystemClock_Config(); /* 初始化串口并配置串口中断优先级 */ MX_DEBUG_USART_Init(); KEY_GPIO_Init(); printf("硬石DAC(AD5689)模块模拟量电压输出测试\n"); AD5689_Init(); AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); printf("data:%d\n",data); opa=OPA_RES_R2/OPA_RES_R1; while(1) { if(KEY1_StateRead()==KEY_DOWN) { if(data>(0xFFFF-1000)) data=(0xFFFF-1000); data +=1000; AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); temp=(double)data*2500*opa/0xFFFF; //temp为目标电源值,这里先放大1000倍(方便计算而已),等后面显示再还原 //data是数字量DA值,当data取值为:0~0xFFFF对应AD5689输出为0~2.5V //本例程是输出0V~10V,这个功能主要是靠运放实现,特殊的电路使得: //AD5689输出0V时对应运放输出0V,AD5689输出2.5V对应运放输出10V //(上面虽说是10V,实际上应该是 2.5V*opa(运放放大倍数),这里opa=40.2K/10K=4.02) //所以使得程序:data值为0时运放输出0V,data为0xFFFF时输出运放输出10V //temp=data/0xFFFF*2.5*1000*opa printf("data:%d->%0.3fV\n",data,temp/1000); } if(KEY2_StateRead()==KEY_DOWN) { if(data%0.3fV\n",data,temp/1000); } HAL_Delay(50);
STM32F407单片机16bit_DAC_AD5689模拟量(-10V~10V)电压输出实验KEIL工程源码: int main(void) { uint16_t data=0xFFFF/2; double temp,opa; /* 复位所有外设,初始化Flash接口和系统滴答定时器 */ HAL_Init(); /* 配置系统时钟 */ SystemClock_Config(); /* 初始化串口并配置串口中断优先级 */ MX_DEBUG_USART_Init(); KEY_GPIO_Init(); printf("硬石DAC(AD5689)模块模拟量电压输出测试\n"); AD5689_Init(); AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); printf("data:%d\n",data); opa=OPA_RES_R2/OPA_RES_R1; while(1) { if(KEY1_StateRead()==KEY_DOWN) { if(data>(0xFFFF-1000)) data=(0xFFFF-1000); data +=1000; AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); temp=(double)(data*2-0xFFFF)*2500*opa/0xFFFF; //temp为目标电源值,这里先放大1000倍(方便计算而已),等后面显示再还原 //data是数字量DA值,当data取值为:0~0xFFFF对应AD5689输出为0~5V //本例程是输出-10V~10V,这个功能主要是靠运放实现,特殊的电路使得: //AD5689输出0V时对应运放输出-10V,AD5689输出2.5V对应运放输出0V,AD5689输出5V对应运放输出10V //(上面虽说是10V,实际上应该是 2.5V*opa(运放放大倍数),这里opa=40.2K/10K=4.02) //所以使得程序:data值为0时运放输出-10V, data为0xFFFF/2时输出运放输出0V,data为0xFFFF时输出运放输出10V //temp=(data-0xFFFF/2)/(0xFFFF/2)*2.5*1000*opa printf("data:%d->%0.3fV\n",data,temp/1000); } if(KEY2_StateRead()==KEY_DOWN) { if(data<1000) data=1000; data -=1000;
STM32F407单片机24bit_ADC_AD7190称重模块+16bit_DAC_电压输出实验KEIL工程源码 int main(void) { uint16_t data=0xFFFF/2; double temp,opa; float data_temp; int32_t weight_count; uint8_t cali_flag=0; /* 复位所有外设,初始化Flash接口和系统滴答定时器 */ HAL_Init(); /* 配置系统时钟 */ SystemClock_Config(); /* 初始化串口并配置串口中断优先级 */ MX_DEBUG_USART_Init(); /* 初始化LED */ LED_GPIO_Init(); KEY_GPIO_Init(); /* 初始化BEEP */ BEEP_GPIO_Init(); if(AD7190_Init()==0) { printf("获取不到 AD7190 !\n"); while(1) { HAL_Delay(1000); if(AD7190_Init()) break; } } printf("检测到 AD7190 !\n"); weight_ad7190_conf(); HAL_Delay(500); weight_Zero_Data = weight_ad7190_ReadAvg(6); printf("zero:%d\n",weight_Zero_Data); printf("硬石DAC(AD5689)模块模拟量电压输出\n"); AD5689_Init(); AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); printf("data:%d\n",data); opa=OPA_RES_R2/OPA_RES_R1; while(1) { weight_count=weight_ad7190_ReadAvg(3); data_temp=weight_count-weight_Zero_Data; weight=data_temp*1000/weight_proportion; printf("重量:%d->%.2f\n",weight_count,weight); HAL_Delay(200); if(KEY1_StateRead()==KEY_DOWN) // 清零 { weight_Zero_Data = weight_ad7190_ReadAvg(6); printf("zero:%d\n",weight_Zero_Data); cali_flag=1; } if(KEY2_StateRead()==KEY_DOWN) // 校准:必须先按“清零”键,然后把20g砝码放在称上,按下校准键 { if(cali_flag) { weight_count = weight_ad7190_ReadAvg(6); weight_proportion=(weight_count-weight_Zero_Data)*1000/100; printf("weight_proportion:%d\n",weight_proportion); } cali_flag=0; } if(KEY3_StateRead()==KEY_DOWN) { if(data>(0xFFFF-1000)) data=(0xFFFF-1000); data +=1000; AD5689_WriteUpdate_DACREG(DAC_A,data); AD5689_WriteUpdate_DACREG(DAC_B,0xFFFF-data); temp=(double)(data*2-0xFFFF)*2500*opa/0xFFFF; //temp为目标电源值,这里先放大1000倍(方便计算而已),等后面显示再还原 //data是数字量DA值,当data取值
感谢博客主(https://blog.csdn.net/nicekwell)提供ISP相关扫盲 文章:https://blog.csdn.net/nicekwell/article/details/79093780 https://github.com/nicekwell/stm32ISP 本人参考文章,STM32ISP手册以及配合逻辑分析仪编写!, 基于STM32F407编写的ISP主机端代码(USART奇偶校验位:偶校验) 已经亲测实现了对STM32F103的代码烧录 内部容易移植,仅需移植IO口以及USART部分就可以使用 内部提供简单的示例代码
2021-09-07 17:18:11 4KB STM32 ISP
1
TJC8048T070串口触摸屏资料+STM32F407IGT6单片机串口触摸屏实验例程7个合集KEIL工程源码+文档说明 101. 串口屏控制步进电机旋转.rar 102. 串口屏控制步进电机循环运行.rar 103. 串口屏控制LED灯.rar 104. 串口屏密码设定.rar 105. 串口屏控制步进电机旋转(点控).rar 106. 串口屏控制步进电机循环多选.rar 107. 串口屏电子秤.rar 串口屏资料.rar
已调试成功,可以实现读写U盘数据,系统用FreeRTOS,用STM32CubeMX生成的代码,ioc文件也在
2021-09-07 00:03:39 52.26MB 407 usbhost freertos stm32
1
STM32F407单片机开发板PDF原理图+器件AD集成封装库+主要器件技术手册: 集成封装库器件: Library Component Count : 49 Name Description ---------------------------------------------------------------------------------------------------- BAT54C BAT54C/KL3 BATTERY Battery CH340G Cap Capacitor Cap Pol Polarized Capacitor (Radial) DB9 DHT11&DS18B20 humiture sensor DIODE Diode DIODE SCHOTTKY Schottky Diode Fuse1 HC-05 HC-05_BLUETOOTH HCPL-2630/2631 SMT Dual Channel High Speed 10 MB/s Logic Gate Optocoupler HR911105A HR911105A Header 12X2 Header, 12-Pin, Dual row Header 15X2 Header, 15-Pin, Dual row Header 2X2 Header, 2-Pin, Dual row Header 3 Header, 3-Pin Header 4 Header, 4-Pin Header 4X2 Header, 4-Pin, Dual row Header 5 Header, 5-Pin Header 6 Header, 6-Pin Header 7 Header, 7-Pin Header 8 Header, 8-Pin Inductance Inductance2 Jumper3 LAN8720AI-CP-TR ETH PHY LD1117 LDO LED PR9 LM2596S-5.0 DC DC 5V NPN Optoisolator PC817 POWER2.5 Low Voltage Power Supply Connector Res1 Resistor SN65HVD230 CAN SP3232 SP3485 STM32F407IGT6 STM32 Series 32-bit 1 MB Flash 192 kB RAM ARM Based Microcontroller - LQFP-176 SW PUSHBUTTON SE PUSHBUTTON SW-Power Speaker TLP291-4 Photocouplers GaAs Infrared LED & Photo Transistor Trans Cupl Transformer (Coupled Inductor Model) USB_AF USB_A side USB_MINIB_SMT MiniUSB W25Q128FV XTAL_2Pin Crystal Oscillator XTAL_4Pin_NOSOURCE 器件手册资料: 【3.3V电源稳压】LD1117DT33CTR.pdf 【5V电源稳压】LM2596S-5.0.pdf 【CAN收发器3.3V】SN65HVD230DR.pdf 【RS232通讯】SP3232.pdf 【RS485】SP3072EEN-L.pdf 【USB接口】USB-AF侧插铜.pdf 【USB转串口】CH340G.pdf 【三极管】S8050.pdf 【三极管】S8550.pdf 【串行Flash】W25Q128F
使用RTO模式;包括IO口输入输出;SPI操作;ADC采用DMA方式 ;DAC采用DMA方式,可以产生三角波或据齿波;UART采用DMA方式;CAN采用中断方式;和普通定时器
2021-09-06 17:08:44 7.86MB STM32F407
1
stm32f4系列的使用手册, 对应型号为 stm32f405-415, stm32f407-417, stm32f427-437, stm32f429-439, 英文
2021-09-06 13:08:05 21.49MB stm32 stm32f4 stm32f407
1
STM32F407VET6开发板电路图, STM32F407 Black Board
2021-09-06 13:08:05 1.24MB stm32 stm32f4 stm32f407
1