Browse Source

fin du step dft

Adrien Barbanson 2 years ago
parent
commit
09a2ab0105
40 changed files with 2505 additions and 33 deletions
  1. 12
    0
      .gitignore
  2. 0
    0
      PjtKEIL_StepDFT/Driver/DriverJeuLaser.h
  3. 0
    0
      PjtKEIL_StepDFT/Driver/DriverJeuLaser.inc
  4. 0
    0
      PjtKEIL_StepDFT/RTE/_Simu/RTE_Components.h
  5. 49
    33
      PjtKEIL_StepDFT/Src/DFT.s
  6. 0
    0
      PjtKEIL_StepDFT/Src/principal.c
  7. 0
    0
      PjtKEIL_StepDFT/Src/startup-rvds.s
  8. 0
    0
      PjtKEIL_StepDFT/StepDFT.uvprojx
  9. 345
    0
      PjtKEIL_StepDFTREEL/Driver/DriverJeuLaser.h
  10. 56
    0
      PjtKEIL_StepDFTREEL/Driver/DriverJeuLaser.inc
  11. 21
    0
      PjtKEIL_StepDFTREEL/RTE/_Simu/RTE_Components.h
  12. 265
    0
      PjtKEIL_StepDFTREEL/Src/DFT.s
  13. 55
    0
      PjtKEIL_StepDFTREEL/Src/principal.c
  14. 335
    0
      PjtKEIL_StepDFTREEL/Src/startup-rvds.s
  15. 1367
    0
      PjtKEIL_StepDFTREEL/StepDFT.uvprojx
  16. 0
    0
      PjtKEIL_StepDeb_1/BacASable.uvprojx
  17. 0
    0
      PjtKEIL_StepDeb_1/Driver/DriverJeuLaser.h
  18. 0
    0
      PjtKEIL_StepDeb_1/Driver/DriverJeuLaser.inc
  19. 0
    0
      PjtKEIL_StepDeb_1/RTE/_CibleSondeKEIL/RTE_Components.h
  20. 0
    0
      PjtKEIL_StepDeb_1/RTE/_Simu/RTE_Components.h
  21. 0
    0
      PjtKEIL_StepDeb_1/Src/Delay.s
  22. 0
    0
      PjtKEIL_StepDeb_1/Src/principal.c
  23. 0
    0
      PjtKEIL_StepDeb_1/Src/startup-rvds.s
  24. 0
    0
      PjtKEIL_StepDeb_2/BacASable.uvprojx
  25. 0
    0
      PjtKEIL_StepDeb_2/Driver/DriverJeuLaser.h
  26. 0
    0
      PjtKEIL_StepDeb_2/Driver/DriverJeuLaser.inc
  27. 0
    0
      PjtKEIL_StepDeb_2/RTE/_CibleSondeKEIL/RTE_Components.h
  28. 0
    0
      PjtKEIL_StepDeb_2/RTE/_Simu/RTE_Components.h
  29. 0
    0
      PjtKEIL_StepDeb_2/Src/Cligno.s
  30. 0
    0
      PjtKEIL_StepDeb_2/Src/principal.c
  31. 0
    0
      PjtKEIL_StepDeb_2/Src/startup-rvds.s
  32. 0
    0
      PjtKEIL_StepSon/Driver/DriverJeuLaser.h
  33. 0
    0
      PjtKEIL_StepSon/Driver/DriverJeuLaser.inc
  34. 0
    0
      PjtKEIL_StepSon/RTE/_CibleSondeKEIL/RTE_Components.h
  35. 0
    0
      PjtKEIL_StepSon/RTE/_CibleSondeST/RTE_Components.h
  36. 0
    0
      PjtKEIL_StepSon/RTE/_Simu/RTE_Components.h
  37. 0
    0
      PjtKEIL_StepSon/Src/GestionSon.s
  38. 0
    0
      PjtKEIL_StepSon/Src/principal.c
  39. 0
    0
      PjtKEIL_StepSon/Src/startup-rvds.s
  40. 0
    0
      PjtKEIL_StepSon/StepSon.uvprojx

+ 12
- 0
.gitignore View File

@@ -0,0 +1,12 @@
1
+*.*
2
+!.gitattributes
3
+!.gitignore
4
+!README.md
5
+!.gitkeep
6
+!*.c
7
+!*.uvprojx
8
+!*.s
9
+!*.c
10
+!*.h
11
+!*.inc
12
+

+ 0
- 0
PjtKEIL_StepDFT/Driver/DriverJeuLaser.h View File


+ 0
- 0
PjtKEIL_StepDFT/Driver/DriverJeuLaser.inc View File


+ 0
- 0
PjtKEIL_StepDFT/RTE/_Simu/RTE_Components.h View File


+ 49
- 33
PjtKEIL_StepDFT/Src/DFT.s View File

@@ -27,63 +27,65 @@
27 27
 
28 28
 DFT_ModuleAuCarre proc
29 29
 	
30
-	push {r4}
31
-	push {r5}
32
-	push {r6}
33
-	push {r7}
34
-	push {r8}
30
+	; dans r0 On a l'adresse du départ du tableau du signal
31
+	; dans r1 on a le nombre k
35 32
 	
36
-	; on utilise R2 pour stocker la somme
33
+	push {r4-r10}
37 34
 	
35
+	; on utilise R2 pour stocker la somme des cosinus
38 36
 	mov r2, #0;
37
+	; on utilise R7 pour stocker la somme des sinus
38
+	mov r7, #0;
39 39
 	
40 40
 	; on utilise r3 pour stocker n
41
-	
42 41
 	mov r3, #0;
43 42
 	
44 43
 boucle
45
-	; on load la valeur du son tableauSon[i]
46
-	mov r4, #0
44
+	; on load la valeur du son signal[i]
45
+	; on utilise LDR mais que sur 16 bits car le chiffre est au format 1.15
46
+	; on charge depuis l'adresse r0 avec un décalage r3, on décale de 2^4 = 16 bits
47 47
 	ldrh r4, [r0,r3,LSL #1]
48 48
 	
49 49
 	; on fait k*n pour avoir p
50 50
 	; donc dans  r6 on a p
51 51
 	mul r6, r3, r1
52 52
 	
53
-	; ensuite on fait le modulo 64 qui est 2^6
54
-	
55
-	;donc on prend notre chiffre (r6) on le décale à droite de 6 puis à gauche de 6
56
-	;mov r7, r6
57
-	
58
-	;lsr r7, #6
59
-	;lsl r7, #6
53
+	; ensuite on fait le modulo 64
54
+	; ce qui revient à faire un masque sur les 2^6 premiers bits
60 55
 	
61
-	; on soustrait on a le modulo.
62
-	;sub r6,r7
63 56
 	
64
-	and r6,#63
57
+	; XXXXXXXXXXXXXXXX
58
+	;  AND
59
+	; 0000000000111111 = 63 en binaire
65 60
 	
61
+	and r6, r6,#63
66 62
 	
67 63
 	;on va chercher la valeur du cosinus
68 64
 	ldr r5, =TabCos
69 65
 	ldrsh r5, [r5, r6, LSL #1]
70 66
 	
71
-    ; ATTENTION : on multiplie un format 1.15 avec un format 1.15 donc le résultat est au format 2.30
72
-	; DONC : on fait 16bits * 16 bits = 32 bits
67
+	; on va chercher la valeur du sinus
68
+	ldr r8, =TabSin
69
+	ldrsh r8, [r8, r6, LSL #1]
73 70
 	
74
-	mul r4,r5 ; f(x) * cos(p)
75 71
 	
76 72
 	
77
-	; on repase en 1.15 en décalant de 15 bits à droite
73
+    ; ATTENTION : on multiplie un format 1.12 avec un format 1.15 donc le résultat est au format 2.27
74
+	; DONC : on fait 16bits * 16 bits = 32 bits
75
+	mul r5,r4 ; f(x) * cos(p)
76
+	mul r8,r4 ; f(x) * sin(p)
78 77
 	
79
-	lsr r4, #15
78
+	; on est sûr que l'on a la partie entière qui ne peut pas être supérieure à 1
79
+	; donc on a pas de risque de débordement si on remasse en 1.15
80 80
 	
81
+	; on repase en 1.12 en décalant de 15 bits à droite, mais on préserve le signe
81 82
 	
82
-	; MISE AU CARRE : attention on a 1.15 * 1.15 = 2.30 donc 64 bits
83
-
84
-	mul r4,r4
83
+	asr r5, #15
84
+	asr r8, #15
85 85
 	
86
-	add r2, r4
86
+	; Attention, à force d'ajouter du 1.12 on peut facilement déborder en 6.12 car on peut potentiellement ajouter 1 à chaque itération ! (donc 64 = 2^6)
87
+	add r2, r5
88
+	add r7, r8
87 89
 	
88 90
 	;on incrémente notre i
89 91
 	add r3, #1
@@ -91,15 +93,29 @@ boucle
91 93
 	cmp r3, #63
92 94
 	bne boucle
93 95
 	
96
+	; MISE AU CARRE : attention on a 6.12 * 6.12 = 12.24 donc 36 bits or le registre est sur 32 bits.
97
+	; Donc on réduit de 6.12 à 6.10 avec de pouvoir avoir : 6.10 * 6.10 = 12.20 = 32 bits.
98
+	
99
+	asr r2, #2
100
+	asr r7, #2
101
+
102
+	; format 12.20
103
+	mul r2,r2
104
+	mul r7,r7
105
+	
94 106
 	; la somme totale doit etre retournée dans r1
107
+	; sauf que 12.20 + 12.20 il y a risque de débordement
108
+	; donc on passe en 12.19 + 12.19 et le résultat sera en 13.19
109
+	asr r2, #1
110
+	asr r7, #1
111
+	
112
+	; on les somme : on passe en 13.19
113
+	add r2, r7
95 114
 	
115
+	; on place le résultat dans r0
96 116
 	mov r0, r2
97 117
 	
98
-	pop {r8}
99
-	pop {r7}
100
-	pop {r6}
101
-	pop {r5}
102
-	pop {r4}
118
+	pop {r4-r10}
103 119
 	
104 120
 	bx lr
105 121
 	

+ 0
- 0
PjtKEIL_StepDFT/Src/principal.c View File


+ 0
- 0
PjtKEIL_StepDFT/Src/startup-rvds.s View File


+ 0
- 0
PjtKEIL_StepDFT/StepDFT.uvprojx View File


+ 345
- 0
PjtKEIL_StepDFTREEL/Driver/DriverJeuLaser.h View File

@@ -0,0 +1,345 @@
1
+/**
2
+ * Bibliotheque DriverJeuLaser (ancienne gassp72 adaptée 2021 - TR)
3
+ *
4
+ * GPIO - ADC - Sequenceur - System Timer - PWM - 72 MHz
5
+ * Modifs :
6
+ * enlèvement de tout ce qui est inutile dans le .h 
7
+ * ajout de fonctions GPIO dans le .c pour utilisation en ASM ou en C :
8
+ *  - GPIOA_Set(char Broche), GPIOB_Set(char Broche), GPIOC_Set(char Broche)
9
+ *  - GPIOA_Clear(char Broche), GPIOB_Clear(char Broche), GPIOC_Clear(char Broche)
10
+ * 
11
+ * ajout d'une fonction qui impose une valeur de PWM (TIM3_CCR3)
12
+ * PWM_Set_Value_On_TIM3_C3( int Val) 
13
+ * permet en ASM ou en C de fixer la valeur de PWM 
14
+ 
15
+ * Ajout de commentaires
16
+ 
17
+ */
18
+#ifndef DRIVERJEULASER_H__
19
+#define DRIVERJEULASER_H__
20
+
21
+#include "stm32f10x.h"
22
+
23
+//**********************************************************************************************************
24
+//---------------------          CONFIGURATION CLOCK DU STM32         --------------------------------------
25
+//**********************************************************************************************************
26
+
27
+/**
28
+	* @brief  Configure l'ensemble des horloges du uC
29
+  * @note   horloge systeme (config statique a 72 MHz pour le STM32F103)
30
+	* @param  None
31
+  * @retval None
32
+  */
33
+void CLOCK_Configure(void);
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+//**********************************************************************************************************
45
+//---------------------          LES TIMERS GENERAL PURPOSE TIM1 à TIM 4      ------------------------------
46
+//**********************************************************************************************************
47
+
48
+/**
49
+	* @brief  Configure un Timer TIM1 à TIM4 avec une périodicité donnée
50
+  * @note   L' horloge des 4 timers a une fréquence de 72MHz
51
+	* @param  *Timer = TIM1 ou TIM2 ou TIM3 ou TIM4
52
+	* @param  Durée_ticks : nombre de pas (tick) comptés à 72 MHz pour faire déborder le timer 
53
+	*         La période de débordement du Timer est donc T = Durée_ticks * Tck, avec Tck = 1/72 000 000
54
+  * @retval None
55
+  */
56
+void Timer_1234_Init_ff( TIM_TypeDef *Timer, u32 Duree_ticks );
57
+
58
+/**
59
+ * Macros de base pour utiliser les timers
60
+ */
61
+ // bloque le timer
62
+#define Bloque_Timer(Timer) Timer->CR1=(Timer->CR1)&~(1<<0)
63
+// Lance timer
64
+#define Run_Timer(Timer) Timer->CR1=(Timer->CR1)|(1<<0)
65
+
66
+
67
+
68
+/**
69
+	* @brief  Associe une fonction d'interruption (callback) lors du débordement d'un timer
70
+  * @note   
71
+	* @param  *Timer = TIM1 ou TIM2 ou TIM3 ou TIM4
72
+	* @param  Prio : niveau de priorité de l'interruption (0 -> priorité max, 15 ->  priorité min)
73
+	* @param  IT_function : le nom de la fonction Callback à appeler lors de l'interruption
74
+  * @retval None
75
+  */
76
+void Active_IT_Debordement_Timer( TIM_TypeDef *Timer, char Prio, void (*IT_function)(void) );
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+//*********************************************************************************************************
89
+//---------------------               PWM   TIM1 to TIM 4                   ------------------------------
90
+//*********************************************************************************************************
91
+
92
+/**
93
+	* @brief  Configure un timer en PWM 
94
+  * @note   
95
+	* @param  *Timer = TIM1 ou TIM2 ou TIM3 ou TIM4
96
+	* @param  voie : un des 4 canaux possibles 1 à 4.
97
+	* @param  Periode_ticks : nombre de pas (tick) comptés à 72 MHz pour faire déborder le timer 
98
+	*         La période de débordement du Timer est donc T = Durée_ticks * Tck, avec Tck = 1/72 000 000
99
+  * @retval Retourne la période  en tick (normalement la même que le param d'entrée sauf si PSC utilisé
100
+  */
101
+unsigned short int PWM_Init_ff( TIM_TypeDef *Timer, char Voie, u32 Periode_ticks );
102
+
103
+
104
+
105
+/**
106
+	* @brief  Fixe une valeur de PWM, Val, en tick horloge. La rapport cyclique effectif
107
+	* est donc : rcy = Thaut_ticks / Periode_ticks
108
+  * @note   spécifique Jeu Laser, PWM liée exclusivement au TIM3, chan3
109
+	* @param  Thaut_ticks : durée de l'état haut d'une impulsion en Ticks
110
+  * @retval None
111
+  */
112
+void PWM_Set_Value_TIM3_Ch3( unsigned short int Thaut_ticks);
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+//**********************************************************************************************************
123
+//---------------------          LE SYSTICK TIMER, Part of Cortex M3          ------------------------------
124
+//**********************************************************************************************************
125
+
126
+/**
127
+	* @brief  Configure le timer Systick avec une périodicité donnée
128
+  * @note   Ce timer ne peut servir qu'à créer des temporisations ou générer des interruption
129
+	*         ce n'est pas à proprement parler un périphérique, il fait partie du Cortex M3
130
+	*         Ce timer est un 24 bits 
131
+	* @param  Periode_ticks : nombre de pas (tick) comptés à 72 MHz pour établir la périodicité
132
+	*          La période de débordement du Timer est donc T = Durée_ticks * Tck, avec Tck = 1/72 000 000
133
+  * @retval None
134
+  */
135
+void Systick_Period_ff( unsigned int Periode_ticks );
136
+
137
+
138
+
139
+/**
140
+	* @brief  Associe une fonction d'interruption (callback) lors du débordement du Systick
141
+  * @note   
142
+	* @param  Prio : niveau de priorité de l'interruption (0 -> priorité max, 15 ->  priorité min)
143
+	* @param  IT_function : le nom de la fonction Callback à appeler lors de l'interruption
144
+  * @retval None
145
+  */
146
+void Systick_Prio_IT( char Prio, void (*Systick_function)(void) );
147
+
148
+
149
+/**
150
+ * Macros de base pour utiliser le Systick 
151
+ */
152
+#define  SysTick_On ((SysTick->CTRL)=(SysTick->CTRL)|1<<0)
153
+#define  SysTick_Off ((SysTick->CTRL)=(SysTick->CTRL)& ~(1<<0))
154
+#define  SysTick_Enable_IT ((SysTick->CTRL)=(SysTick->CTRL)|1<<1)
155
+#define  SysTick_Disable_IT ((SysTick->CTRL)=(SysTick->CTRL)& ~(1<<1))
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+//**********************************************************************************************************
171
+//---------------------          LE SYSTICK TIMER, Part of Cortex M3          ------------------------------
172
+//**********************************************************************************************************
173
+
174
+/**
175
+	* @brief  Active l'ADC du STM32, configure la durée de prélèvement de l'échantillon (temps
176
+	* de fermeture du switch d'acquisition
177
+  * @note   
178
+	* @param  ADC : précise de quel ADC il s'agit, ADC1 ou ADC2
179
+	* @param  Duree_Ech_ticks : dirée de fermeture du switch d'échantillonnage en Tick d'horloge CPU
180
+	*         exemple pour 1µs on choisira 72.
181
+  * @retval Nombre de Tick réellement pris en compte
182
+  */
183
+unsigned int Init_TimingADC_ActiveADC_ff( ADC_TypeDef * ADC, u32 Duree_Ech_ticks );
184
+
185
+
186
+/**
187
+	* @brief  Sélectionne la voie à convertir
188
+  * @note   Attention, la voie va de 0 à 15 et n'est pas directement lié au n°de GPIO
189
+	* @param  ADC : précise de quel ADC il s'agit, ADC1 ou ADC2
190
+	* @param  Voie_ADC : 1 à 15
191
+  * @retval None
192
+  */
193
+void Single_Channel_ADC( ADC_TypeDef * ADC, char Voie_ADC );
194
+
195
+
196
+
197
+
198
+
199
+/**
200
+	* @brief  Permet lier le déclenchement au débordement d'un timer, spécifie également
201
+	*         la période de débordement du timer 
202
+  * @note   pas besoin de régler le timer avec une autre fonction dédiée timer
203
+	* @param  ADC : précise de quel ADC il s'agit, ADC1 ou ADC2
204
+	* @param  Source : indique le timer qui déclenche l'ADC choix dans les define ci-dessous
205
+	* @param	Periode_ticks : nombre de pas (tick) comptés à 72 MHz pour faire déborder le timer 
206
+	*         La période de débordement du Timer est donc T = Durée_ticks * Tck, avec Tck = 1/72 000 000
207
+  * @retval None
208
+  */
209
+
210
+// param pour Source :
211
+#define TIM1_CC1 0
212
+#define TIM1_CC2 1
213
+#define TIM1_CC3 2
214
+#define TIM2_CC2 3
215
+#define TIM4_CC4 5
216
+void Init_Conversion_On_Trig_Timer_ff( ADC_TypeDef * ADC, char Source, u32 Periode_ticks );
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+//**********************************************************************************************************
233
+//---------------------           ANALOG INPUT  ADC & DMA                     ------------------------------
234
+//**********************************************************************************************************
235
+
236
+/**
237
+	* @brief  Permer de lier l'ADC à un tableau en RAM pour une DMA 
238
+  * @note   
239
+	* @param  Circ : circular. Si '0', en fin de DMA le ptr d'@ reste inchangé
240
+	*         si '1' le ptr d'@ se recale à celle du début.
241
+	* @param  Ptr_Table_DMA : contient l'@ de début de zone RAM à écrire
242
+	* @retval None
243
+  */
244
+void Init_ADC1_DMA1(char Circ, short int *Ptr_Table_DMA);
245
+
246
+
247
+
248
+
249
+
250
+/**
251
+	* @brief  Lance une DMA sur le nombre de points spécifie. Les resultats seront stockes
252
+	*         dans la zone de RAM écrite est indiquée lors de l'appel de la fonction  Init_ADC1_DMA1 
253
+  * @note   
254
+	* @param  NbEchDMA est le nombre d'échantillons à stocker.
255
+	* @retval None
256
+  */
257
+void Start_DMA1( u16 NbEchDMA );
258
+
259
+// arret DMA
260
+#define  Stop_DMA1 DMA1_Channel1->CCR =(DMA1_Channel1->CCR) &~0x1;
261
+
262
+
263
+/**
264
+	* @brief  Attend la fin d'un cycle de DMA. la duree depend de la periode d'acquisition 
265
+	* et du nombre d'echantillons
266
+  * @note   fonction d'attente (bloquante) 
267
+	* @param  None
268
+	* @retval None
269
+  */
270
+void Wait_On_End_Of_DMA1(void);
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+//**********************************************************************************************************
280
+//---------------------                   GPIO                                ------------------------------
281
+//**********************************************************************************************************
282
+
283
+/**
284
+	* @brief  Initialisation d'un GPIO (A à C), pin x. 
285
+  *  			peut être configuré :
286
+	*  			-> Input ou output
287
+	*       -> architecture technologique (push-pull, open drain...)
288
+	
289
+  * @note   
290
+	* @param  Port : GPIOA, GPIOB, GPIOC
291
+	* @param  Broche : 0 à 15
292
+	* @param  Sens : INPUT ou OUTPUT
293
+	* @param  Techno : voir define ci dessous
294
+	* @retval 1 erreur, 0 si OK
295
+  */
296
+
297
+// Sens
298
+#define INPUT   'i'
299
+#define OUTPUT  'o'
300
+
301
+// Techno pour pin en entrée (INPUT)
302
+#define ANALOG              0
303
+#define INPUT_FLOATING      1
304
+#define INPUT_PULL_DOWN_UP  2
305
+
306
+// Techno pour pin en sortie (OUTPUT)
307
+#define OUTPUT_PPULL    0
308
+#define OUTPUT_OPDRAIN  1
309
+#define ALT_PPULL       2
310
+#define ALT_OPDRAIN     3
311
+
312
+// Exemple :
313
+// Port_IO_Init(GPIOB, 8, OUTPUT, OUTPUT_PPULL);
314
+// Place le bit 8 du port B en sortie Push-pull
315
+char GPIO_Configure(GPIO_TypeDef * Port, int Broche, int Sens, int Techno);
316
+
317
+
318
+/**
319
+	* @brief  Mise à 1 d'une broche GPIO	
320
+  * @note   Une fonction par GPIO
321
+	* @param  Broche : 0 à 15
322
+	* @retval None
323
+  */
324
+
325
+void GPIOA_Set(char Broche);
326
+void GPIOB_Set(char Broche);
327
+void GPIOC_Set(char Broche);
328
+
329
+
330
+
331
+/**
332
+	* @brief  Mise à 0 d'une broche GPIO	
333
+  * @note   Une fonction par GPIO
334
+	* @param  Broche : 0 à 15
335
+	* @retval None
336
+  */
337
+
338
+void GPIOA_Clear(char Broche);
339
+void GPIOB_Clear(char Broche);
340
+void GPIOC_Clear(char Broche);
341
+
342
+
343
+#endif
344
+
345
+

+ 56
- 0
PjtKEIL_StepDFTREEL/Driver/DriverJeuLaser.inc View File

@@ -0,0 +1,56 @@
1
+
2
+; Bibliotheque DriverJeuLaser (ancienne gassp72 adaptée 2021 - TR)
3
+; Accès en aux fonctions suivantes :
4
+; GPIO :
5
+; GPIOA_Set(char Broche), GPIOB_Set(char Broche), GPIOC_Set(char Broche)
6
+; GPIOA_Clear(char Broche), GPIOB_Clear(char Broche), GPIOC_Clear(char Broche)
7
+  
8
+; PWM :
9
+;/**
10
+;	* @brief  Fixe une valeur de PWM, Val, en tick horloge. La rapport cyclique effectif
11
+;	* est donc : rcy = Thaut_ticks / Periode_ticks
12
+; * @note   spécifique Jeu Laser, PWM liée exclusivement au TIM3, chan3
13
+;	* @param  Thaut_ticks : durée de l'état haut d'une impulsion en Ticks
14
+;  * @retval None
15
+; */
16
+
17
+;void PWM_Set_Value_TIM3_Ch3( unsigned short int Thaut_ticks);
18
+	import PWM_Set_Value_TIM3_Ch3
19
+
20
+
21
+
22
+;/**
23
+;	* @brief  Mise à 1 d'une broche GPIO	
24
+;  * @note   Une fonction par GPIO
25
+;	* @param  Broche : 0 à 15
26
+;	* @retval None
27
+; */
28
+
29
+;void GPIOA_Set(char Broche);
30
+	import GPIOA_Set
31
+
32
+;void GPIOB_Set(char Broche);
33
+	import GPIOB_Set
34
+
35
+;void GPIOC_Set(char Broche);
36
+	import GPIOC_Set
37
+
38
+
39
+
40
+;/**
41
+;	* @brief  Mise à 0 d'une broche GPIO	
42
+;  * @note   Une fonction par GPIO
43
+;	* @param  Broche : 0 à 15
44
+;	* @retval None
45
+;  */
46
+
47
+;void GPIOA_Clear(char Broche);
48
+	import GPIOA_Clear
49
+
50
+;void GPIOB_Clear(char Broche);
51
+	import GPIOB_Clear
52
+
53
+;void GPIOC_Clear(char Broche);
54
+	import GPIOC_Clear
55
+
56
+	end

+ 21
- 0
PjtKEIL_StepDFTREEL/RTE/_Simu/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:  'Simu' 
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 */

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

@@ -0,0 +1,265 @@
1
+	PRESERVE8
2
+	THUMB   
3
+		
4
+
5
+; ====================== zone de réservation de données,  ======================================
6
+;Section RAM (read only) :
7
+	area    mesdata,data,readonly
8
+
9
+
10
+;Section RAM (read write):
11
+	area    maram,data,readwrite
12
+		
13
+	export DFT_ModuleAuCarre
14
+	
15
+; ===============================================================================================
16
+	
17
+
18
+
19
+
20
+
21
+
22
+		
23
+;Section ROM code (read only) :		
24
+	area    moncode,code,readonly
25
+; écrire le code ici		
26
+
27
+
28
+DFT_ModuleAuCarre proc
29
+	
30
+	; dans r0 On a l'adresse du départ du tableau du signal
31
+	; dans r1 on a le nombre k
32
+	
33
+	push {r4-r10}
34
+	
35
+	; on utilise R2 pour stocker la somme des cosinus
36
+	mov r2, #0;
37
+	; on utilise R7 pour stocker la somme des sinus
38
+	mov r7, #0;
39
+	
40
+	; on utilise r3 pour stocker n
41
+	mov r3, #0;
42
+	
43
+boucle
44
+	; on load la valeur du son signal[i]
45
+	; on utilise LDR mais que sur 16 bits car le chiffre est au format 1.15
46
+	; on charge depuis l'adresse r0 avec un décalage r3, on décale de 2^4 = 16 bits
47
+	ldrh r4, [r0,r3,LSL #1]
48
+	
49
+	; on fait k*n pour avoir p
50
+	; donc dans  r6 on a p
51
+	mul r6, r3, r1
52
+	
53
+	; ensuite on fait le modulo 64
54
+	; ce qui revient à faire un masque sur les 2^6 premiers bits
55
+	
56
+	
57
+	; XXXXXXXXXXXXXXXX
58
+	;  AND
59
+	; 0000000000111111 = 63 en binaire
60
+	
61
+	and r6, r6,#63
62
+	
63
+	;on va chercher la valeur du cosinus
64
+	ldr r5, =TabCos
65
+	ldrsh r5, [r5, r6, LSL #1]
66
+	
67
+	; on va chercher la valeur du sinus
68
+	ldr r8, =TabSin
69
+	ldrsh r8, [r8, r6, LSL #1]
70
+	
71
+	
72
+	
73
+    ; ATTENTION : on multiplie un format 1.12 avec un format 1.15 donc le résultat est au format 2.27
74
+	; DONC : on fait 16bits * 16 bits = 32 bits
75
+	mul r5,r4 ; f(x) * cos(p)
76
+	mul r8,r4 ; f(x) * sin(p)
77
+	
78
+	; on est sûr que l'on a la partie entière qui ne peut pas être supérieure à 1
79
+	; donc on a pas de risque de débordement si on remasse en 1.15
80
+	
81
+	; on repase en 1.12 en décalant de 15 bits à droite, mais on préserve le signe
82
+	
83
+	asr r5, #15
84
+	asr r8, #15
85
+	
86
+	; Attention, à force d'ajouter du 1.12 on peut facilement déborder en 6.12 car on peut potentiellement ajouter 1 à chaque itération ! (donc 64 = 2^6)
87
+	add r2, r5
88
+	add r7, r8
89
+	
90
+	;on incrémente notre i
91
+	add r3, #1
92
+	
93
+	cmp r3, #63
94
+	bne boucle
95
+	
96
+	; MISE AU CARRE : attention on a 6.12 * 6.12 = 12.24 donc 36 bits or le registre est sur 32 bits.
97
+	; Donc on réduit de 6.12 à 6.10 avec de pouvoir avoir : 6.10 * 6.10 = 12.20 = 32 bits.
98
+	
99
+	asr r2, #2
100
+	asr r7, #2
101
+
102
+	; format 12.20
103
+	mul r2,r2
104
+	mul r7,r7
105
+	
106
+	; la somme totale doit etre retournée dans r1
107
+	; sauf que 12.20 + 12.20 il y a risque de débordement
108
+	; donc on passe en 12.19 + 12.19 et le résultat sera en 13.19
109
+	asr r2, #1
110
+	asr r7, #1
111
+	
112
+	; on les somme : on passe en 13.19
113
+	add r2, r7
114
+	
115
+	; on place le résultat dans r0
116
+	mov r0, r2
117
+	
118
+	pop {r4-r10}
119
+	
120
+	bx lr
121
+	
122
+ endp
123
+
124
+
125
+
126
+
127
+;Section ROM code (read only) :		
128
+	AREA Trigo, DATA, READONLY
129
+; codage fractionnaire 1.15
130
+
131
+TabCos
132
+	DCW	32767	;  0 0x7fff  0.99997
133
+	DCW	32610	;  1 0x7f62  0.99518
134
+	DCW	32138	;  2 0x7d8a  0.98077
135
+	DCW	31357	;  3 0x7a7d  0.95694
136
+	DCW	30274	;  4 0x7642  0.92389
137
+	DCW	28899	;  5 0x70e3  0.88193
138
+	DCW	27246	;  6 0x6a6e  0.83148
139
+	DCW	25330	;  7 0x62f2  0.77301
140
+	DCW	23170	;  8 0x5a82  0.70709
141
+	DCW	20788	;  9 0x5134  0.63440
142
+	DCW	18205	; 10 0x471d  0.55557
143
+	DCW	15447	; 11 0x3c57  0.47141
144
+	DCW	12540	; 12 0x30fc  0.38269
145
+	DCW	 9512	; 13 0x2528  0.29028
146
+	DCW	 6393	; 14 0x18f9  0.19510
147
+	DCW	 3212	; 15 0x0c8c  0.09802
148
+	DCW	    0	; 16 0x0000  0.00000
149
+	DCW	-3212	; 17 0xf374 -0.09802
150
+	DCW	-6393	; 18 0xe707 -0.19510
151
+	DCW	-9512	; 19 0xdad8 -0.29028
152
+	DCW	-12540	; 20 0xcf04 -0.38269
153
+	DCW	-15447	; 21 0xc3a9 -0.47141
154
+	DCW	-18205	; 22 0xb8e3 -0.55557
155
+	DCW	-20788	; 23 0xaecc -0.63440
156
+	DCW	-23170	; 24 0xa57e -0.70709
157
+	DCW	-25330	; 25 0x9d0e -0.77301
158
+	DCW	-27246	; 26 0x9592 -0.83148
159
+	DCW	-28899	; 27 0x8f1d -0.88193
160
+	DCW	-30274	; 28 0x89be -0.92389
161
+	DCW	-31357	; 29 0x8583 -0.95694
162
+	DCW	-32138	; 30 0x8276 -0.98077
163
+	DCW	-32610	; 31 0x809e -0.99518
164
+	DCW	-32768	; 32 0x8000 -1.00000
165
+	DCW	-32610	; 33 0x809e -0.99518
166
+	DCW	-32138	; 34 0x8276 -0.98077
167
+	DCW	-31357	; 35 0x8583 -0.95694
168
+	DCW	-30274	; 36 0x89be -0.92389
169
+	DCW	-28899	; 37 0x8f1d -0.88193
170
+	DCW	-27246	; 38 0x9592 -0.83148
171
+	DCW	-25330	; 39 0x9d0e -0.77301
172
+	DCW	-23170	; 40 0xa57e -0.70709
173
+	DCW	-20788	; 41 0xaecc -0.63440
174
+	DCW	-18205	; 42 0xb8e3 -0.55557
175
+	DCW	-15447	; 43 0xc3a9 -0.47141
176
+	DCW	-12540	; 44 0xcf04 -0.38269
177
+	DCW	-9512	; 45 0xdad8 -0.29028
178
+	DCW	-6393	; 46 0xe707 -0.19510
179
+	DCW	-3212	; 47 0xf374 -0.09802
180
+	DCW	    0	; 48 0x0000  0.00000
181
+	DCW	 3212	; 49 0x0c8c  0.09802
182
+	DCW	 6393	; 50 0x18f9  0.19510
183
+	DCW	 9512	; 51 0x2528  0.29028
184
+	DCW	12540	; 52 0x30fc  0.38269
185
+	DCW	15447	; 53 0x3c57  0.47141
186
+	DCW	18205	; 54 0x471d  0.55557
187
+	DCW	20788	; 55 0x5134  0.63440
188
+	DCW	23170	; 56 0x5a82  0.70709
189
+	DCW	25330	; 57 0x62f2  0.77301
190
+	DCW	27246	; 58 0x6a6e  0.83148
191
+	DCW	28899	; 59 0x70e3  0.88193
192
+	DCW	30274	; 60 0x7642  0.92389
193
+	DCW	31357	; 61 0x7a7d  0.95694
194
+	DCW	32138	; 62 0x7d8a  0.98077
195
+	DCW	32610	; 63 0x7f62  0.99518
196
+TabSin 
197
+	DCW	    0	;  0 0x0000  0.00000
198
+	DCW	 3212	;  1 0x0c8c  0.09802
199
+	DCW	 6393	;  2 0x18f9  0.19510
200
+	DCW	 9512	;  3 0x2528  0.29028
201
+	DCW	12540	;  4 0x30fc  0.38269
202
+	DCW	15447	;  5 0x3c57  0.47141
203
+	DCW	18205	;  6 0x471d  0.55557
204
+	DCW	20788	;  7 0x5134  0.63440
205
+	DCW	23170	;  8 0x5a82  0.70709
206
+	DCW	25330	;  9 0x62f2  0.77301
207
+	DCW	27246	; 10 0x6a6e  0.83148
208
+	DCW	28899	; 11 0x70e3  0.88193
209
+	DCW	30274	; 12 0x7642  0.92389
210
+	DCW	31357	; 13 0x7a7d  0.95694
211
+	DCW	32138	; 14 0x7d8a  0.98077
212
+	DCW	32610	; 15 0x7f62  0.99518
213
+	DCW	32767	; 16 0x7fff  0.99997
214
+	DCW	32610	; 17 0x7f62  0.99518
215
+	DCW	32138	; 18 0x7d8a  0.98077
216
+	DCW	31357	; 19 0x7a7d  0.95694
217
+	DCW	30274	; 20 0x7642  0.92389
218
+	DCW	28899	; 21 0x70e3  0.88193
219
+	DCW	27246	; 22 0x6a6e  0.83148
220
+	DCW	25330	; 23 0x62f2  0.77301
221
+	DCW	23170	; 24 0x5a82  0.70709
222
+	DCW	20788	; 25 0x5134  0.63440
223
+	DCW	18205	; 26 0x471d  0.55557
224
+	DCW	15447	; 27 0x3c57  0.47141
225
+	DCW	12540	; 28 0x30fc  0.38269
226
+	DCW	 9512	; 29 0x2528  0.29028
227
+	DCW	 6393	; 30 0x18f9  0.19510
228
+	DCW	 3212	; 31 0x0c8c  0.09802
229
+	DCW	    0	; 32 0x0000  0.00000
230
+	DCW	-3212	; 33 0xf374 -0.09802
231
+	DCW	-6393	; 34 0xe707 -0.19510
232
+	DCW	-9512	; 35 0xdad8 -0.29028
233
+	DCW	-12540	; 36 0xcf04 -0.38269
234
+	DCW	-15447	; 37 0xc3a9 -0.47141
235
+	DCW	-18205	; 38 0xb8e3 -0.55557
236
+	DCW	-20788	; 39 0xaecc -0.63440
237
+	DCW	-23170	; 40 0xa57e -0.70709
238
+	DCW	-25330	; 41 0x9d0e -0.77301
239
+	DCW	-27246	; 42 0x9592 -0.83148
240
+	DCW	-28899	; 43 0x8f1d -0.88193
241
+	DCW	-30274	; 44 0x89be -0.92389
242
+	DCW	-31357	; 45 0x8583 -0.95694
243
+	DCW	-32138	; 46 0x8276 -0.98077
244
+	DCW	-32610	; 47 0x809e -0.99518
245
+	DCW	-32768	; 48 0x8000 -1.00000
246
+	DCW	-32610	; 49 0x809e -0.99518
247
+	DCW	-32138	; 50 0x8276 -0.98077
248
+	DCW	-31357	; 51 0x8583 -0.95694
249
+	DCW	-30274	; 52 0x89be -0.92389
250
+	DCW	-28899	; 53 0x8f1d -0.88193
251
+	DCW	-27246	; 54 0x9592 -0.83148
252
+	DCW	-25330	; 55 0x9d0e -0.77301
253
+	DCW	-23170	; 56 0xa57e -0.70709
254
+	DCW	-20788	; 57 0xaecc -0.63440
255
+	DCW	-18205	; 58 0xb8e3 -0.55557
256
+	DCW	-15447	; 59 0xc3a9 -0.47141
257
+	DCW	-12540	; 60 0xcf04 -0.38269
258
+	DCW	-9512	; 61 0xdad8 -0.29028
259
+	DCW	-6393	; 62 0xe707 -0.19510
260
+	DCW	-3212	; 63 0xf374 -0.09802
261
+
262
+
263
+		
264
+		
265
+	END	

+ 55
- 0
PjtKEIL_StepDFTREEL/Src/principal.c View File

@@ -0,0 +1,55 @@
1
+
2
+
3
+#include "DriverJeuLaser.h"
4
+
5
+	//short int = 16 bit signé
6
+	//char = 8 bit non signé (0 à 255)
7
+extern int DFT_ModuleAuCarre(short int*, char);
8
+
9
+extern short int LeSignal;
10
+
11
+int res[64];
12
+
13
+void faire_dft() {
14
+	
15
+}
16
+
17
+
18
+int main(void)
19
+{
20
+
21
+// ===========================================================================
22
+// ============= INIT PERIPH (faites qu'une seule fois)  =====================
23
+// ===========================================================================
24
+
25
+// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
26
+CLOCK_Configure();
27
+	
28
+	// 72Mhz  pour 1s
29
+	// ? ticks pour 5*10^-3 s
30
+	// règle de trois.
31
+	
32
+	Systick_Period_ff(360000);
33
+	Systick_Prio_IT(1,faire_dft);
34
+	SysTick_On;
35
+	SysTick_Enable_IT; // valider une interruption??????
36
+	
37
+	char k;
38
+
39
+	
40
+	
41
+	for(k=0;k<64;k++){
42
+		res[k] = DFT_ModuleAuCarre(&LeSignal, k);
43
+	}
44
+		
45
+
46
+//============================================================================	
47
+	
48
+	
49
+while	(1)
50
+	{
51
+	}
52
+}
53
+
54
+
55
+

+ 335
- 0
PjtKEIL_StepDFTREEL/Src/startup-rvds.s View File

@@ -0,0 +1,335 @@
1
+;******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
2
+;* File Name          : startup_stm32f10x_md.s
3
+;* Author             : MCD Application Team
4
+;* Version            : V3.5.0
5
+;* Date               : 11-March-2011
6
+;* Description        : STM32F10x Medium Density Devices vector table for MDK-ARM 
7
+;*                      toolchain.  
8
+;*                      This module performs:
9
+;*                      - Set the initial SP
10
+;*                      - Set the initial PC == Reset_Handler
11
+;*                      - Set the vector table entries with the exceptions ISR address
12
+;*                      - Configure the clock system
13
+;*                      - Branches to __main in the C library (which eventually
14
+;*                        calls main()).
15
+;*                      After Reset the CortexM3 processor is in Thread mode,
16
+;*                      priority is Privileged, and the Stack is set to Main.
17
+;* <<< Use Configuration Wizard in Context Menu >>>   
18
+;*******************************************************************************
19
+; THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
20
+; WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
21
+; AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
22
+; INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
23
+; CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
24
+; INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
25
+;*******************************************************************************
26
+
27
+; Amount of memory (in bytes) allocated for Stack
28
+; Tailor this value to your application needs
29
+; <h> Stack Configuration
30
+;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
31
+; </h>
32
+
33
+Stack_Size      EQU     0x00000400
34
+
35
+                AREA    STACK, NOINIT, READWRITE, ALIGN=3
36
+Stack_Mem       SPACE   Stack_Size
37
+__initial_sp
38
+
39
+
40
+; <h> Heap Configuration
41
+;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
42
+; </h>
43
+
44
+Heap_Size       EQU     0x00000200
45
+
46
+                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
47
+__heap_base
48
+Heap_Mem        SPACE   Heap_Size
49
+__heap_limit
50
+
51
+                PRESERVE8
52
+                THUMB
53
+
54
+
55
+; Vector Table Mapped to Address 0 at Reset
56
+                AREA    RESET, DATA, READONLY
57
+                EXPORT  __Vectors
58
+                EXPORT  __Vectors_End
59
+                EXPORT  __Vectors_Size
60
+
61
+__Vectors       DCD     __initial_sp               ; Top of Stack
62
+                DCD     Reset_Handler              ; Reset Handler
63
+                DCD     NMI_Handler                ; NMI Handler
64
+                DCD     HardFault_Handler          ; Hard Fault Handler
65
+                DCD     MemManage_Handler          ; MPU Fault Handler
66
+                DCD     BusFault_Handler           ; Bus Fault Handler
67
+                DCD     UsageFault_Handler         ; Usage Fault Handler
68
+                DCD     0                          ; Reserved
69
+                DCD     0                          ; Reserved
70
+                DCD     0                          ; Reserved
71
+                DCD     0                          ; Reserved
72
+                DCD     SVC_Handler                ; SVCall Handler
73
+                DCD     DebugMon_Handler           ; Debug Monitor Handler
74
+                DCD     0                          ; Reserved
75
+                DCD     PendSV_Handler             ; PendSV Handler
76
+                DCD     SysTick_Handler            ; SysTick Handler
77
+
78
+                ; External Interrupts
79
+                DCD     WWDG_IRQHandler            ; Window Watchdog
80
+                DCD     PVD_IRQHandler             ; PVD through EXTI Line detect
81
+                DCD     TAMPER_IRQHandler          ; Tamper
82
+                DCD     RTC_IRQHandler             ; RTC
83
+                DCD     FLASH_IRQHandler           ; Flash
84
+                DCD     RCC_IRQHandler             ; RCC
85
+                DCD     EXTI0_IRQHandler           ; EXTI Line 0
86
+                DCD     EXTI1_IRQHandler           ; EXTI Line 1
87
+                DCD     EXTI2_IRQHandler           ; EXTI Line 2
88
+                DCD     EXTI3_IRQHandler           ; EXTI Line 3
89
+                DCD     EXTI4_IRQHandler           ; EXTI Line 4
90
+                DCD     DMA1_Channel1_IRQHandler   ; DMA1 Channel 1
91
+                DCD     DMA1_Channel2_IRQHandler   ; DMA1 Channel 2
92
+                DCD     DMA1_Channel3_IRQHandler   ; DMA1 Channel 3
93
+                DCD     DMA1_Channel4_IRQHandler   ; DMA1 Channel 4
94
+                DCD     DMA1_Channel5_IRQHandler   ; DMA1 Channel 5
95
+                DCD     DMA1_Channel6_IRQHandler   ; DMA1 Channel 6
96
+                DCD     DMA1_Channel7_IRQHandler   ; DMA1 Channel 7
97
+                DCD     ADC1_2_IRQHandler          ; ADC1_2
98
+                DCD     USB_HP_CAN1_TX_IRQHandler  ; USB High Priority or CAN1 TX
99
+                DCD     USB_LP_CAN1_RX0_IRQHandler ; USB Low  Priority or CAN1 RX0
100
+                DCD     CAN1_RX1_IRQHandler        ; CAN1 RX1
101
+                DCD     CAN1_SCE_IRQHandler        ; CAN1 SCE
102
+                DCD     EXTI9_5_IRQHandler         ; EXTI Line 9..5
103
+                DCD     TIM1_BRK_IRQHandler        ; TIM1 Break
104
+                DCD     TIM1_UP_IRQHandler         ; TIM1 Update
105
+                DCD     TIM1_TRG_COM_IRQHandler    ; TIM1 Trigger and Commutation
106
+                DCD     TIM1_CC_IRQHandler         ; TIM1 Capture Compare
107
+                DCD     TIM2_IRQHandler            ; TIM2
108
+                DCD     TIM3_IRQHandler            ; TIM3
109
+                DCD     TIM4_IRQHandler            ; TIM4
110
+                DCD     I2C1_EV_IRQHandler         ; I2C1 Event
111
+                DCD     I2C1_ER_IRQHandler         ; I2C1 Error
112
+                DCD     I2C2_EV_IRQHandler         ; I2C2 Event
113
+                DCD     I2C2_ER_IRQHandler         ; I2C2 Error
114
+                DCD     SPI1_IRQHandler            ; SPI1
115
+                DCD     SPI2_IRQHandler            ; SPI2
116
+                DCD     USART1_IRQHandler          ; USART1
117
+                DCD     USART2_IRQHandler          ; USART2
118
+                DCD     USART3_IRQHandler          ; USART3
119
+                DCD     EXTI15_10_IRQHandler       ; EXTI Line 15..10
120
+                DCD     RTCAlarm_IRQHandler        ; RTC Alarm through EXTI Line
121
+                DCD     USBWakeUp_IRQHandler       ; USB Wakeup from suspend
122
+__Vectors_End
123
+
124
+__Vectors_Size  EQU  __Vectors_End - __Vectors
125
+
126
+                AREA    |.text|, CODE, READONLY
127
+
128
+; Reset handler
129
+Reset_Handler    PROC
130
+                 EXPORT  Reset_Handler             [WEAK]
131
+     IMPORT  __main
132
+     
133
+                 LDR     R0, =SystemInit
134
+                 BLX     R0
135
+
136
+;
137
+; Enable UsageFault, MemFault and Busfault interrupts
138
+;
139
+_SHCSR			EQU     0xE000ED24		; SHCSR is located at address 0xE000ED24
140
+				LDR.W	R0, =_SHCSR				
141
+				LDR 	R1, [R0]				; Read CPACR
142
+				ORR 	R1, R1, #(0x7 << 16)	; Set bits 16,17,18 to enable usagefault, busfault, memfault interrupts
143
+				STR 	R1, [R0]				; Write back the modified value to the CPACR
144
+				DSB								; Wait for store to complete
145
+
146
+;
147
+; Set priority grouping (PRIGROUP) in AIRCR to 3 (16 levels for group priority and 0 for subpriority)
148
+;
149
+_AIRCR			EQU		0xE000ED0C
150
+_AIRCR_VAL		EQU		0x05FA0300
151
+				LDR.W	R0, =_AIRCR
152
+				LDR.W	R1, =_AIRCR_VAL
153
+				STR		R1,[R0]
154
+		
155
+;
156
+; Finaly, jump to main function (void main (void))
157
+;
158
+                LDR     R0, =__main
159
+                BX      R0
160
+                ENDP
161
+
162
+SystemInit		PROC				 
163
+				EXPORT  SystemInit                    [WEAK]    
164
+				BX		LR
165
+				ENDP
166
+
167
+; Dummy Exception Handlers (infinite loops which can be modified)
168
+
169
+NMI_Handler     PROC
170
+                EXPORT  NMI_Handler                [WEAK]
171
+                B       .
172
+                ENDP
173
+HardFault_Handler\
174
+                PROC
175
+                EXPORT  HardFault_Handler          [WEAK]
176
+                B       .
177
+                ENDP
178
+MemManage_Handler\
179
+                PROC
180
+                EXPORT  MemManage_Handler          [WEAK]
181
+                B       .
182
+                ENDP
183
+BusFault_Handler\
184
+                PROC
185
+                EXPORT  BusFault_Handler           [WEAK]
186
+                B       .
187
+                ENDP
188
+UsageFault_Handler\
189
+                PROC
190
+                EXPORT  UsageFault_Handler         [WEAK]
191
+                B       .
192
+                ENDP
193
+SVC_Handler     PROC
194
+                EXPORT  SVC_Handler                [WEAK]
195
+                B       .
196
+                ENDP
197
+DebugMon_Handler\
198
+                PROC
199
+                EXPORT  DebugMon_Handler           [WEAK]
200
+                B       .
201
+                ENDP
202
+PendSV_Handler  PROC
203
+                EXPORT  PendSV_Handler             [WEAK]
204
+                B       .
205
+                ENDP
206
+SysTick_Handler PROC
207
+                EXPORT  SysTick_Handler            [WEAK]
208
+                B       .
209
+                ENDP
210
+
211
+Default_Handler PROC
212
+
213
+                EXPORT  WWDG_IRQHandler            [WEAK]
214
+                EXPORT  PVD_IRQHandler             [WEAK]
215
+                EXPORT  TAMPER_IRQHandler          [WEAK]
216
+                EXPORT  RTC_IRQHandler             [WEAK]
217
+                EXPORT  FLASH_IRQHandler           [WEAK]
218
+                EXPORT  RCC_IRQHandler             [WEAK]
219
+                EXPORT  EXTI0_IRQHandler           [WEAK]
220
+                EXPORT  EXTI1_IRQHandler           [WEAK]
221
+                EXPORT  EXTI2_IRQHandler           [WEAK]
222
+                EXPORT  EXTI3_IRQHandler           [WEAK]
223
+                EXPORT  EXTI4_IRQHandler           [WEAK]
224
+                EXPORT  DMA1_Channel1_IRQHandler   [WEAK]
225
+                EXPORT  DMA1_Channel2_IRQHandler   [WEAK]
226
+                EXPORT  DMA1_Channel3_IRQHandler   [WEAK]
227
+                EXPORT  DMA1_Channel4_IRQHandler   [WEAK]
228
+                EXPORT  DMA1_Channel5_IRQHandler   [WEAK]
229
+                EXPORT  DMA1_Channel6_IRQHandler   [WEAK]
230
+                EXPORT  DMA1_Channel7_IRQHandler   [WEAK]
231
+                EXPORT  ADC1_2_IRQHandler          [WEAK]
232
+                EXPORT  USB_HP_CAN1_TX_IRQHandler  [WEAK]
233
+                EXPORT  USB_LP_CAN1_RX0_IRQHandler [WEAK]
234
+                EXPORT  CAN1_RX1_IRQHandler        [WEAK]
235
+                EXPORT  CAN1_SCE_IRQHandler        [WEAK]
236
+                EXPORT  EXTI9_5_IRQHandler         [WEAK]
237
+                EXPORT  TIM1_BRK_IRQHandler        [WEAK]
238
+                EXPORT  TIM1_UP_IRQHandler         [WEAK]
239
+                EXPORT  TIM1_TRG_COM_IRQHandler    [WEAK]
240
+                EXPORT  TIM1_CC_IRQHandler         [WEAK]
241
+                EXPORT  TIM2_IRQHandler            [WEAK]
242
+                EXPORT  TIM3_IRQHandler            [WEAK]
243
+                EXPORT  TIM4_IRQHandler            [WEAK]
244
+                EXPORT  I2C1_EV_IRQHandler         [WEAK]
245
+                EXPORT  I2C1_ER_IRQHandler         [WEAK]
246
+                EXPORT  I2C2_EV_IRQHandler         [WEAK]
247
+                EXPORT  I2C2_ER_IRQHandler         [WEAK]
248
+                EXPORT  SPI1_IRQHandler            [WEAK]
249
+                EXPORT  SPI2_IRQHandler            [WEAK]
250
+                EXPORT  USART1_IRQHandler          [WEAK]
251
+                EXPORT  USART2_IRQHandler          [WEAK]
252
+                EXPORT  USART3_IRQHandler          [WEAK]
253
+                EXPORT  EXTI15_10_IRQHandler       [WEAK]
254
+                EXPORT  RTCAlarm_IRQHandler        [WEAK]
255
+                EXPORT  USBWakeUp_IRQHandler       [WEAK]
256
+
257
+WWDG_IRQHandler
258
+PVD_IRQHandler
259
+TAMPER_IRQHandler
260
+RTC_IRQHandler
261
+FLASH_IRQHandler
262
+RCC_IRQHandler
263
+EXTI0_IRQHandler
264
+EXTI1_IRQHandler
265
+EXTI2_IRQHandler
266
+EXTI3_IRQHandler
267
+EXTI4_IRQHandler
268
+DMA1_Channel1_IRQHandler
269
+DMA1_Channel2_IRQHandler
270
+DMA1_Channel3_IRQHandler
271
+DMA1_Channel4_IRQHandler
272
+DMA1_Channel5_IRQHandler
273
+DMA1_Channel6_IRQHandler
274
+DMA1_Channel7_IRQHandler
275
+ADC1_2_IRQHandler
276
+USB_HP_CAN1_TX_IRQHandler
277
+USB_LP_CAN1_RX0_IRQHandler
278
+CAN1_RX1_IRQHandler
279
+CAN1_SCE_IRQHandler
280
+EXTI9_5_IRQHandler
281
+TIM1_BRK_IRQHandler
282
+TIM1_UP_IRQHandler
283
+TIM1_TRG_COM_IRQHandler
284
+TIM1_CC_IRQHandler
285
+TIM2_IRQHandler
286
+TIM3_IRQHandler
287
+TIM4_IRQHandler
288
+I2C1_EV_IRQHandler
289
+I2C1_ER_IRQHandler
290
+I2C2_EV_IRQHandler
291
+I2C2_ER_IRQHandler
292
+SPI1_IRQHandler
293
+SPI2_IRQHandler
294
+USART1_IRQHandler
295
+USART2_IRQHandler
296
+USART3_IRQHandler
297
+EXTI15_10_IRQHandler
298
+RTCAlarm_IRQHandler
299
+USBWakeUp_IRQHandler
300
+
301
+                B       .
302
+
303
+                ENDP
304
+
305
+                ALIGN
306
+
307
+;*******************************************************************************
308
+; User Stack and Heap initialization
309
+;*******************************************************************************
310
+                 IF      :DEF:__MICROLIB           
311
+                
312
+                 EXPORT  __initial_sp
313
+                 EXPORT  __heap_base
314
+                 EXPORT  __heap_limit
315
+                
316
+                 ELSE
317
+                
318
+                 IMPORT  __use_two_region_memory
319
+                 EXPORT  __user_initial_stackheap
320
+                 
321
+__user_initial_stackheap
322
+
323
+                 LDR     R0, =  Heap_Mem
324
+                 LDR     R1, =(Stack_Mem + Stack_Size)
325
+                 LDR     R2, = (Heap_Mem +  Heap_Size)
326
+                 LDR     R3, = Stack_Mem
327
+                 BX      LR
328
+
329
+                 ALIGN
330
+
331
+                 ENDIF
332
+
333
+                 END
334
+
335
+;******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE*****

+ 1367
- 0
PjtKEIL_StepDFTREEL/StepDFT.uvprojx
File diff suppressed because it is too large
View File


+ 0
- 0
PjtKEIL_StepDeb_1/BacASable.uvprojx View File


+ 0
- 0
PjtKEIL_StepDeb_1/Driver/DriverJeuLaser.h View File


+ 0
- 0
PjtKEIL_StepDeb_1/Driver/DriverJeuLaser.inc View File


+ 0
- 0
PjtKEIL_StepDeb_1/RTE/_CibleSondeKEIL/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepDeb_1/RTE/_Simu/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepDeb_1/Src/Delay.s View File


+ 0
- 0
PjtKEIL_StepDeb_1/Src/principal.c View File


+ 0
- 0
PjtKEIL_StepDeb_1/Src/startup-rvds.s View File


+ 0
- 0
PjtKEIL_StepDeb_2/BacASable.uvprojx View File


+ 0
- 0
PjtKEIL_StepDeb_2/Driver/DriverJeuLaser.h View File


+ 0
- 0
PjtKEIL_StepDeb_2/Driver/DriverJeuLaser.inc View File


+ 0
- 0
PjtKEIL_StepDeb_2/RTE/_CibleSondeKEIL/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepDeb_2/RTE/_Simu/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepDeb_2/Src/Cligno.s View File


+ 0
- 0
PjtKEIL_StepDeb_2/Src/principal.c View File


+ 0
- 0
PjtKEIL_StepDeb_2/Src/startup-rvds.s View File


+ 0
- 0
PjtKEIL_StepSon/Driver/DriverJeuLaser.h View File


+ 0
- 0
PjtKEIL_StepSon/Driver/DriverJeuLaser.inc View File


+ 0
- 0
PjtKEIL_StepSon/RTE/_CibleSondeKEIL/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepSon/RTE/_CibleSondeST/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepSon/RTE/_Simu/RTE_Components.h View File


+ 0
- 0
PjtKEIL_StepSon/Src/GestionSon.s View File


+ 0
- 0
PjtKEIL_StepSon/Src/principal.c View File


+ 0
- 0
PjtKEIL_StepSon/Src/startup-rvds.s View File


+ 0
- 0
PjtKEIL_StepSon/StepSon.uvprojx View File


Loading…
Cancel
Save