diff --git a/Project Backups/schem [20260325, 15-33-14].pdsprj b/Project Backups/schem [20260325, 15-33-14].pdsprj
new file mode 100644
index 0000000..8f72c3a
Binary files /dev/null and b/Project Backups/schem [20260325, 15-33-14].pdsprj differ
diff --git a/Project Backups/schem [Autosaved].pdsprj b/Project Backups/schem [Autosaved].pdsprj
index 692609a..d9f5507 100644
Binary files a/Project Backups/schem [Autosaved].pdsprj and b/Project Backups/schem [Autosaved].pdsprj differ
diff --git a/john103C6T6NewVer/.mxproject b/john103C6T6NewVer/.mxproject
index 3a9567a..60d4b27 100644
--- a/john103C6T6NewVer/.mxproject
+++ b/john103C6T6NewVer/.mxproject
@@ -1,37 +1,35 @@
[PreviousLibFiles]
-LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rtc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rtc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rtc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rtc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rtc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rtc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
+LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_adc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_adc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_i2c.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_uart.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103xb.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
[PreviousUsedKeilFiles]
-SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\adc.c;..\Core\Src\i2c.c;..\Core\Src\rtc.c;..\Core\Src\tim.c;..\Core\Src\usart.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Core\Src\stm32f1xx_hal_timebase_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rtc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;;
+SourceFiles=..\Core\Src\main.c;..\Core\Src\gpio.c;..\Core\Src\adc.c;..\Core\Src\i2c.c;..\Core\Src\tim.c;..\Core\Src\usart.c;..\Core\Src\stm32f1xx_it.c;..\Core\Src\stm32f1xx_hal_msp.c;..\Core\Src\stm32f1xx_hal_timebase_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_adc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_i2c.c;..\Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;..\Core\Src\system_stm32f1xx.c;;;
HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Core\Inc;
CDefines=USE_HAL_DRIVER;STM32F103xB;USE_HAL_DRIVER;USE_HAL_DRIVER;
[PreviousGenFiles]
AdvancedFolderStructure=true
-HeaderFileListSize=9
+HeaderFileListSize=8
HeaderFiles#0=..\Core\Inc\gpio.h
HeaderFiles#1=..\Core\Inc\adc.h
HeaderFiles#2=..\Core\Inc\i2c.h
-HeaderFiles#3=..\Core\Inc\rtc.h
-HeaderFiles#4=..\Core\Inc\tim.h
-HeaderFiles#5=..\Core\Inc\usart.h
-HeaderFiles#6=..\Core\Inc\stm32f1xx_it.h
-HeaderFiles#7=..\Core\Inc\stm32f1xx_hal_conf.h
-HeaderFiles#8=..\Core\Inc\main.h
+HeaderFiles#3=..\Core\Inc\tim.h
+HeaderFiles#4=..\Core\Inc\usart.h
+HeaderFiles#5=..\Core\Inc\stm32f1xx_it.h
+HeaderFiles#6=..\Core\Inc\stm32f1xx_hal_conf.h
+HeaderFiles#7=..\Core\Inc\main.h
HeaderFolderListSize=1
HeaderPath#0=..\Core\Inc
HeaderFiles=;
-SourceFileListSize=10
+SourceFileListSize=9
SourceFiles#0=..\Core\Src\gpio.c
SourceFiles#1=..\Core\Src\adc.c
SourceFiles#2=..\Core\Src\i2c.c
-SourceFiles#3=..\Core\Src\rtc.c
-SourceFiles#4=..\Core\Src\tim.c
-SourceFiles#5=..\Core\Src\usart.c
-SourceFiles#6=..\Core\Src\stm32f1xx_it.c
-SourceFiles#7=..\Core\Src\stm32f1xx_hal_msp.c
-SourceFiles#8=..\Core\Src\stm32f1xx_hal_timebase_tim.c
-SourceFiles#9=..\Core\Src\main.c
+SourceFiles#3=..\Core\Src\tim.c
+SourceFiles#4=..\Core\Src\usart.c
+SourceFiles#5=..\Core\Src\stm32f1xx_it.c
+SourceFiles#6=..\Core\Src\stm32f1xx_hal_msp.c
+SourceFiles#7=..\Core\Src\stm32f1xx_hal_timebase_tim.c
+SourceFiles#8=..\Core\Src\main.c
SourceFolderListSize=1
SourcePath#0=..\Core\Src
SourceFiles=;
diff --git a/john103C6T6NewVer/Core/Inc/main.h b/john103C6T6NewVer/Core/Inc/main.h
index 1f42a55..d1b7673 100644
--- a/john103C6T6NewVer/Core/Inc/main.h
+++ b/john103C6T6NewVer/Core/Inc/main.h
@@ -48,9 +48,9 @@ extern "C" {
#define MODBUS_REG_ORDER_BE 0
#define MODBUS_REG_ORDER_LE 1
-
-
-
+#define USE_USART USART_1
+#define USART1_PA6_PA7
+//#define USART1_PA9_PA10
typedef enum
diff --git a/john103C6T6NewVer/Core/Inc/rtc.h b/john103C6T6NewVer/Core/Inc/rtc.h
deleted file mode 100644
index 2b87ae5..0000000
--- a/john103C6T6NewVer/Core/Inc/rtc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* USER CODE BEGIN Header */
-/**
- ******************************************************************************
- * @file rtc.h
- * @brief This file contains all the function prototypes for
- * the rtc.c file
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2025 STMicroelectronics.
- * All rights reserved.
- *
- * This software is licensed under terms that can be found in the LICENSE file
- * in the root directory of this software component.
- * If no LICENSE file comes with this software, it is provided AS-IS.
- *
- ******************************************************************************
- */
-/* USER CODE END Header */
-/* Define to prevent recursive inclusion -------------------------------------*/
-#ifndef __RTC_H__
-#define __RTC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Includes ------------------------------------------------------------------*/
-#include "main.h"
-
-/* USER CODE BEGIN Includes */
-
-/* USER CODE END Includes */
-
-extern RTC_HandleTypeDef hrtc;
-
-/* USER CODE BEGIN Private defines */
-
-/* USER CODE END Private defines */
-
-void MX_RTC_Init(void);
-
-/* USER CODE BEGIN Prototypes */
-
-/* USER CODE END Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __RTC_H__ */
-
diff --git a/john103C6T6NewVer/Core/Inc/stm32f1xx_hal_conf.h b/john103C6T6NewVer/Core/Inc/stm32f1xx_hal_conf.h
index f53872d..7b9ff09 100644
--- a/john103C6T6NewVer/Core/Inc/stm32f1xx_hal_conf.h
+++ b/john103C6T6NewVer/Core/Inc/stm32f1xx_hal_conf.h
@@ -57,7 +57,7 @@
/*#define HAL_HCD_MODULE_ENABLED */
/*#define HAL_PWR_MODULE_ENABLED */
/*#define HAL_RCC_MODULE_ENABLED */
-#define HAL_RTC_MODULE_ENABLED
+/*#define HAL_RTC_MODULE_ENABLED */
/*#define HAL_SD_MODULE_ENABLED */
/*#define HAL_MMC_MODULE_ENABLED */
/*#define HAL_SDRAM_MODULE_ENABLED */
diff --git a/john103C6T6NewVer/Core/Inc/stm32f1xx_it.h b/john103C6T6NewVer/Core/Inc/stm32f1xx_it.h
index 74b3e47..2402525 100644
--- a/john103C6T6NewVer/Core/Inc/stm32f1xx_it.h
+++ b/john103C6T6NewVer/Core/Inc/stm32f1xx_it.h
@@ -55,7 +55,6 @@ void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
-void RTC_IRQHandler(void);
void TIM1_BRK_IRQHandler(void);
void TIM1_UP_IRQHandler(void);
void TIM1_TRG_COM_IRQHandler(void);
@@ -63,6 +62,7 @@ void TIM1_CC_IRQHandler(void);
void TIM2_IRQHandler(void);
void TIM3_IRQHandler(void);
void USART1_IRQHandler(void);
+void USART2_IRQHandler(void);
/* USER CODE BEGIN EFP */
/* USER CODE END EFP */
diff --git a/john103C6T6NewVer/Core/Inc/usart.h b/john103C6T6NewVer/Core/Inc/usart.h
index 10c6193..737091e 100644
--- a/john103C6T6NewVer/Core/Inc/usart.h
+++ b/john103C6T6NewVer/Core/Inc/usart.h
@@ -34,11 +34,14 @@ extern "C" {
extern UART_HandleTypeDef huart1;
+extern UART_HandleTypeDef huart2;
+
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_USART1_UART_Init(void);
+void MX_USART2_UART_Init(void);
/* USER CODE BEGIN Prototypes */
diff --git a/john103C6T6NewVer/Core/Src/dallas_tools.c b/john103C6T6NewVer/Core/Src/dallas_tools.c
index a0b7946..bbbabc5 100644
--- a/john103C6T6NewVer/Core/Src/dallas_tools.c
+++ b/john103C6T6NewVer/Core/Src/dallas_tools.c
@@ -205,27 +205,34 @@ HAL_StatusTypeDef Dallas_StartConvertTAll(DALLAS_HandleTypeDef *hdallas, DALLAS_
{
uint32_t delayValueMs = 0;
- switch (dallas_delay_ms)
- {
- case DALLAS_CONFIG_9_BITS:
- delayValueMs = DALLAS_DELAY_MS_9_BITS;
- break;
+ if(!dallas_delay_ms)
+ {
+ switch (hdallas->scratchpad.ConfigRegister)
+ {
+ case DALLAS_CONFIG_9_BITS:
+ delayValueMs = DALLAS_DELAY_MS_9_BITS;
+ break;
- case DALLAS_CONFIG_10_BITS:
- delayValueMs = DALLAS_DELAY_MS_10_BITS;
- break;
+ case DALLAS_CONFIG_10_BITS:
+ delayValueMs = DALLAS_DELAY_MS_10_BITS;
+ break;
- case DALLAS_CONFIG_11_BITS:
- delayValueMs = DALLAS_DELAY_MS_11_BITS;
- break;
+ case DALLAS_CONFIG_11_BITS:
+ delayValueMs = DALLAS_DELAY_MS_11_BITS;
+ break;
- case DALLAS_CONFIG_12_BITS:
- delayValueMs = DALLAS_DELAY_MS_12_BITS;
- break;
+ case DALLAS_CONFIG_12_BITS:
+ delayValueMs = DALLAS_DELAY_MS_12_BITS;
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
+ }
+ else
+ {
+ delayValueMs = dallas_delay_ms;
+ }
HAL_Delay(delayValueMs);
}
diff --git a/john103C6T6NewVer/Core/Src/gpio.c b/john103C6T6NewVer/Core/Src/gpio.c
index 597e8c4..23399cd 100644
--- a/john103C6T6NewVer/Core/Src/gpio.c
+++ b/john103C6T6NewVer/Core/Src/gpio.c
@@ -54,8 +54,8 @@ void MX_GPIO_Init(void)
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_13, GPIO_PIN_SET);
/*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4
- |GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7|One_wire_Pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
+ |One_wire_Pin, GPIO_PIN_RESET);
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_10
@@ -74,10 +74,10 @@ void MX_GPIO_Init(void)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /*Configure GPIO pins : PA1 PA2 PA3 PA4
- PA5 PA6 PA7 One_wire_Pin */
- GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4
- |GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7|One_wire_Pin;
+ /*Configure GPIO pins : PA1 PA5 PA6 PA7
+ One_wire_Pin */
+ GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
+ |One_wire_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
diff --git a/john103C6T6NewVer/Core/Src/main.c b/john103C6T6NewVer/Core/Src/main.c
index 30fd375..720975c 100644
--- a/john103C6T6NewVer/Core/Src/main.c
+++ b/john103C6T6NewVer/Core/Src/main.c
@@ -20,7 +20,6 @@
#include "main.h"
#include "adc.h"
#include "i2c.h"
-#include "rtc.h"
#include "tim.h"
#include "usart.h"
#include "gpio.h"
@@ -133,9 +132,44 @@ int main(void)
MX_TIM2_Init();
MX_ADC1_Init();
MX_I2C1_Init();
-
- // MX_RTC_Init();
+ MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
+// #ifdef USART1_PA6_PA7
+// HAL_UART_DeInit(&huart1);
+// GPIO_InitTypeDef GPIO_InitStruct = {0};
+//
+// /* USER CODE BEGIN USART1_MspInit 0 */
+
+// /* USER CODE END USART1_MspInit 0 */
+// /* USART1 clock enable */
+// __HAL_RCC_USART1_CLK_ENABLE();
+
+// __HAL_RCC_GPIOB_CLK_ENABLE();
+// /**USART1 GPIO Configuration
+// PA9 ------> USART1_TX
+// PA10 ------> USART1_RX
+// */
+// GPIO_InitStruct.Pin = GPIO_PIN_6;
+// GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+// GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+// GPIO_InitStruct.Pin = GPIO_PIN_7;
+// GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+// GPIO_InitStruct.Pull = GPIO_NOPULL;
+// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+// /* USART1 interrupt Init */
+// HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
+// HAL_NVIC_EnableIRQ(USART1_IRQn);
+//
+//
+//
+// if (HAL_UART_Init(&huart1) != HAL_OK)
+// {
+// Error_Handler();
+// }
+// #endif
LED_BlinkRx_Config_t led_rx =
{
.port = GPIOC,
@@ -221,7 +255,7 @@ int main(void)
static uint16_t dataLE[2];
uint32_t start_dwt = get_cycle_count();
uint32_t start = HAL_GetTick();
- Dallas_StartConvertTAll(&hdallas, DALLAS_WAIT_NONE, 0);
+ Dallas_StartConvertTAll(&hdallas, DALLAS_WAIT_DELAY, 200);
uint32_t end_dwt = get_cycle_count();
uint32_t end = HAL_GetTick();
uint32_t time_DWT=end_dwt-start_dwt;
@@ -281,11 +315,10 @@ void SystemClock_Config(void)
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE;
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
- RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
@@ -307,8 +340,7 @@ void SystemClock_Config(void)
{
Error_Handler();
}
- PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC|RCC_PERIPHCLK_ADC;
- PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSI;
+ PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
diff --git a/john103C6T6NewVer/Core/Src/rtc.c b/john103C6T6NewVer/Core/Src/rtc.c
deleted file mode 100644
index 1db9f29..0000000
--- a/john103C6T6NewVer/Core/Src/rtc.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/* USER CODE BEGIN Header */
-/**
- ******************************************************************************
- * @file rtc.c
- * @brief This file provides code for the configuration
- * of the RTC instances.
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2025 STMicroelectronics.
- * All rights reserved.
- *
- * This software is licensed under terms that can be found in the LICENSE file
- * in the root directory of this software component.
- * If no LICENSE file comes with this software, it is provided AS-IS.
- *
- ******************************************************************************
- */
-/* USER CODE END Header */
-/* Includes ------------------------------------------------------------------*/
-#include "rtc.h"
-
-/* USER CODE BEGIN 0 */
-
-/* USER CODE END 0 */
-
-RTC_HandleTypeDef hrtc;
-
-/* RTC init function */
-void MX_RTC_Init(void)
-{
-
- /* USER CODE BEGIN RTC_Init 0 */
-
- /* USER CODE END RTC_Init 0 */
-
- RTC_TimeTypeDef sTime = {0};
- RTC_DateTypeDef DateToUpdate = {0};
-
- /* USER CODE BEGIN RTC_Init 1 */
-
- /* USER CODE END RTC_Init 1 */
-
- /** Initialize RTC Only
- */
- hrtc.Instance = RTC;
- hrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND;
- hrtc.Init.OutPut = RTC_OUTPUTSOURCE_SECOND;
- if (HAL_RTC_Init(&hrtc) != HAL_OK)
- {
- Error_Handler();
- }
-
- /* USER CODE BEGIN Check_RTC_BKUP */
-
- /* USER CODE END Check_RTC_BKUP */
-
- /** Initialize RTC and set the Time and Date
- */
- sTime.Hours = 0x0;
- sTime.Minutes = 0x0;
- sTime.Seconds = 0x0;
-
- if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
- {
- Error_Handler();
- }
- DateToUpdate.WeekDay = RTC_WEEKDAY_MONDAY;
- DateToUpdate.Month = RTC_MONTH_JANUARY;
- DateToUpdate.Date = 0x1;
- DateToUpdate.Year = 0x0;
-
- if (HAL_RTC_SetDate(&hrtc, &DateToUpdate, RTC_FORMAT_BCD) != HAL_OK)
- {
- Error_Handler();
- }
- /* USER CODE BEGIN RTC_Init 2 */
-
- /* USER CODE END RTC_Init 2 */
-
-}
-
-void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle)
-{
-
- if(rtcHandle->Instance==RTC)
- {
- /* USER CODE BEGIN RTC_MspInit 0 */
-
- /* USER CODE END RTC_MspInit 0 */
- HAL_PWR_EnableBkUpAccess();
- /* Enable BKP CLK enable for backup registers */
- __HAL_RCC_BKP_CLK_ENABLE();
- /* RTC clock enable */
- __HAL_RCC_RTC_ENABLE();
-
- /* RTC interrupt Init */
- HAL_NVIC_SetPriority(RTC_IRQn, 0, 0);
- HAL_NVIC_EnableIRQ(RTC_IRQn);
- /* USER CODE BEGIN RTC_MspInit 1 */
-
- /* USER CODE END RTC_MspInit 1 */
- }
-}
-
-void HAL_RTC_MspDeInit(RTC_HandleTypeDef* rtcHandle)
-{
-
- if(rtcHandle->Instance==RTC)
- {
- /* USER CODE BEGIN RTC_MspDeInit 0 */
-
- /* USER CODE END RTC_MspDeInit 0 */
- /* Peripheral clock disable */
- __HAL_RCC_RTC_DISABLE();
-
- /* RTC interrupt Deinit */
- HAL_NVIC_DisableIRQ(RTC_IRQn);
- /* USER CODE BEGIN RTC_MspDeInit 1 */
-
- /* USER CODE END RTC_MspDeInit 1 */
- }
-}
-
-/* USER CODE BEGIN 1 */
-
-/* USER CODE END 1 */
diff --git a/john103C6T6NewVer/Core/Src/stm32f1xx_it.c b/john103C6T6NewVer/Core/Src/stm32f1xx_it.c
index 44966ce..8122531 100644
--- a/john103C6T6NewVer/Core/Src/stm32f1xx_it.c
+++ b/john103C6T6NewVer/Core/Src/stm32f1xx_it.c
@@ -62,10 +62,10 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
-extern RTC_HandleTypeDef hrtc;
extern TIM_HandleTypeDef htim1;
extern TIM_HandleTypeDef htim2;
extern UART_HandleTypeDef huart1;
+extern UART_HandleTypeDef huart2;
extern TIM_HandleTypeDef htim3;
/* USER CODE BEGIN EV */
@@ -210,20 +210,6 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32f1xx.s). */
/******************************************************************************/
-/**
- * @brief This function handles RTC global interrupt.
- */
-void RTC_IRQHandler(void)
-{
- /* USER CODE BEGIN RTC_IRQn 0 */
-
- /* USER CODE END RTC_IRQn 0 */
- HAL_RTCEx_RTCIRQHandler(&hrtc);
- /* USER CODE BEGIN RTC_IRQn 1 */
-
- /* USER CODE END RTC_IRQn 1 */
-}
-
/**
* @brief This function handles TIM1 break interrupt.
*/
@@ -320,7 +306,9 @@ static uint8_t first_in=1;
void USART1_IRQHandler(void)
{
/* USER CODE BEGIN USART1_IRQn 0 */
- RS_UART_Handler(&hmodbus1);
+ #if (USE_USART== USART_1)
+ RS_UART_Handler(&hmodbus1);
+ #endif
@@ -334,6 +322,24 @@ void USART1_IRQHandler(void)
/* USER CODE END USART1_IRQn 1 */
}
+/**
+ * @brief This function handles USART2 global interrupt.
+ */
+void USART2_IRQHandler(void)
+{
+ /* USER CODE BEGIN USART2_IRQn 0 */
+ #if (USE_USART== USART_2)
+ RS_UART_Handler(&hmodbus1);
+ #endif
+
+
+ /* USER CODE END USART2_IRQn 0 */
+ HAL_UART_IRQHandler(&huart2);
+ /* USER CODE BEGIN USART2_IRQn 1 */
+
+ /* USER CODE END USART2_IRQn 1 */
+}
+
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
diff --git a/john103C6T6NewVer/Core/Src/usart.c b/john103C6T6NewVer/Core/Src/usart.c
index 745c288..53a8def 100644
--- a/john103C6T6NewVer/Core/Src/usart.c
+++ b/john103C6T6NewVer/Core/Src/usart.c
@@ -25,6 +25,7 @@
/* USER CODE END 0 */
UART_HandleTypeDef huart1;
+UART_HandleTypeDef huart2;
/* USART1 init function */
@@ -54,6 +55,35 @@ void MX_USART1_UART_Init(void)
/* USER CODE END USART1_Init 2 */
+}
+/* USART2 init function */
+
+void MX_USART2_UART_Init(void)
+{
+
+ /* USER CODE BEGIN USART2_Init 0 */
+
+ /* USER CODE END USART2_Init 0 */
+
+ /* USER CODE BEGIN USART2_Init 1 */
+
+ /* USER CODE END USART2_Init 1 */
+ huart2.Instance = USART2;
+ huart2.Init.BaudRate = 115200;
+ huart2.Init.WordLength = UART_WORDLENGTH_8B;
+ huart2.Init.StopBits = UART_STOPBITS_1;
+ huart2.Init.Parity = UART_PARITY_NONE;
+ huart2.Init.Mode = UART_MODE_TX_RX;
+ huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
+ huart2.Init.OverSampling = UART_OVERSAMPLING_16;
+ if (HAL_UART_Init(&huart2) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN USART2_Init 2 */
+
+ /* USER CODE END USART2_Init 2 */
+
}
void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
@@ -68,20 +98,22 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
/* USART1 clock enable */
__HAL_RCC_USART1_CLK_ENABLE();
- __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
/**USART1 GPIO Configuration
- PA9 ------> USART1_TX
- PA10 ------> USART1_RX
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
*/
- GPIO_InitStruct.Pin = GPIO_PIN_9;
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
- GPIO_InitStruct.Pin = GPIO_PIN_10;
+ GPIO_InitStruct.Pin = GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ __HAL_AFIO_REMAP_USART1_ENABLE();
/* USART1 interrupt Init */
HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
@@ -90,6 +122,36 @@ void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
/* USER CODE END USART1_MspInit 1 */
}
+ else if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspInit 0 */
+
+ /* USER CODE END USART2_MspInit 0 */
+ /* USART2 clock enable */
+ __HAL_RCC_USART2_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_2;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_3;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* USART2 interrupt Init */
+ HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
+ HAL_NVIC_EnableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspInit 1 */
+
+ /* USER CODE END USART2_MspInit 1 */
+ }
}
void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
@@ -104,10 +166,10 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
__HAL_RCC_USART1_CLK_DISABLE();
/**USART1 GPIO Configuration
- PA9 ------> USART1_TX
- PA10 ------> USART1_RX
+ PB6 ------> USART1_TX
+ PB7 ------> USART1_RX
*/
- HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
+ HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
/* USART1 interrupt Deinit */
HAL_NVIC_DisableIRQ(USART1_IRQn);
@@ -115,6 +177,26 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
/* USER CODE END USART1_MspDeInit 1 */
}
+ else if(uartHandle->Instance==USART2)
+ {
+ /* USER CODE BEGIN USART2_MspDeInit 0 */
+
+ /* USER CODE END USART2_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_USART2_CLK_DISABLE();
+
+ /**USART2 GPIO Configuration
+ PA2 ------> USART2_TX
+ PA3 ------> USART2_RX
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
+
+ /* USART2 interrupt Deinit */
+ HAL_NVIC_DisableIRQ(USART2_IRQn);
+ /* USER CODE BEGIN USART2_MspDeInit 1 */
+
+ /* USER CODE END USART2_MspDeInit 1 */
+ }
}
/* USER CODE BEGIN 1 */
diff --git a/john103C6T6NewVer/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c b/john103C6T6NewVer/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
index 519a82f..b7cf66c 100644
--- a/john103C6T6NewVer/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
+++ b/john103C6T6NewVer/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c
@@ -257,7 +257,6 @@
/* Includes ------------------------------------------------------------------*/
#include "stm32f1xx_hal.h"
-
/** @addtogroup STM32F1xx_HAL_Driver
* @{
*/
@@ -2363,8 +2362,6 @@ void HAL_UART_IRQHandler(UART_HandleTypeDef *huart)
/* UART in mode Receiver -------------------------------------------------*/
if (((isrflags & USART_SR_RXNE) != RESET) && ((cr1its & USART_CR1_RXNEIE) != RESET))
{
-
-
UART_Receive_IT(huart);
return;
}
diff --git a/john103C6T6NewVer/MDK-ARM/john103C6T6.uvoptx b/john103C6T6NewVer/MDK-ARM/john103C6T6.uvoptx
index 9af9e4d..4cde529 100644
--- a/john103C6T6NewVer/MDK-ARM/john103C6T6.uvoptx
+++ b/john103C6T6NewVer/MDK-ARM/john103C6T6.uvoptx
@@ -152,82 +152,98 @@
0
0
- 109
+ 114
1
- 0
+ 134248298
0
0
0
0
0
- 0
- ..\Core\Inc\main.h
+ 1
+ ../Core/Src/main.c
-
+ \\john103C6T6\../Core/Src/main.c\114
1
0
- 37
+ 105
1
- 0
+ 134248288
0
0
0
0
0
- 0
- ..\EEPROM_Emul\src\flash_ring.c
+ 1
+ ../Core/Src/main.c
-
+ \\john103C6T6\../Core/Src/main.c\105
2
0
- 139
+ 121
1
- 0
+ 134248302
0
0
0
0
0
- 0
+ 1
../Core/Src/main.c
-
+ \\john103C6T6\../Core/Src/main.c\121
3
0
- 199
+ 129
1
- 0
+ 134248306
0
0
0
0
0
- 0
+ 1
../Core/Src/main.c
-
+ \\john103C6T6\../Core/Src/main.c\129
4
0
- 191
+ 130
1
- 0
+ 134248310
0
0
0
0
0
- 0
+ 1
../Core/Src/main.c
-
+ \\john103C6T6\../Core/Src/main.c\130
+
+
+ 5
+ 0
+ 132
+ 1
+ 134248318
+ 0
+ 0
+ 0
+ 0
+ 0
+ 1
+ ../Core/Src/main.c
+
+ \\john103C6T6\../Core/Src/main.c\132
@@ -376,6 +392,16 @@
1
led_rx,0x0A
+
+ 29
+ 1
+ GPIO_InitStruct
+
+
+ 30
+ 1
+ MB_DIAG,0x0A
+
@@ -457,6 +483,10 @@
System Viewer\GPIOC
35905
+
+ System Viewer\RCC
+ 35902
+
System Viewer\USART1
35903
@@ -613,18 +643,6 @@
0
0
0
- ../Core/Src/rtc.c
- rtc.c
- 0
- 0
-
-
- 2
- 12
- 1
- 0
- 0
- 0
../Core/Src/tim.c
tim.c
0
@@ -632,7 +650,7 @@
2
- 13
+ 12
1
0
0
@@ -644,7 +662,7 @@
2
- 14
+ 13
1
0
0
@@ -656,7 +674,7 @@
2
- 15
+ 14
1
0
0
@@ -668,7 +686,7 @@
2
- 16
+ 15
1
0
0
@@ -688,7 +706,7 @@
0
3
- 17
+ 16
1
0
0
@@ -700,7 +718,7 @@
3
- 18
+ 17
1
0
0
@@ -712,7 +730,7 @@
3
- 19
+ 18
1
0
0
@@ -724,7 +742,7 @@
3
- 20
+ 19
1
0
0
@@ -736,7 +754,7 @@
3
- 21
+ 20
1
0
0
@@ -748,7 +766,7 @@
3
- 22
+ 21
1
0
0
@@ -760,7 +778,7 @@
3
- 23
+ 22
1
0
0
@@ -772,7 +790,7 @@
3
- 24
+ 23
1
0
0
@@ -784,7 +802,7 @@
3
- 25
+ 24
1
0
0
@@ -796,7 +814,7 @@
3
- 26
+ 25
1
0
0
@@ -808,7 +826,7 @@
3
- 27
+ 26
1
0
0
@@ -820,7 +838,7 @@
3
- 28
+ 27
1
0
0
@@ -832,7 +850,7 @@
3
- 29
+ 28
1
0
0
@@ -844,7 +862,7 @@
3
- 30
+ 29
1
0
0
@@ -856,7 +874,7 @@
3
- 31
+ 30
1
0
0
@@ -868,7 +886,7 @@
3
- 32
+ 31
1
0
0
@@ -880,31 +898,7 @@
3
- 33
- 1
- 0
- 0
- 0
- ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c
- stm32f1xx_hal_rtc.c
- 0
- 0
-
-
- 3
- 34
- 1
- 0
- 0
- 0
- ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c
- stm32f1xx_hal_rtc_ex.c
- 0
- 0
-
-
- 3
- 35
+ 32
1
0
0
@@ -924,7 +918,7 @@
0
4
- 36
+ 33
1
0
0
@@ -938,13 +932,13 @@
modbus
- 0
+ 1
0
0
0
5
- 37
+ 34
1
0
0
@@ -956,7 +950,7 @@
5
- 38
+ 35
1
0
0
@@ -968,7 +962,7 @@
5
- 39
+ 36
1
0
0
@@ -980,7 +974,7 @@
5
- 40
+ 37
1
0
0
@@ -992,7 +986,7 @@
5
- 41
+ 38
1
0
0
@@ -1004,7 +998,7 @@
5
- 42
+ 39
1
0
0
@@ -1016,7 +1010,7 @@
5
- 43
+ 40
1
0
0
@@ -1028,7 +1022,7 @@
5
- 44
+ 41
1
0
0
@@ -1040,7 +1034,7 @@
5
- 45
+ 42
1
0
0
@@ -1052,7 +1046,7 @@
5
- 46
+ 43
1
0
0
@@ -1064,7 +1058,7 @@
5
- 47
+ 44
1
0
0
@@ -1076,7 +1070,7 @@
5
- 48
+ 45
1
0
0
@@ -1088,7 +1082,7 @@
5
- 49
+ 46
1
0
0
@@ -1108,7 +1102,7 @@
0
6
- 50
+ 47
1
0
0
diff --git a/john103C6T6NewVer/MDK-ARM/john103C6T6.uvprojx b/john103C6T6NewVer/MDK-ARM/john103C6T6.uvprojx
index d1eadd1..d5b5654 100644
--- a/john103C6T6NewVer/MDK-ARM/john103C6T6.uvprojx
+++ b/john103C6T6NewVer/MDK-ARM/john103C6T6.uvprojx
@@ -341,7 +341,7 @@
USE_HAL_DRIVER,STM32F103xB
- ../Core/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include;../Modbus;../EEPROM_Emul/lib;../../core/STM32_Modbus/Inc;..\linkBlink
+ ../Core/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc;../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy;../Drivers/CMSIS/Device/ST/STM32F1xx/Include;../Drivers/CMSIS/Include;../Modbus;../EEPROM_Emul/lib;../../core/STM32_Modbus/Inc;../linkBlink
@@ -542,62 +542,6 @@
-
- rtc.c
- 1
- ../Core/Src/rtc.c
-
-
- 2
- 0
- 0
- 0
- 0
- 1
- 2
- 2
- 2
- 2
- 11
-
-
- 1
-
-
-
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 0
- 0
- 2
- 2
- 2
- 2
- 2
-
-
-
-
-
-
-
-
-
-
tim.c
1
@@ -861,118 +805,6 @@
-
- stm32f1xx_hal_rtc.c
- 1
- ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c
-
-
- 2
- 0
- 0
- 0
- 0
- 1
- 2
- 2
- 2
- 2
- 11
-
-
- 1
-
-
-
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 0
- 0
- 2
- 2
- 2
- 2
- 2
-
-
-
-
-
-
-
-
-
-
-
- stm32f1xx_hal_rtc_ex.c
- 1
- ../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c
-
-
- 2
- 0
- 0
- 0
- 0
- 1
- 2
- 2
- 2
- 2
- 11
-
-
- 1
-
-
-
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 2
- 0
- 2
- 2
- 2
- 2
- 2
- 0
- 0
- 2
- 2
- 2
- 2
- 2
-
-
-
-
-
-
-
-
-
-
stm32f1xx_hal_uart.c
1
diff --git a/john103C6T6NewVer/MDK-ARM/startup_stm32f103xb.s b/john103C6T6NewVer/MDK-ARM/startup_stm32f103xb.s
index 7ced626..26a7d15 100644
--- a/john103C6T6NewVer/MDK-ARM/startup_stm32f103xb.s
+++ b/john103C6T6NewVer/MDK-ARM/startup_stm32f103xb.s
@@ -29,7 +29,7 @@
; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
;
-Stack_Size EQU 0x400
+Stack_Size EQU 0x200
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
@@ -40,7 +40,7 @@ __initial_sp
; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
;
-Heap_Size EQU 0x400
+Heap_Size EQU 0x200
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
diff --git a/john103C6T6NewVer/Modbus/modbus_config.h b/john103C6T6NewVer/Modbus/modbus_config.h
index 74850b2..9d5682b 100644
--- a/john103C6T6NewVer/Modbus/modbus_config.h
+++ b/john103C6T6NewVer/Modbus/modbus_config.h
@@ -16,10 +16,15 @@
- Настройки периферии (UART, TIMER)
- Подключение модулей Modbus
- Опциональные функции (переключение команд 0x03/0x04)
-******************************************************************************/
+******************************************************SSSSSS************************/
#ifndef _MODBUS_CONFIG_H_
#define _MODBUS_CONFIG_H_
#include "stm32f1xx_hal.h"
+#include "main.h"
+//#define USART_1 1
+
+
+
// Общие параметры
#define MODBUS_DEVICE_ID 3 ///< Адрес устройства в сети Modbus
@@ -38,7 +43,11 @@
#define MODBUS_USEROBJECT_0_NAME "" ///< Строка пользовательского идентификатора 0. По аналогии можно определить строки до <=128 USEROBJECT
// Периферия (опционально)
+#if (USE_USART== USART_1)
#define mb_huart huart1 ///< Удобный дефайн для модбасовского uart
+#elif(USE_USART==USART_2)
+#define mb_huart huart2
+#endif
#define mb_htim htim2 ///< Удобный дефайн для модбасовского таймера
//#define RS_EnableReceive() ///< Функция изменения направления передачи на ПРИЕМ для RS-485
//#define RS_EnableTransmit() ///< Функция изменения направления передачи на ПЕРЕДАЧУ для RS-485
diff --git a/john103C6T6NewVer/john103C6T6.ioc b/john103C6T6NewVer/john103C6T6.ioc
index 436a169..94d667b 100644
--- a/john103C6T6NewVer/john103C6T6.ioc
+++ b/john103C6T6NewVer/john103C6T6.ioc
@@ -18,45 +18,42 @@ Mcu.IP0=ADC1
Mcu.IP1=I2C1
Mcu.IP2=NVIC
Mcu.IP3=RCC
-Mcu.IP4=RTC
-Mcu.IP5=SYS
-Mcu.IP6=TIM1
-Mcu.IP7=TIM2
-Mcu.IP8=USART1
+Mcu.IP4=SYS
+Mcu.IP5=TIM1
+Mcu.IP6=TIM2
+Mcu.IP7=USART1
+Mcu.IP8=USART2
Mcu.IPNb=9
Mcu.Name=STM32F103C(4-6)Tx
Mcu.Package=LQFP48
Mcu.Pin0=PC13-TAMPER-RTC
Mcu.Pin1=PD0-OSC_IN
-Mcu.Pin10=PA7
-Mcu.Pin11=PB0
-Mcu.Pin12=PB1
-Mcu.Pin13=PB2
-Mcu.Pin14=PB10
-Mcu.Pin15=PB11
-Mcu.Pin16=PA9
-Mcu.Pin17=PA10
-Mcu.Pin18=PA13
-Mcu.Pin19=PA14
+Mcu.Pin10=PB0
+Mcu.Pin11=PB1
+Mcu.Pin12=PB2
+Mcu.Pin13=PB10
+Mcu.Pin14=PB11
+Mcu.Pin15=PA13
+Mcu.Pin16=PA14
+Mcu.Pin17=PA15
+Mcu.Pin18=PB6
+Mcu.Pin19=PB7
Mcu.Pin2=PD1-OSC_OUT
-Mcu.Pin20=PA15
-Mcu.Pin21=PB8
-Mcu.Pin22=PB9
-Mcu.Pin23=VP_ADC1_TempSens_Input
-Mcu.Pin24=VP_ADC1_Vref_Input
-Mcu.Pin25=VP_RTC_VS_RTC_Activate
-Mcu.Pin26=VP_RTC_VS_RTC_Calendar
-Mcu.Pin27=VP_SYS_VS_tim3
-Mcu.Pin28=VP_TIM1_VS_ClockSourceINT
-Mcu.Pin29=VP_TIM2_VS_ClockSourceINT
+Mcu.Pin20=PB8
+Mcu.Pin21=PB9
+Mcu.Pin22=VP_ADC1_TempSens_Input
+Mcu.Pin23=VP_ADC1_Vref_Input
+Mcu.Pin24=VP_SYS_VS_tim3
+Mcu.Pin25=VP_TIM1_VS_ClockSourceINT
+Mcu.Pin26=VP_TIM2_VS_ClockSourceINT
Mcu.Pin3=PA0-WKUP
Mcu.Pin4=PA1
Mcu.Pin5=PA2
Mcu.Pin6=PA3
-Mcu.Pin7=PA4
-Mcu.Pin8=PA5
-Mcu.Pin9=PA6
-Mcu.PinsNb=30
+Mcu.Pin7=PA5
+Mcu.Pin8=PA6
+Mcu.Pin9=PA7
+Mcu.PinsNb=27
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F103C8Tx
@@ -70,7 +67,6 @@ NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
-NVIC.RTC_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC.TIM1_BRK_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
@@ -82,14 +78,12 @@ NVIC.TIM3_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:true
NVIC.TimeBase=TIM3_IRQn
NVIC.TimeBaseIP=TIM3
NVIC.USART1_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
+NVIC.USART2_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0-WKUP.Locked=true
PA0-WKUP.Signal=GPIO_Input
PA1.Locked=true
PA1.Signal=GPIO_Output
-PA10.Locked=true
-PA10.Mode=Asynchronous
-PA10.Signal=USART1_RX
PA13.Mode=Serial_Wire
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial_Wire
@@ -98,21 +92,16 @@ PA15.GPIOParameters=GPIO_Label
PA15.GPIO_Label=One_wire
PA15.Locked=true
PA15.Signal=GPIO_Output
-PA2.Locked=true
-PA2.Signal=GPIO_Output
-PA3.Locked=true
-PA3.Signal=GPIO_Output
-PA4.Locked=true
-PA4.Signal=GPIO_Output
+PA2.Mode=Asynchronous
+PA2.Signal=USART2_TX
+PA3.Mode=Asynchronous
+PA3.Signal=USART2_RX
PA5.Locked=true
PA5.Signal=GPIO_Output
PA6.Locked=true
PA6.Signal=GPIO_Output
PA7.Locked=true
PA7.Signal=GPIO_Output
-PA9.Locked=true
-PA9.Mode=Asynchronous
-PA9.Signal=USART1_TX
PB0.Locked=true
PB0.Signal=GPIO_Output
PB1.Locked=true
@@ -123,6 +112,12 @@ PB11.Locked=true
PB11.Signal=GPIO_Output
PB2.Locked=true
PB2.Signal=GPIO_Output
+PB6.Locked=true
+PB6.Mode=Asynchronous
+PB6.Signal=USART1_TX
+PB7.Locked=true
+PB7.Mode=Asynchronous
+PB7.Signal=USART1_RX
PB8.Mode=I2C
PB8.Signal=I2C1_SCL
PB9.Mode=I2C
@@ -149,7 +144,7 @@ ProjectManager.DeviceId=STM32F103C8Tx
ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.6
ProjectManager.FreePins=false
ProjectManager.HalAssertFull=false
-ProjectManager.HeapSize=0x200
+ProjectManager.HeapSize=0x400
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=false
ProjectManager.LibraryCopy=0
@@ -161,13 +156,13 @@ ProjectManager.ProjectFileName=john103C6T6.ioc
ProjectManager.ProjectName=john103C6T6
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
-ProjectManager.StackSize=0x200
+ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5.32
ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=false
-ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_TIM1_Init-TIM1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_TIM2_Init-TIM2-false-HAL-true,6-MX_ADC1_Init-ADC1-false-HAL-true,7-MX_I2C1_Init-I2C1-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_TIM1_Init-TIM1-false-HAL-true,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_TIM2_Init-TIM2-false-HAL-true,6-MX_ADC1_Init-ADC1-false-HAL-true,7-MX_I2C1_Init-I2C1-false-HAL-true,8-MX_USART2_UART_Init-USART2-false-HAL-true
RCC.ADCFreqValue=12000000
RCC.ADCPresc=RCC_ADCPCLK2_DIV6
RCC.AHBFreq_Value=72000000
@@ -191,8 +186,6 @@ RCC.TimSysFreq_Value=72000000
RCC.USBFreq_Value=48000000
RCC.USBPrescaler=RCC_USBCLKSOURCE_PLL_DIV1_5
RCC.VCOOutput2Freq_Value=8000000
-RTC.IPParameters=OutPut
-RTC.OutPut=RTC_OUTPUTSOURCE_SECOND
TIM1.IPParameters=Prescaler,Period
TIM1.Period=65535
TIM1.Prescaler=0
@@ -201,14 +194,12 @@ TIM2.Period=65535
TIM2.Prescaler=7199
USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC
+USART2.IPParameters=VirtualMode
+USART2.VirtualMode=VM_ASYNC
VP_ADC1_TempSens_Input.Mode=IN-TempSens
VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
VP_ADC1_Vref_Input.Mode=IN-Vrefint
VP_ADC1_Vref_Input.Signal=ADC1_Vref_Input
-VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled
-VP_RTC_VS_RTC_Activate.Signal=RTC_VS_RTC_Activate
-VP_RTC_VS_RTC_Calendar.Mode=RTC_Calendar
-VP_RTC_VS_RTC_Calendar.Signal=RTC_VS_RTC_Calendar
VP_SYS_VS_tim3.Mode=TIM3
VP_SYS_VS_tim3.Signal=SYS_VS_tim3
VP_TIM1_VS_ClockSourceINT.Mode=Internal
diff --git a/schem.pdsprj b/schem.pdsprj
index 8f72c3a..1325b4c 100644
Binary files a/schem.pdsprj and b/schem.pdsprj differ
diff --git a/schem.pdsprj.DESKTOP-RQ2QP65.z.workspace b/schem.pdsprj.DESKTOP-RQ2QP65.z.workspace
index 008131e..7e0cbb7 100644
--- a/schem.pdsprj.DESKTOP-RQ2QP65.z.workspace
+++ b/schem.pdsprj.DESKTOP-RQ2QP65.z.workspace
@@ -3,9 +3,9 @@
2c0000000200000003000000ffffffffffffffffffffffffffffffff40000000670000008c080000bd050000
-
+
-
+
@@ -18,9 +18,9 @@
-
+
-
+
@@ -31,6 +31,7 @@
- -22
- No
- 100
+ - 120
- 100
@@ -53,6 +54,9 @@
- 0
+
+
+