From b4f148a288e1673737f5b5a159c607eba64ce07b Mon Sep 17 00:00:00 2001 From: brunetto Date: Fri, 14 Apr 2023 18:18:39 +0200 Subject: [PATCH] =?UTF-8?q?StepDFT=20-=20Premi=C3=A8re=20=C3=A9tape=20-=20?= =?UTF-8?q?Non=20test=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soft/PjtKEIL_StepDFT/Src/DFT.s | 22 ++++++++- soft/PjtKEIL_StepDFT/Src/principal.c | 5 +- soft/PjtKEIL_StepDFT/StepDFT.uvoptx | 32 +++++++++++-- soft/PjtKEIL_StepDFT/StepDFT.uvprojx | 30 ++++++++++++ soft/Signal.asm | 68 ++++++++++++++++++++++++++++ 5 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 soft/Signal.asm diff --git a/soft/PjtKEIL_StepDFT/Src/DFT.s b/soft/PjtKEIL_StepDFT/Src/DFT.s index 3f6b5d4..273ec79 100644 --- a/soft/PjtKEIL_StepDFT/Src/DFT.s +++ b/soft/PjtKEIL_StepDFT/Src/DFT.s @@ -15,13 +15,33 @@ ; =============================================================================================== - ;Section ROM code (read only) : area moncode,code,readonly ; écrire le code ici +DFT_ModuleAuCarre proc + push {lr, r4, r5, r6} + mov r2, #0 ;Compteur de boucle + mov r3, #0 ;Partie Réelle + ldr r5, =TabCos +BOUCLER + cmp r2, #63 + bgt FINBOUCLER + mul r4, r1, r2 + and r4, #63 ; p + ldrh r4, [r5, r4, LSL #1] ; TabCos(p) + ldrh r6, [r0, r2, LSL #1] ; LeSignal(n) + mul r4, r6 + add r3, r4 + add r2, #1 + bl BOUCLER +FINBOUCLER + mov r0, r3 + pop {pc, r4, r5, r6} + endp + diff --git a/soft/PjtKEIL_StepDFT/Src/principal.c b/soft/PjtKEIL_StepDFT/Src/principal.c index d09be75..44e9fdd 100644 --- a/soft/PjtKEIL_StepDFT/Src/principal.c +++ b/soft/PjtKEIL_StepDFT/Src/principal.c @@ -2,7 +2,7 @@ #include "DriverJeuLaser.h" - +int DFT_ModuleAuCarre( short int * Signal64ech, char k); int main(void) { @@ -14,8 +14,6 @@ int main(void) // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers CLOCK_Configure(); - - //============================================================================ @@ -23,6 +21,7 @@ CLOCK_Configure(); while (1) { + //DFT_ModuleAuCarre( LeSignal, 17); } } diff --git a/soft/PjtKEIL_StepDFT/StepDFT.uvoptx b/soft/PjtKEIL_StepDFT/StepDFT.uvoptx index 0d72cfc..f6e9a5b 100644 --- a/soft/PjtKEIL_StepDFT/StepDFT.uvoptx +++ b/soft/PjtKEIL_StepDFT/StepDFT.uvoptx @@ -75,7 +75,7 @@ 1 0 - 0 + 1 18 @@ -267,7 +267,7 @@ 1 0 - 1 + 0 18 @@ -624,6 +624,30 @@ 0 0 + + 1 + 2 + 2 + 0 + 0 + 0 + .\Src\DFT.s + DFT.s + 0 + 0 + + + 1 + 3 + 2 + 0 + 0 + 0 + .\Src\Signal.asm + Signal.asm + 0 + 0 + @@ -634,7 +658,7 @@ 0 2 - 2 + 4 2 0 0 @@ -654,7 +678,7 @@ 0 3 - 3 + 5 4 0 0 diff --git a/soft/PjtKEIL_StepDFT/StepDFT.uvprojx b/soft/PjtKEIL_StepDFT/StepDFT.uvprojx index 9031782..63375da 100644 --- a/soft/PjtKEIL_StepDFT/StepDFT.uvprojx +++ b/soft/PjtKEIL_StepDFT/StepDFT.uvprojx @@ -388,6 +388,16 @@ 1 .\Src\principal.c + + DFT.s + 2 + .\Src\DFT.s + + + Signal.asm + 2 + .\Src\Signal.asm + @@ -797,6 +807,16 @@ 1 .\Src\principal.c + + DFT.s + 2 + .\Src\DFT.s + + + Signal.asm + 2 + .\Src\Signal.asm + @@ -1275,6 +1295,16 @@ 1 .\Src\principal.c + + DFT.s + 2 + .\Src\DFT.s + + + Signal.asm + 2 + .\Src\Signal.asm + diff --git a/soft/Signal.asm b/soft/Signal.asm new file mode 100644 index 0000000..afe6352 --- /dev/null +++ b/soft/Signal.asm @@ -0,0 +1,68 @@ + AREA Signal, DATA, READONLY + export LeSignal +LeSignal + DCW 0x0fff ; 0 4095 0.99976 + DCW 0x0737 ; 1 1847 0.45093 + DCW 0x0027 ; 2 39 0.00952 + DCW 0x0a53 ; 3 2643 0.64526 + DCW 0x0f64 ; 4 3940 0.96191 + DCW 0x043b ; 5 1083 0.26440 + DCW 0x0159 ; 6 345 0.08423 + DCW 0x0d13 ; 7 3347 0.81714 + DCW 0x0da8 ; 8 3496 0.85352 + DCW 0x01d1 ; 9 465 0.11353 + DCW 0x038e ; 10 910 0.22217 + DCW 0x0f0e ; 11 3854 0.94092 + DCW 0x0b10 ; 12 2832 0.69141 + DCW 0x0058 ; 13 88 0.02148 + DCW 0x0670 ; 14 1648 0.40234 + DCW 0x0ff6 ; 15 4086 0.99756 + DCW 0x0800 ; 16 2048 0.50000 + DCW 0x000a ; 17 10 0.00244 + DCW 0x0990 ; 18 2448 0.59766 + DCW 0x0fa8 ; 19 4008 0.97852 + DCW 0x04f0 ; 20 1264 0.30859 + DCW 0x00f2 ; 21 242 0.05908 + DCW 0x0c72 ; 22 3186 0.77783 + DCW 0x0e2f ; 23 3631 0.88647 + DCW 0x0258 ; 24 600 0.14648 + DCW 0x02ed ; 25 749 0.18286 + DCW 0x0ea7 ; 26 3751 0.91577 + DCW 0x0bc5 ; 27 3013 0.73560 + DCW 0x009c ; 28 156 0.03809 + DCW 0x05ad ; 29 1453 0.35474 + DCW 0x0fd9 ; 30 4057 0.99048 + DCW 0x08c9 ; 31 2249 0.54907 + DCW 0x0000 ; 32 0 0.00000 + DCW 0x08c9 ; 33 2249 0.54907 + DCW 0x0fd9 ; 34 4057 0.99048 + DCW 0x05ad ; 35 1453 0.35474 + DCW 0x009c ; 36 156 0.03809 + DCW 0x0bc5 ; 37 3013 0.73560 + DCW 0x0ea7 ; 38 3751 0.91577 + DCW 0x02ed ; 39 749 0.18286 + DCW 0x0258 ; 40 600 0.14648 + DCW 0x0e2f ; 41 3631 0.88647 + DCW 0x0c72 ; 42 3186 0.77783 + DCW 0x00f2 ; 43 242 0.05908 + DCW 0x04f0 ; 44 1264 0.30859 + DCW 0x0fa8 ; 45 4008 0.97852 + DCW 0x0990 ; 46 2448 0.59766 + DCW 0x000a ; 47 10 0.00244 + DCW 0x0800 ; 48 2048 0.50000 + DCW 0x0ff6 ; 49 4086 0.99756 + DCW 0x0670 ; 50 1648 0.40234 + DCW 0x0058 ; 51 88 0.02148 + DCW 0x0b10 ; 52 2832 0.69141 + DCW 0x0f0e ; 53 3854 0.94092 + DCW 0x038e ; 54 910 0.22217 + DCW 0x01d1 ; 55 465 0.11353 + DCW 0x0da8 ; 56 3496 0.85352 + DCW 0x0d13 ; 57 3347 0.81714 + DCW 0x0159 ; 58 345 0.08423 + DCW 0x043b ; 59 1083 0.26440 + DCW 0x0f64 ; 60 3940 0.96191 + DCW 0x0a53 ; 61 2643 0.64526 + DCW 0x0027 ; 62 39 0.00952 + DCW 0x0737 ; 63 1847 0.45093 + END