Browse Source

Finalisation de step dft reel OK

Adrien Barbanson 2 years ago
parent
commit
5f460e9380

+ 21
- 0
PjtKEIL_StepDFTREEL/RTE/_CibleSondeKEIL/RTE_Components.h View File

@@ -0,0 +1,21 @@
1
+
2
+/*
3
+ * Auto generated Run-Time-Environment Configuration File
4
+ *      *** Do not modify ! ***
5
+ *
6
+ * Project: 'StepDFT' 
7
+ * Target:  'CibleSondeKEIL' 
8
+ */
9
+
10
+#ifndef RTE_COMPONENTS_H
11
+#define RTE_COMPONENTS_H
12
+
13
+
14
+/*
15
+ * Define the Device Header File: 
16
+ */
17
+#define CMSIS_device_header "stm32f10x.h"
18
+
19
+
20
+
21
+#endif /* RTE_COMPONENTS_H */

+ 1
- 0
PjtKEIL_StepDFTREEL/Src/DFT.s View File

@@ -12,6 +12,7 @@
12 12
 		
13 13
 	export DFT_ModuleAuCarre
14 14
 	
15
+	
15 16
 ; ===============================================================================================
16 17
 	
17 18
 

+ 25
- 8
PjtKEIL_StepDFTREEL/Src/principal.c View File

@@ -8,10 +8,27 @@ extern int DFT_ModuleAuCarre(short int*, char);
8 8
 
9 9
 extern short int LeSignal;
10 10
 
11
+short int dma_buff[64] ;
12
+
11 13
 int res[64];
12 14
 
13 15
 void faire_dft() {
14 16
 	
17
+	//on fait la mesure
18
+	
19
+	Start_DMA1(64);
20
+	Wait_On_End_Of_DMA1();
21
+	Stop_DMA1;
22
+	
23
+	
24
+	//on l'exploite
25
+	char k;
26
+
27
+	for(k=0;k<64;k++){
28
+		res[k] = DFT_ModuleAuCarre(dma_buff, k);
29
+	}
30
+	
31
+	
15 32
 }
16 33
 
17 34
 
@@ -29,18 +46,18 @@ CLOCK_Configure();
29 46
 	// ? ticks pour 5*10^-3 s
30 47
 	// règle de trois.
31 48
 	
49
+	//on décide de faire une DFT toutes les 5 ms
32 50
 	Systick_Period_ff(360000);
33 51
 	Systick_Prio_IT(1,faire_dft);
34 52
 	SysTick_On;
35
-	SysTick_Enable_IT; // valider une interruption??????
36
-	
37
-	char k;
38
-
39
-	
53
+	SysTick_Enable_IT; // activer l'interruption configurée
54
+	Init_Conversion_On_Trig_Timer_ff( ADC1, TIM2_CC2, 225 );
40 55
 	
41
-	for(k=0;k<64;k++){
42
-		res[k] = DFT_ModuleAuCarre(&LeSignal, k);
43
-	}
56
+	//il faut configurer la fréquence d'échantillonage de l'ADC
57
+	Init_TimingADC_ActiveADC_ff(ADC1,72);
58
+	Single_Channel_ADC(ADC1,2);
59
+	Init_Conversion_On_Trig_Timer_ff( ADC1, TIM2_CC2, 225 );
60
+	Init_ADC1_DMA1( 0, dma_buff );
44 61
 		
45 62
 
46 63
 //============================================================================	

Loading…
Cancel
Save