Bläddra i källkod

Added some docs.

Thomas Chef 3 år sedan
förälder
incheckning
3fc1c4a05a
2 ändrade filer med 73 tillägg och 16 borttagningar
  1. 0 16
      STM32/Core/Src/main.c
  2. 73 0
      STM32/README.md

+ 0 - 16
STM32/Core/Src/main.c

@@ -319,22 +319,6 @@ static void MX_ADC1_Init(void)
   sConfig.SamplingTime = ADC_SAMPLETIME_55CYCLES_5;
   HAL_ADC_ConfigChannel(&hadc1, &sConfig);
 
-/*
- * Tconv = Sampling time + 12.5 cycles
- *
- * Example:
- *   With an ADCCLK = 14 MHz and a sampling time of 1.5 cycles: Tconv = 1.5 + 12.5 = 14 cycles = 1 μs
- *
- *   In this application we want to sample a 50Hz signal = 20mS
- *
- * Calcs here: https://docs.google.com/spreadsheets/d/1an5f3Aog4bdwpe-rDquWTxlXBpsXEK-1DVhAsiCqlq0/edit#gid=304302332
- *
- * Select: 56MHz /4 55,5 = 205 882,35Hz = 4 117,6 samples / 50Hz wave
- *
- *
- *
-  */
-
   /* USER CODE END ADC1_Init 2 */
 
 }

+ 73 - 0
STM32/README.md

@@ -0,0 +1,73 @@
+# STM32 Blue Pill Project for reading current,temp and 1 on/off-function
+
+This project that has been developed on the Mac with STM32CubeIDE, Version: 1.8.0 has the following features:
+- Read V peak-peak on AN5 input
+- Scan and send temperatures of all connected DS18B20 (Max 5 units)
+- Control out DI with UART2 Rx control (the blue pill green LED) 
+
+## Functions
+
+Master clock with PLL is set to 56MHz
+The TIM1 is used in OW to get an exact delay. When measuring OW then ADC interrupt is off
+ADC1 is set to contious mode with interrupt
+Max and Min values of ADC is measured and then sustracted and sent
+Control on UART2 Rx {0} and {1} will control the green led on the blue pill card
+Data is sent every 10 seconds in format:
+```
+{VPP,0,2164}
+{OWT,080C25372F3D253F,16.62}
+{OWT,28FF22DA551603C3,20.06}
+```
+
+## ADC Timing
+
+Tconv = Sampling time + 12.5 cycles
+Example:
+With an ADCCLK = 14 MHz and a sampling time of 1.5 cycles: Tconv = 1.5 + 12.5 = 14 cycles = 1 μs
+In this application we want to sample a 50Hz signal = 20mS
+Calcs here: https://docs.google.com/spreadsheets/d/1an5f3Aog4bdwpe-rDquWTxlXBpsXEK-1DVhAsiCqlq0/edit#gid=304302332
+  
+
+
+Select the instructions depending on Espressif chip installed on your development board:
+
+- [ESP32 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/index.html)
+- [ESP32-S2 Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html)
+
+
+## Example folder contents
+
+The project **hello_world** contains one source file in C language [hello_world_main.c](main/hello_world_main.c). The file is located in folder [main](main).
+
+ESP-IDF projects are build using CMake. The project build configuration is contained in `CMakeLists.txt` files that provide set of directives and instructions describing the project's source files and targets (executable, library, or both). 
+
+Below is short explanation of remaining files in the project folder.
+
+```
+├── CMakeLists.txt
+├── example_test.py            Python script used for automated example testing
+├── main
+│   ├── CMakeLists.txt
+│   ├── component.mk           Component make file
+│   └── hello_world_main.c
+├── Makefile                   Makefile used by legacy GNU Make
+└── README.md                  This is the file you are currently reading
+```
+
+For more information on structure and contents of ESP-IDF projects, please refer to Section [Build System](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html) of the ESP-IDF Programming Guide.
+
+## Troubleshooting
+
+* Program upload failure
+
+    * Hardware connection is not correct: run `idf.py -p PORT monitor`, and reboot your board to see if there are any output logs.
+    * The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again.
+
+## Technical support and feedback
+
+Please use the following feedback channels:
+
+* For technical queries, go to the [esp32.com](https://esp32.com/) forum
+* For a feature request or bug report, create a [GitHub issue](https://github.com/espressif/esp-idf/issues)
+
+We will get back to you as soon as possible.