Last commit

This commit is contained in:
Apollinaire Criquet 2023-05-30 11:31:41 +02:00
parent b69f899778
commit bea38306ca
10 changed files with 185 additions and 181 deletions

View file

@ -36,7 +36,6 @@
export DFT_ModuleAucarre_Im
export DFT_ModuleAuCarre
import LeSignal
DFT_ModuleAucarre_Reel proc
; LeSignal dans r0

View file

@ -7,7 +7,7 @@
import LongueurSon
include DriverJeuLaser.inc
export IndexSon
; ====================== zone de réservation de données, ======================================
@ -19,7 +19,7 @@
area maram,data,readwrite
SortieSon dcw 0 ; reserve seulement 2 octet de memoire
Index dcw 0
IndexSon dcw 0
; ===============================================================================================
@ -41,7 +41,7 @@ Index dcw 0
StartSon proc
ldr r0, = Index; ; On charge la valeur d'index
ldr r0, = IndexSon; ; On charge la valeur d'index
mov r1, #0
strh r1, [r0]
@ -51,19 +51,19 @@ StartSon proc
CallbackSon proc
push {lr}
ldr r0, = Index; ; On charge la valeur d'index
ldr r0, = IndexSon; ; On charge la valeur d'index
ldr r1, [r0] ;
ldr r2, = LongueurSon; ; On charge la valeur de la longueur son
ldr r3, [r2] ;
cmp r3, r1 ; On regarde si on est arrivé au bout du tableau
ble Sinon
ble fin
ldr r2, = Son; ; On charge la valeur de la bonne
ldrsh r3, [r2, r1, LSL #1] ; ligne de son
add r1, r1, #1 ; On store l'index et on l'incrémente de 1
strh r1, [r0]
add r1, r1, #1 ; On store l'index et on l'incrémente de 1
str r1, [r0]
;add r3, #32768 ; On ajoute 32768
mov r1, #360 ; On multiplie par 720
@ -73,12 +73,8 @@ CallbackSon proc
ldr r2, = SortieSon
strh r3, [r2] ; On sauvegarde la valeur dans SortieSon
b fin
Sinon
;mov r1, #0 ; On remet l'index à 0
str r0, [r1] ; On store l'index
fin
EXPORT SortieSon
mov r0, r3

View file

@ -1,68 +0,0 @@
AREA Signal, DATA, READONLY
export LeSignal
LeSignal
DCW 0x0800 ; 0 2048 0.50000
DCW 0x05ad ; 1 1453 0.35474
DCW 0x038e ; 2 910 0.22217
DCW 0x01d1 ; 3 465 0.11353
DCW 0x009c ; 4 156 0.03809
DCW 0x000a ; 5 10 0.00244
DCW 0x0027 ; 6 39 0.00952
DCW 0x00f2 ; 7 242 0.05908
DCW 0x0258 ; 8 600 0.14648
DCW 0x043b ; 9 1083 0.26440
DCW 0x0670 ; 10 1648 0.40234
DCW 0x08c9 ; 11 2249 0.54907
DCW 0x0b10 ; 12 2832 0.69141
DCW 0x0d13 ; 13 3347 0.81714
DCW 0x0ea7 ; 14 3751 0.91577
DCW 0x0fa8 ; 15 4008 0.97852
DCW 0x0fff ; 16 4095 0.99976
DCW 0x0fa8 ; 17 4008 0.97852
DCW 0x0ea7 ; 18 3751 0.91577
DCW 0x0d13 ; 19 3347 0.81714
DCW 0x0b10 ; 20 2832 0.69141
DCW 0x08c9 ; 21 2249 0.54907
DCW 0x0670 ; 22 1648 0.40234
DCW 0x043b ; 23 1083 0.26440
DCW 0x0258 ; 24 600 0.14648
DCW 0x00f2 ; 25 242 0.05908
DCW 0x0027 ; 26 39 0.00952
DCW 0x000a ; 27 10 0.00244
DCW 0x009c ; 28 156 0.03809
DCW 0x01d1 ; 29 465 0.11353
DCW 0x038e ; 30 910 0.22217
DCW 0x05ad ; 31 1453 0.35474
DCW 0x0800 ; 32 2048 0.50000
DCW 0x0a53 ; 33 2643 0.64526
DCW 0x0c72 ; 34 3186 0.77783
DCW 0x0e2f ; 35 3631 0.88647
DCW 0x0f64 ; 36 3940 0.96191
DCW 0x0ff6 ; 37 4086 0.99756
DCW 0x0fd9 ; 38 4057 0.99048
DCW 0x0f0e ; 39 3854 0.94092
DCW 0x0da8 ; 40 3496 0.85352
DCW 0x0bc5 ; 41 3013 0.73560
DCW 0x0990 ; 42 2448 0.59766
DCW 0x0737 ; 43 1847 0.45093
DCW 0x04f0 ; 44 1264 0.30859
DCW 0x02ed ; 45 749 0.18286
DCW 0x0159 ; 46 345 0.08423
DCW 0x0058 ; 47 88 0.02148
DCW 0x0000 ; 48 0 0.00000
DCW 0x0058 ; 49 88 0.02148
DCW 0x0159 ; 50 345 0.08423
DCW 0x02ed ; 51 749 0.18286
DCW 0x04f0 ; 52 1264 0.30859
DCW 0x0737 ; 53 1847 0.45093
DCW 0x0990 ; 54 2448 0.59766
DCW 0x0bc5 ; 55 3013 0.73560
DCW 0x0da8 ; 56 3496 0.85352
DCW 0x0f0e ; 57 3854 0.94092
DCW 0x0fd9 ; 58 4057 0.99048
DCW 0x0ff6 ; 59 4086 0.99756
DCW 0x0f64 ; 60 3940 0.96191
DCW 0x0e2f ; 61 3631 0.88647
DCW 0x0c72 ; 62 3186 0.77783
DCW 0x0a53 ; 63 2643 0.64526
END

View file

@ -1,68 +0,0 @@
AREA Signal, DATA, READONLY
export LeSignal
LeSignal
DCW 0x0fff ; 0 4095 0.99976
DCW 0x0ff6 ; 1 4086 0.99756
DCW 0x0fd9 ; 2 4057 0.99048
DCW 0x0fa8 ; 3 4008 0.97852
DCW 0x0f64 ; 4 3940 0.96191
DCW 0x0f0e ; 5 3854 0.94092
DCW 0x0ea7 ; 6 3751 0.91577
DCW 0x0e2f ; 7 3631 0.88647
DCW 0x0da8 ; 8 3496 0.85352
DCW 0x0d13 ; 9 3347 0.81714
DCW 0x0c72 ; 10 3186 0.77783
DCW 0x0bc5 ; 11 3013 0.73560
DCW 0x0b10 ; 12 2832 0.69141
DCW 0x0a53 ; 13 2643 0.64526
DCW 0x0990 ; 14 2448 0.59766
DCW 0x08c9 ; 15 2249 0.54907
DCW 0x0800 ; 16 2048 0.50000
DCW 0x0737 ; 17 1847 0.45093
DCW 0x0670 ; 18 1648 0.40234
DCW 0x05ad ; 19 1453 0.35474
DCW 0x04f0 ; 20 1264 0.30859
DCW 0x043b ; 21 1083 0.26440
DCW 0x038e ; 22 910 0.22217
DCW 0x02ed ; 23 749 0.18286
DCW 0x0258 ; 24 600 0.14648
DCW 0x01d1 ; 25 465 0.11353
DCW 0x0159 ; 26 345 0.08423
DCW 0x00f2 ; 27 242 0.05908
DCW 0x009c ; 28 156 0.03809
DCW 0x0058 ; 29 88 0.02148
DCW 0x0027 ; 30 39 0.00952
DCW 0x000a ; 31 10 0.00244
DCW 0x0000 ; 32 0 0.00000
DCW 0x000a ; 33 10 0.00244
DCW 0x0027 ; 34 39 0.00952
DCW 0x0058 ; 35 88 0.02148
DCW 0x009c ; 36 156 0.03809
DCW 0x00f2 ; 37 242 0.05908
DCW 0x0159 ; 38 345 0.08423
DCW 0x01d1 ; 39 465 0.11353
DCW 0x0258 ; 40 600 0.14648
DCW 0x02ed ; 41 749 0.18286
DCW 0x038e ; 42 910 0.22217
DCW 0x043b ; 43 1083 0.26440
DCW 0x04f0 ; 44 1264 0.30859
DCW 0x05ad ; 45 1453 0.35474
DCW 0x0670 ; 46 1648 0.40234
DCW 0x0737 ; 47 1847 0.45093
DCW 0x0800 ; 48 2048 0.50000
DCW 0x08c9 ; 49 2249 0.54907
DCW 0x0990 ; 50 2448 0.59766
DCW 0x0a53 ; 51 2643 0.64526
DCW 0x0b10 ; 52 2832 0.69141
DCW 0x0bc5 ; 53 3013 0.73560
DCW 0x0c72 ; 54 3186 0.77783
DCW 0x0d13 ; 55 3347 0.81714
DCW 0x0da8 ; 56 3496 0.85352
DCW 0x0e2f ; 57 3631 0.88647
DCW 0x0ea7 ; 58 3751 0.91577
DCW 0x0f0e ; 59 3854 0.94092
DCW 0x0f64 ; 60 3940 0.96191
DCW 0x0fa8 ; 61 4008 0.97852
DCW 0x0fd9 ; 62 4057 0.99048
DCW 0x0ff6 ; 63 4086 0.99756
END

View file

@ -1,4 +1,7 @@
#include "DriverJeuLaser.h"
#include "GestionSon.h"
#include "Affichage_Valise.h"
extern int DFT_ModuleAucarre_Reel(short int * Signal64ech, char k);
extern int DFT_ModuleAucarre_Im(short int * Signal64ech, char k);
@ -15,7 +18,44 @@ extern short int LeSignal[64];
// int somme_k = (int) (long long) somme_cos* (int) (long long) somme_cos + (int) (long long) somme_sin* (int) (long long) somme_sin;
// return somme_k;
//}
int Resultat[64];
int Resultat[6];
short dma_buf[64];
int Score [6] = { 0, 0, 0, 0, 0, 0};
int Fre [6] = {17, 18, 19, 20, 23, 24};
int Seuil = 2097152;
int buff;
void callback_Systick(){
Start_DMA1(64);
Wait_On_End_Of_DMA1();
Stop_DMA1;
for (int k =0; k <6; k++){
buff = DFT_ModuleAuCarre(dma_buf,Fre[k]);
Resultat[k] = buff;
}
for (int k=0; k<6; k++) {
if (Resultat[k]>Seuil) {
Score [k] ++;
StartSon ();
}
}
}
void callback_Affichage () {
Prepare_Afficheur (1, Score[1]);
Prepare_Afficheur (2, Score[2]);
Prepare_Afficheur (3, Score[3]);
Prepare_Afficheur (4, Score[4]);
Mise_A_Jour_Afficheurs_LED();
}
int main(void)
{
@ -23,12 +63,36 @@ int main(void)
// ============= INIT PERIPH (faites qu'une seule fois) =====================
// ===========================================================================
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
CLOCK_Configure();
Systick_Period_ff(360000);
Systick_Prio_IT(3,callback_Systick);
SysTick_On;
SysTick_Enable_IT;
Timer_1234_Init_ff( TIM1, 91*72);
Active_IT_Debordement_Timer( TIM1, 8, callback_Affichage );
Timer_1234_Init_ff( TIM3, 91*72);
PWM_Init_ff( TIM3, 3, 720);
GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL);
Timer_1234_Init_ff( TIM4, 91*72);
Active_IT_Debordement_Timer( TIM4, 5, CallbackSon );
Init_TimingADC_ActiveADC_ff( ADC1, 72 );
Single_Channel_ADC( ADC1, 2 );
Init_Conversion_On_Trig_Timer_ff( ADC1, TIM2_CC2, 225 );
Init_ADC1_DMA1( 0, dma_buf);
for (int k =0; k <64; k++){
Resultat[k] = DFT_ModuleAuCarre(LeSignal,k);
}
//============================================================================

View file

@ -357,7 +357,7 @@
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<IncludePath>.\Driver</IncludePath>
</VariousControls>
</Aads>
<LDads>
@ -414,10 +414,25 @@
<GroupName>son</GroupName>
<Files>
<File>
<FileName>Signal.asm</FileName>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\Signal.asm</FilePath>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\GestionSon.h</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>DFT</GroupName>
<Files>
<File>
<FileName>DFT.s</FileName>
<FileType>2</FileType>
@ -425,6 +440,21 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Affichage</GroupName>
<Files>
<File>
<FileName>Affichage_Valise.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\Affichage_Valise.h</FilePath>
</File>
<File>
<FileName>affichage_valise.o</FileName>
<FileType>3</FileType>
<FilePath>.\Src\affichage_valise.o</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>
@ -434,7 +464,7 @@
<TargetName>CibleSondeKEIL</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060750::V5.06 update 6 (build 750)::.\ARMCC</pCCUsed>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
@ -781,7 +811,7 @@
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<IncludePath>.\Driver</IncludePath>
</VariousControls>
</Aads>
<LDads>
@ -838,10 +868,25 @@
<GroupName>son</GroupName>
<Files>
<File>
<FileName>Signal.asm</FileName>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\Signal.asm</FilePath>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\GestionSon.h</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>DFT</GroupName>
<Files>
<File>
<FileName>DFT.s</FileName>
<FileType>2</FileType>
@ -849,6 +894,21 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Affichage</GroupName>
<Files>
<File>
<FileName>Affichage_Valise.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\Affichage_Valise.h</FilePath>
</File>
<File>
<FileName>affichage_valise.o</FileName>
<FileType>3</FileType>
<FilePath>.\Src\affichage_valise.o</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
<GroupOption>
@ -1331,10 +1391,25 @@
<GroupName>son</GroupName>
<Files>
<File>
<FileName>Signal.asm</FileName>
<FileName>bruitverre.asm</FileName>
<FileType>2</FileType>
<FilePath>.\Src\Signal.asm</FilePath>
<FilePath>.\Src\bruitverre.asm</FilePath>
</File>
<File>
<FileName>GestionSon.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\GestionSon.h</FilePath>
</File>
<File>
<FileName>GestionSon.s</FileName>
<FileType>2</FileType>
<FilePath>.\Src\GestionSon.s</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>DFT</GroupName>
<Files>
<File>
<FileName>DFT.s</FileName>
<FileType>2</FileType>
@ -1342,6 +1417,21 @@
</File>
</Files>
</Group>
<Group>
<GroupName>Affichage</GroupName>
<Files>
<File>
<FileName>Affichage_Valise.h</FileName>
<FileType>5</FileType>
<FilePath>.\Src\Affichage_Valise.h</FilePath>
</File>
<File>
<FileName>affichage_valise.o</FileName>
<FileType>3</FileType>
<FilePath>.\Src\affichage_valise.o</FilePath>
</File>
</Files>
</Group>
<Group>
<GroupName>::CMSIS</GroupName>
</Group>

File diff suppressed because one or more lines are too long