Browse Source

ADC / Table 내용 수정

ADC Data 정상 출력하도록 수정
Table 저장 및 로드 정상 저장및 로드 하도록 수정
PYJ 4 years ago
parent
commit
fb4ceea1f2
45 changed files with 14555 additions and 14738 deletions
  1. 8 8
      Bluecell_Src/NessLab.c
  2. 20 25
      Bluecell_Src/adc.c
  3. 1 1
      Bluecell_Src/crc.c
  4. BIN
      Debug/Bluecell_Src/NessLab.o
  5. 5 5
      Debug/Bluecell_Src/NessLab.su
  6. BIN
      Debug/Bluecell_Src/adc.o
  7. 8 8
      Debug/Bluecell_Src/adc.su
  8. BIN
      Debug/Bluecell_Src/crc.o
  9. BIN
      Debug/Nesslab_200M_System.bin
  10. BIN
      Debug/Nesslab_200M_System.elf
  11. 13803 13971
      Debug/Nesslab_200M_System.list
  12. 710 720
      Debug/Nesslab_200M_System.map
  13. BIN
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_xm
  14. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_led.h.sisc
  15. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc
  16. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc
  17. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc
  18. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc
  19. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f1xx.h.sisc
  20. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_armcc.h.sisc
  21. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_armclang.h.sisc
  22. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_compiler.h.sisc
  23. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_gcc.h.sisc
  24. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_iccarm.h.sisc
  25. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_version.h.sisc
  26. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm0.h.sisc
  27. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm0plus.h.sisc
  28. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm1.h.sisc
  29. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm3.h.sisc
  30. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm4.h.sisc
  31. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm7.h.sisc
  32. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_sc000.h.sisc
  33. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_sc300.h.sisc
  34. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_mpu_armv7.h.sisc
  35. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_mpu_armv8.h.sisc
  36. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_def.h.sisc
  37. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc.h.sisc
  38. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc
  39. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc_ex.c.sisc
  40. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash.c.sisc
  41. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash_ex.c.sisc
  42. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc.c.sisc
  43. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc_ex.c.sisc
  44. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Src_syscalls.c.sisc
  45. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Src_system_stm32f1xx.c.sisc

+ 8 - 8
Bluecell_Src/NessLab.c

@@ -19,7 +19,6 @@ uint8_t NessLab_Adc_Convert_db();
19 19
 
20 20
 #define NESSLAB_DATARESPONSE_INDEXSIZE  23
21 21
 #define NESSLAB_TABLE_LENGTH 110
22
-
23 22
 Nesslab_Prot Currstatus;
24 23
 extern volatile uint16_t ADC1value[ADC1_CNT];
25 24
 
@@ -36,7 +35,7 @@ uint8_t Flash_DataArray[200] = {0,};
36 35
 uint8_t DB_Define[100];
37 36
 
38 37
 void NessLab_Init(){
39
-    FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],100);
38
+    FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
40 39
     HAL_GPIO_WritePin(PAU_RESET_GPIO_Port,PAU_RESET_Pin, GPIO_PIN_SET);
41 40
 }
42 41
 double Round_Function(double value){
@@ -71,13 +70,13 @@ uint8_t NessLab_Adc_Convert_db() // ?占쏙옙湲고븿?占쏙옙
71 70
             continue;
72 71
         calc_val = CurrAdc_Temp - TableVal_Temp;
73 72
         calc_val = Absolute_value_Convert(calc_val);
74
-        printf("%d - %d calc_val : %d \r\n",CurrAdc_Temp,TableVal_Temp,calc_val);
73
+//        printf("%d - %d calc_val : %d \r\n",CurrAdc_Temp,TableVal_Temp,calc_val);
75 74
         if(Prev_calc_val > calc_val && TableVal_Temp != 0){
76 75
            Prev_calc_val = calc_val;
77 76
            Curr_DB = i + 2;
78
-           printf("Curr_DB : %d \r\n",Curr_DB);
77
+//           printf("Curr_DB : %d \r\n",Curr_DB);
79 78
         }else{
80
-            printf("%d  %d \r\n",Prev_calc_val , calc_val);
79
+//            printf("%d  %d \r\n",Prev_calc_val , calc_val);
81 80
         }
82 81
     }
83 82
 //    DB_Define[]
@@ -125,7 +124,7 @@ void NessLab_Operate(uint8_t* data){
125 124
         case NessLab_Table_REQ:
126 125
             UartLength = NESSLAB_TABLE_LENGTH;
127 126
             FLASH_Read_Func(FLASH_USER_USE_START_ADDR,&NessLab_TxData[NessLab_Req_Data_Cnt0],data[NessLab_DataLength]);
128
-            NessLab_Table_Frame_Set(NessLab_TxData,100,NessLab_Table_RES);
127
+            NessLab_Table_Frame_Set(NessLab_TxData,102,NessLab_Table_RES);
129 128
             printf("NessLab_Table_REQ \r\n");
130 129
             break;
131 130
         case NessLab_TableSet_REQ:
@@ -137,8 +136,9 @@ void NessLab_Operate(uint8_t* data){
137 136
             }
138 137
             FLASH_Write_Func(FLASH_USER_USE_START_ADDR,&Flash_DataArray[0],data[NessLab_DataLength]);
139 138
             UartLength = NESSLAB_TABLE_LENGTH;
140
-            NessLab_Table_Frame_Set(NessLab_TxData,100,NessLab_TableSet_RES);
141
-            NessLab_Init();
139
+            NessLab_Table_Frame_Set(NessLab_TxData,104,NessLab_TableSet_RES);
140
+            FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
141
+//            NessLab_Init();
142 142
             printf("\r\nNessLab_TableSet_REQ \r\n");            
143 143
             break;
144 144
         case NessLab_PAU_Enable_Req:

+ 20 - 25
Bluecell_Src/adc.c

@@ -8,7 +8,8 @@
8 8
 #include "adc.h"
9 9
 #include "NessLab.h"
10 10
  
11
- 
11
+uint8_t ADC_Convert_Temperature(double val);
12
+
12 13
  extern ADC_HandleTypeDef hadc1;
13 14
  extern DMA_HandleTypeDef hdma_adc1;
14 15
  extern Nesslab_Prot Currstatus;
@@ -35,17 +36,20 @@
35 36
  
36 37
  void ADC_Value_Get(){
37 38
      uint16_t CalcRet = 0 ;
38
- 
39
+     uint16_t Tx_Det_Volt = ((ADC1value[0] * (3.3 / 4095))* 1000);
40
+     uint16_t Rx_Det_Volt = ((ADC1value[1] * (3.3 / 4095))* 1000);
41
+     int8_t Real_Temperature = ADC_Convert_Temperature((ADC1value[2] * (3.3 / 4095)));
39 42
      /*DL TX Calc*/
40
-     Currstatus.DownLink_Forward_Det_H = ((ADC1value[0] & 0xFF00) >> 8);
41
-     Currstatus.DownLink_Forward_Det_L = (ADC1value[0] & 0x00FF);
43
+     Currstatus.DownLink_Forward_Det_H = ((Tx_Det_Volt & 0xFF00) >> 8);
44
+     Currstatus.DownLink_Forward_Det_L = (Tx_Det_Volt & 0x00FF);
45
+     printf("Tx_Det_Volt : %d \r\n",Tx_Det_Volt);
42 46
  
43 47
      /*DL RX Calc*/
44
-     Currstatus.DownLink_Reverse_Det_H = ((ADC1value[1] & 0xFF00) >> 8);
45
-     Currstatus.DownLink_Reverse_Det_L = (ADC1value[1] & 0x00FF);
48
+     Currstatus.DownLink_Reverse_Det_H = ((Rx_Det_Volt & 0xFF00) >> 8);
49
+     Currstatus.DownLink_Reverse_Det_L = (Rx_Det_Volt & 0x00FF);
46 50
  
47 51
      /*Temp Calc*/
48
-     Currstatus.Temp_Monitor = ((ADC1value[1] & 0xFF00) >> 8);
52
+     Currstatus.Temp_Monitor = Real_Temperature;
49 53
  
50 54
  
51 55
  }
@@ -59,13 +63,13 @@
59 63
      int16_t ret = val * 1000;
60 64
      int8_t cnt = 0;
61 65
  
62
-     printf("ret : %d \r\n", ret - ref_0temp);
66
+     printf("ret : %d \r\n", ret);
63 67
      if( ret - ref_0temp > 0){
64 68
          for(int i = 0; i < ret - ref_0temp; i += 10){
65 69
              cnt++;
66 70
          }
67 71
      }else{
68
-         for(int i = 0; i < ret - ref_0temp; i -= 10){
72
+         for(int i = 0; i > ret - ref_0temp; i -= 10){
69 73
              cnt--;
70 74
          }
71 75
      }
@@ -102,22 +106,11 @@
102 106
  
103 107
  void ADC_Check(){
104 108
      float tempval = 0;
109
+
110
+     for(int i = 0; i < 3 ; i++)
111
+         printf("ADC1value[%d] : %d \r\n",i,ADC1value[i]);
105 112
      
106
-     printf("ADC1value[%d] : %f \r\n",0,tempval/1000);
107
- 
108
-     
109
-#if 0 // PYJ.2020.09.09_BEGIN -- 
110
-     for(int i = 0 ; i < 2; i++){
111
-         tempval = (ADC1value[i] * (3.3 / 4095));
112
-         tempval *= 1000;
113
-     }
114
-#else
115
- //    for(int i = 0 ; i < 2; i++){
116
- //        tempval = (ADC1_Average_value * (3.3 / 4095));
117
- //        tempval *= 1000;
118
- //    }
119 113
  
120
-#endif // PYJ.2020.09.09_END -- 
121 114
  
122 115
      
123 116
 #if 0 // PYJ.2020.09.09_BEGIN -- 
@@ -126,8 +119,10 @@
126 119
      Currstatus.DownLink_Forward_Det_L
127 120
          = (((uint16_t)tempval & 0x00FF) );
128 121
 #endif // PYJ.2020.09.09_END -- 
129
-      Currstatus.Temp_Monitor = ADC_Convert_Temperature((ADC1value[2]/1000));
130
-     printf("Currstatus.DownLink_Forward_Det : %d \r\n",Currstatus.DownLink_Forward_Det_H << 8 | Currstatus.DownLink_Forward_Det_L);
122
+    ADC_Value_Get();
123
+
124
+//      Currstatus.Temp_Monitor = ADC_Convert_Temperature((ADC1value[2]/1000));
125
+//     printf("Currstatus.DownLink_Forward_Det : %d \r\n",Currstatus.DownLink_Forward_Det_H << 8 | Currstatus.DownLink_Forward_Det_L);
131 126
  }
132 127
  void ADC_TDD_Arrange(){
133 128
      uint32_t ADC1_Average_value = 0;

+ 1 - 1
Bluecell_Src/crc.c

@@ -278,7 +278,7 @@ bool NessLab_CheckSum_Check(uint8_t* data,uint8_t size,uint8_t checksum){
278 278
 //    printf("size : %d \r\n",size);
279 279
 	for(int i = 0; i < size; i++){
280 280
 		dataret += data[i];
281
-        printf("data [i] : %x \r\n",data[i]);
281
+//        printf("data [i] : %x \r\n",data[i]);
282 282
 	}
283 283
 
284 284
 	dataret = (~dataret) + 1;

BIN
Debug/Bluecell_Src/NessLab.o


+ 5 - 5
Debug/Bluecell_Src/NessLab.su

@@ -1,8 +1,8 @@
1
-NessLab.c:38:6:NessLab_Init	8	static
2
-NessLab.c:42:8:Round_Function	32	static
3
-NessLab.c:52:10:Absolute_value_Convert	16	static
4
-NessLab.c:57:9:NessLab_Adc_Convert_db	56	static
5
-NessLab.c:91:6:NessLab_Operate	32	static
1
+NessLab.c:37:6:NessLab_Init	8	static
2
+NessLab.c:41:8:Round_Function	32	static
3
+NessLab.c:51:10:Absolute_value_Convert	16	static
4
+NessLab.c:56:9:NessLab_Adc_Convert_db	56	static
5
+NessLab.c:90:6:NessLab_Operate	32	static
6 6
 NessLab.c:165:6:NessLab_Frame_Set	24	static
7 7
 NessLab.c:214:6:NessLab_Protocol_LastCheck	24	static
8 8
 NessLab.c:235:6:NessLab_Table_Frame_Set	40	static

BIN
Debug/Bluecell_Src/adc.o


+ 8 - 8
Debug/Bluecell_Src/adc.su

@@ -1,8 +1,8 @@
1
-adc.c:36:7:ADC_Value_Get	16	static
2
-adc.c:52:7:ADC_Initialize	8	static
3
-adc.c:57:10:ADC_Convert_Temperature	40	static
4
-adc.c:75:11:SumFunc	24	static
5
-adc.c:86:7:DascendigFunc	32	static
6
-adc.c:103:7:ADC_Check	24	static
7
-adc.c:132:7:ADC_TDD_Arrange	16	static
8
-adc.c:173:7:HAL_ADC_ConvCpltCallback	24	static
1
+adc.c:37:7:ADC_Value_Get	24	static
2
+adc.c:56:7:ADC_Initialize	8	static
3
+adc.c:61:10:ADC_Convert_Temperature	40	static
4
+adc.c:79:11:SumFunc	24	static
5
+adc.c:90:7:DascendigFunc	32	static
6
+adc.c:107:7:ADC_Check	16	static
7
+adc.c:127:7:ADC_TDD_Arrange	16	static
8
+adc.c:168:7:HAL_ADC_ConvCpltCallback	24	static

BIN
Debug/Bluecell_Src/crc.o


BIN
Debug/Nesslab_200M_System.bin


BIN
Debug/Nesslab_200M_System.elf


File diff suppressed because it is too large
+ 13803 - 13971
Debug/Nesslab_200M_System.list


File diff suppressed because it is too large
+ 710 - 720
Debug/Nesslab_200M_System.map


BIN
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_xm


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_led.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f1xx.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_armcc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_armclang.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_compiler.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_gcc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_iccarm.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_cmsis_version.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm0.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm0plus.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm1.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm3.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm4.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_cm7.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_sc000.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_core_sc300.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_mpu_armv7.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_mpu_armv8.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_def.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc_ex.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash_ex.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc_ex.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Src_syscalls.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Src_system_stm32f1xx.c.sisc