2021-09-25 14:52:39 索炜达电子 1758
项目编号:E1303
文件大小:4.5M
源码说明:带中文注释
开发环境:C编译器
简要概述:
一、准备材料
1.STM32F103C8T6最小系统板;
2.HLW8032电参数采集模块;
3.OLCD 0.96寸显示屏,用的是IIC的驱动方式;
4.ST-Link下载器,用其他下载器也可以,有啥用啥;
5.11根杜邦线,1根220V的电源线;
二、接线
三、下载程序
把上面接好的ST-Link下载器,插入电脑;打开提供的代码程序,然后点击下载即可:
四、接入220V交流电
烧录完程序后,如果接线正确,这个时候0.96寸的显示屏就会显示Knight20字样了,但是还不会有电参数显示,因为还没接入220V交流电。
注:HLW8032模块需要接了220V的交流后,才会进行工作并输出数据!
把准备好的电源线,接到HLW8032的IN接线端子上:
通电后就这样子了:
目录│文件列表:
└ STM32F103C8T6驱动HLW8032
│ keilkilll.bat
│ README.TXT
├ CORE
│ │ core_cm3.c
│ │ core_cm3.h
│ │ startup_stm32f10x_hd.s
│ └ startup_stm32f10x_md.s
├ HARDWARE
│ ├ IIC
│ │ │ myiic.c
│ │ └ myiic.h
│ ├ IO
│ │ ├ EXTI
│ │ │ │ EXTI.c
│ │ │ └ EXTI.h
│ │ └ LED
│ │ │ LED.c
│ │ └ LED.h
│ ├ KEY
│ │ │ key.c
│ │ └ key.h
│ ├ M5311
│ │ │ M5311.c
│ │ └ M5311.h
│ ├ OLED
│ │ │ bmp.h
│ │ │ codetab.h
│ │ │ oled.c
│ │ └ oled.h
│ ├ TIMER
│ │ │ timer.c
│ │ └ timer.h
│ ├ USART2
│ │ │ usart2.c
│ │ └ usart2.h
│ └ USART3
│ │ usart3.c
│ └ usart3.h
├ OBJ
│ │ a9g.crf
│ │ a9g.d
│ │ a9g.o
│ │ adxl345.crf
│ │ adxl345.d
│ │ adxl345.o
│ │ apds_9960.crf
│ │ apds_9960.d
│ │ apds_9960.o
│ │ core_cm3.crf
│ │ core_cm3.d
│ │ core_cm3.o
│ │ delay.crf
│ │ delay.d
│ │ delay.o
│ │ ExtDll.iex
│ │ exti.crf
│ │ exti.d
│ │ exti.o
│ │ gps.crf
│ │ gps.d
│ │ gps.o
│ │ key.crf
│ │ key.d
│ │ key.o
│ │ led.crf
│ │ led.d
│ │ led.o
│ │ m5311.crf
│ │ m5311.d
│ │ m5311.o
│ │ main.crf
│ │ main.d
│ │ main.o
│ │ misc.crf
│ │ misc.d
│ │ misc.o
│ │ myiic.crf
│ │ myiic.d
│ │ myiic.o
│ │ oled.crf
│ │ oled.d
│ │ oled.o
│ │ startup_stm32f10x_hd.d
│ │ startup_stm32f10x_hd.o
│ │ startup_stm32f10x_md.d
│ │ startup_stm32f10x_md.o
│ │ stm32f10x_dma.crf
│ │ stm32f10x_dma.d
│ │ stm32f10x_dma.o
│ │ stm32f10x_exti.crf
│ │ stm32f10x_exti.d
│ │ stm32f10x_exti.o
│ │ stm32f10x_gpio.crf
│ │ stm32f10x_gpio.d
│ │ stm32f10x_gpio.o
│ │ stm32f10x_it.crf
│ │ stm32f10x_it.d
│ │ stm32f10x_it.o
│ │ stm32f10x_rcc.crf
│ │ stm32f10x_rcc.d
│ │ stm32f10x_rcc.o
│ │ stm32f10x_sdio.crf
│ │ stm32f10x_sdio.d
│ │ stm32f10x_sdio.o
│ │ stm32f10x_tim.crf
│ │ stm32f10x_tim.d
│ │ stm32f10x_tim.o
│ │ stm32f10x_usart.crf
│ │ stm32f10x_usart.d
│ │ stm32f10x_usart.o
│ │ sys.crf
│ │ sys.d
│ │ sys.o
│ │ system_stm32f10x.crf
│ │ system_stm32f10x.d
│ │ system_stm32f10x.o
│ │ Template.axf
│ │ Template.build_log.htm
│ │ Template.hex
│ │ Template.htm
│ │ Template.lnp
│ │ Template_Template.dep
│ │ timer.crf
│ │ timer.d
│ │ timer.o
│ │ usart.crf
│ │ usart.d
│ │ usart.o
│ │ usart2.crf
│ │ usart2.d
│ │ usart2.o
│ │ usart3.crf
│ │ usart3.d
│ └ usart3.o
├ 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
│ JLinkLog.txt
│ JLinkSettings.ini
│ main.c
│ stm32f10x.h
│ stm32f10x_conf.h
│ stm32f10x_it.c
│ stm32f10x_it.h
│ system_stm32f10x.c
│ system_stm32f10x.h
│ Template.uvguix.Administrator
│ Template.uvguix.Zoeray
│ Template.uvguix_Administrator.bak
│ Template.uvoptx
│ Template.uvprojx
│ Template_Template.dep
│ Template_uvoptx.bak
│ Template_uvprojx.bak
├ DebugConfig
│ │ Template_STM32F103C8.dbgconf
│ │ Template_STM32F103C8_1.0.0.dbgconf
│ │ Template_STM32F103RC.dbgconf
│ │ Template_STM32F103RC_1.0.0.dbgconf
│ └ Template_STM32F103ZE_1.0.0.dbgconf
├ Listings
│ │ startup_stm32f10x_hd.lst
│ │ startup_stm32f10x_md.lst
│ └ Template.map