From 31840fb6692c43be39107c8b966a0fedcd4cee1b Mon Sep 17 00:00:00 2001 From: Raph Date: Fri, 7 Apr 2023 15:14:54 +0200 Subject: [PATCH] Step 1 et 2 --- soft/PjtKEIL_StepDeb_1/BacASable.uvoptx | 124 ++++++++++++++++++++--- soft/PjtKEIL_StepDeb_1/BacASable.uvprojx | 120 +++++++++++++++++----- soft/PjtKEIL_StepDeb_1/Src/Delay.s | 19 ++-- soft/PjtKEIL_StepDeb_2/BacASable.uvoptx | 4 +- soft/PjtKEIL_StepDeb_2/BacASable.uvprojx | 9 +- soft/PjtKEIL_StepDeb_2/Src/Cligno.s | 78 ++++++++++++-- soft/PjtKEIL_StepDeb_2/Src/principal.c | 18 ++-- soft/PjtKEIL_StepSon/Src/principal.c | 4 +- soft/PjtKEIL_StepSon/StepSon.uvoptx | 40 +++++++- soft/PjtKEIL_StepSon/StepSon.uvprojx | 56 ++++++++-- 10 files changed, 388 insertions(+), 84 deletions(-) diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx index ed76561..93405f4 100644 --- a/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx +++ b/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -120,7 +120,7 @@ 0 DLGDARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=75,104,496,531,0)(121=859,154,1280,581,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=75,104,496,531,0)(121=859,154,1280,581,0)(122=-1,-1,-1,-1,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=-1,-1,-1,-1,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=-1,-1,-1,-1,0)(132=-1,-1,-1,-1,0)(133=1187,0,1781,751,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) 0 @@ -153,7 +153,44 @@ -U066CFF574857847167074929 -O2254 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(1BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F10x_128.FLM -FS08000000 -FL020000 -FP0($$Device:STM32F103RB$Flash\STM32F10x_128.FLM) - + + + 0 + 0 + 49 + 1 +
134220354
+ 0 + 0 + 0 + 0 + 0 + 1 + U:\grpE_REES_KOUTSODIMA\soft\PjtKEIL_StepDeb_2\Src\Cligno.s + + \\BacASable\../PjtKEIL_StepDeb_2/Src/Cligno.s\49 +
+
+ + + 0 + 1 + VarTime + + + 1 + 1 + FlagCligno + + + + + 1 + 1 + R0 + 0 + + 0 @@ -196,6 +233,13 @@ + + + 0 + ((PORTB & 0x00000002) >> 1 & 0x2) >> 1 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028504F5254422026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F1500000000000000000000000000000000000000DE030008 + + 1 0 @@ -367,7 +411,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -608,12 +652,12 @@ 1 1 - 1 - 1 + 2 + 0 0 0 - .\Src\principal.c - principal.c + ..\PjtKEIL_StepSon\Src\bruitverre.asm + bruitverre.asm 0 0 @@ -624,8 +668,32 @@ 0 0 0 - .\Src\Delay.s - Delay.s + ..\PjtKEIL_StepSon\Src\GestionSon.s + GestionSon.s + 0 + 0 + + + 1 + 3 + 1 + 0 + 0 + 0 + ..\PjtKEIL_StepSon\Src\principal.c + principal.c + 0 + 0 + + + 1 + 4 + 2 + 0 + 0 + 0 + ..\PjtKEIL_StepSon\Src\startup-rvds.s + startup-rvds.s 0 0 @@ -639,7 +707,7 @@ 0 2 - 3 + 5 2 0 0 @@ -659,7 +727,7 @@ 0 3 - 4 + 6 4 0 0 @@ -671,6 +739,38 @@ + + Son + 1 + 0 + 0 + 0 + + 4 + 7 + 2 + 0 + 0 + 0 + ..\PjtKEIL_StepSon\Src\bruitverre.asm + bruitverre.asm + 0 + 0 + + + 4 + 8 + 2 + 0 + 0 + 0 + ..\PjtKEIL_StepSon\Src\GestionSon.s + GestionSon.s + 0 + 0 + + + ::CMSIS 0 diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx index 9c192f5..6c550d0 100644 --- a/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx +++ b/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx @@ -10,7 +10,7 @@ Simu 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -357,7 +357,7 @@ - + ..\PjtKEIL_StepDeb_2\Driver @@ -384,14 +384,24 @@ Sources - principal.c - 1 - .\Src\principal.c + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm - Delay.s + GestionSon.s 2 - .\Src\Delay.s + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + principal.c + 1 + ..\PjtKEIL_StepSon\Src\principal.c + + + startup-rvds.s + 2 + ..\PjtKEIL_StepSon\Src\startup-rvds.s @@ -415,6 +425,21 @@ + + Son + + + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm + + + GestionSon.s + 2 + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + ::CMSIS @@ -424,7 +449,7 @@ CibleSondeKEIL 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -798,14 +823,24 @@ Sources - principal.c - 1 - .\Src\principal.c + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm - Delay.s + GestionSon.s 2 - .\Src\Delay.s + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + principal.c + 1 + ..\PjtKEIL_StepSon\Src\principal.c + + + startup-rvds.s + 2 + ..\PjtKEIL_StepSon\Src\startup-rvds.s @@ -829,6 +864,21 @@ + + Son + + + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm + + + GestionSon.s + 2 + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + ::CMSIS @@ -907,7 +957,7 @@ CibleSondeST 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -1281,14 +1331,24 @@ Sources - principal.c - 1 - .\Src\principal.c + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm - Delay.s + GestionSon.s 2 - .\Src\Delay.s + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + principal.c + 1 + ..\PjtKEIL_StepSon\Src\principal.c + + + startup-rvds.s + 2 + ..\PjtKEIL_StepSon\Src\startup-rvds.s @@ -1312,6 +1372,21 @@ + + Son + + + bruitverre.asm + 2 + ..\PjtKEIL_StepSon\Src\bruitverre.asm + + + GestionSon.s + 2 + ..\PjtKEIL_StepSon\Src\GestionSon.s + + + ::CMSIS @@ -1337,12 +1412,7 @@ - <Project Info> - - - - - + BacASable 0 1 diff --git a/soft/PjtKEIL_StepDeb_1/Src/Delay.s b/soft/PjtKEIL_StepDeb_1/Src/Delay.s index bf49175..d3562cc 100644 --- a/soft/PjtKEIL_StepDeb_1/Src/Delay.s +++ b/soft/PjtKEIL_StepDeb_1/Src/Delay.s @@ -4,19 +4,20 @@ ; ====================== zone de réservation de données, ====================================== ;Section RAM (read only) : - area mesdata,data,readonly + area mesdata,data,readonly ;directive AREA name,attr1,attr2 : dis a l'assembleur d'assembler une nouvelle zone de code de nom "name", de type "data" en lecture seulement ;Section RAM (read write): area maram,data,readwrite - -VarTime dcd 0 + + export VarTime +VarTime dcd 0 ; VarTime est une adresse qui pointe sur une variable de 4octets, initialisée à 0 (int VarTime = 0 en C) ; =============================================================================================== ;constantes (équivalent du #define en C) -TimeValue equ 900000 +TimeValue equ 900000 ; donne la valeur 900000 à TimeValue EXPORT Delay_100ms ; la fonction Delay_100ms est rendue publique donc utilisable par d'autres modules. @@ -44,16 +45,16 @@ Delay_100ms proc ldr r0,=VarTime ldr r1,=TimeValue - str r1,[r0] + str r1,[r0] ; place la valeur stockée dans le registre r1 (TimeValue) en mémoire vive à l'adresse VarTime BoucleTempo - ldr r1,[r0] + ldr r1,[r0] - subs r1,#1 + subs r1,#1 ;on soustrait 1 à la valeur de r1, le s va nous permettre de sortir de la boucle qui va commencer lorsqu'on va arriver à l'instruction bne str r1,[r0] - bne BoucleTempo + bne BoucleTempo ;tant que le flag Z est égal à 0, on refait la boucle à partir de BoucleTempo - bx lr + bx lr ; branch to link register : le compteur programme (adresse mémoire en cours d'execution) est écrasé par la valeur présente dans l'adresse de retour (lr) endp diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx index f1315bb..f7e4fec 100644 --- a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx +++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -200,7 +200,7 @@ 0 ((portb & 0x00000002) >> 1 & 0x2) >> 1 - FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F150000000000000000000000000000000000000096020008 diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx index d99d0f0..2c5376a 100644 --- a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx +++ b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx @@ -10,7 +10,7 @@ Simu 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -357,7 +357,7 @@ - + .\Driver @@ -1338,11 +1338,6 @@ <Project Info> - - - - - 0 1 diff --git a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s index 8a75b7a..8c80eb5 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/Cligno.s +++ b/soft/PjtKEIL_StepDeb_2/Src/Cligno.s @@ -1,6 +1,26 @@ PRESERVE8 - THUMB + THUMB + + include DriverJeuLaser.inc + export timer_callback + export FlagCligno + +;void timer_callback(void) +;{ +; if (FlagCligno==1) +; { +; FlagCligno=0; +; GPIOB_Set(1); +; } +; else +; { +; FlagCligno=1; +; GPIOB_Clear(1); +; } +; +;}*/ + ; ====================== zone de réservation de données, ====================================== ;Section RAM (read only) : @@ -9,7 +29,7 @@ ;Section RAM (read write): area maram,data,readwrite - +FlagCligno dcd 0 ; =============================================================================================== @@ -21,10 +41,52 @@ area moncode,code,readonly ; écrire le code ici - - - - +timer_callback proc +;void timer_callback(void) +;{ + push {lr} +; if (FlagCligno==1) + ldr r0,=FlagCligno + ldr r1,[r0] + cmp r1,#1 - - END \ No newline at end of file + +; { +; FlagCligno=0; + + beq alors +sinon + adds r1,#1 + str r1,[r0] + mov R0,#1 + bl GPIOB_Clear + b finsi +alors + subs r1,#1 + str r1,[r0] + + +; GPIOB_Set(1); + mov R0,#1 + bl GPIOB_Set + +; } +; else + + +; { +; FlagCligno=1; + +; GPIOB_Clear(1); + + +finsi + pop {lr} + bx lr +; } +; +;}*/ + + endp + + END \ No newline at end of file diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c index 4d726a1..2e9f55f 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c @@ -2,7 +2,9 @@ #include "DriverJeuLaser.h" -void timer_callback(void); +extern void timer_callback(void); + + int main(void) { @@ -17,22 +19,23 @@ CLOCK_Configure(); // configuration du Timer 4 en débordement 100ms //** Placez votre code là ** // - +Timer_1234_Init_ff( TIM4, 7200000); +Active_IT_Debordement_Timer( TIM4, 2, timer_callback ); // Activation des interruptions issues du Timer 4 // Association de la fonction à exécuter lors de l'interruption : timer_callback // cette fonction (si écrite en ASM) doit être conforme à l'AAPCS -//** Placez votre code là ** // - +//** Placez votre code là ** // + // configuration de PortB.1 (PB1) en sortie push-pull GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); - + //============================================================================ @@ -42,8 +45,9 @@ while (1) } } -char FlagCligno; +//char FlagCligno; +/* void timer_callback(void) { if (FlagCligno==1) @@ -57,5 +61,5 @@ void timer_callback(void) GPIOB_Clear(1); } -} +}*/ diff --git a/soft/PjtKEIL_StepSon/Src/principal.c b/soft/PjtKEIL_StepSon/Src/principal.c index d09be75..7e1db07 100644 --- a/soft/PjtKEIL_StepSon/Src/principal.c +++ b/soft/PjtKEIL_StepSon/Src/principal.c @@ -2,7 +2,7 @@ #include "DriverJeuLaser.h" - +extern u32 * PeriodeSonMicroSec; int main(void) { @@ -14,7 +14,7 @@ int main(void) // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers CLOCK_Configure(); - +Timer_1234_Init_ff( TIM4,*PeriodeSonMicroSec); diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx index a13d7da..ff2c5d5 100644 --- a/soft/PjtKEIL_StepSon/StepSon.uvoptx +++ b/soft/PjtKEIL_StepSon/StepSon.uvoptx @@ -10,7 +10,7 @@ *.s*; *.src; *.a* *.obj; *.o *.lib - *.txt; *.h; *.inc + *.txt; *.h; *.inc; *.md *.plm *.cpp 0 @@ -75,7 +75,7 @@ 1 0 - 0 + 1 18 @@ -460,7 +460,7 @@ 1 0 - 1 + 0 18 @@ -616,7 +616,7 @@ 1 1 1 - 0 + 1 0 0 .\Src\principal.c @@ -666,6 +666,38 @@ + + Son + 1 + 0 + 0 + 0 + + 4 + 4 + 2 + 0 + 0 + 0 + .\Src\bruitverre.asm + bruitverre.asm + 0 + 0 + + + 4 + 5 + 2 + 0 + 0 + 0 + .\Src\GestionSon.s + GestionSon.s + 0 + 0 + + + ::CMSIS 0 diff --git a/soft/PjtKEIL_StepSon/StepSon.uvprojx b/soft/PjtKEIL_StepSon/StepSon.uvprojx index d0b5c10..2849fe6 100644 --- a/soft/PjtKEIL_StepSon/StepSon.uvprojx +++ b/soft/PjtKEIL_StepSon/StepSon.uvprojx @@ -10,7 +10,7 @@ Simu 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -410,6 +410,21 @@ + + Son + + + bruitverre.asm + 2 + .\Src\bruitverre.asm + + + GestionSon.s + 2 + .\Src\GestionSon.s + + + ::CMSIS @@ -819,6 +834,21 @@ + + Son + + + bruitverre.asm + 2 + .\Src\bruitverre.asm + + + GestionSon.s + 2 + .\Src\GestionSon.s + + + ::CMSIS @@ -897,7 +927,7 @@ CibleSondeST 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -1297,6 +1327,21 @@ + + Son + + + bruitverre.asm + 2 + .\Src\bruitverre.asm + + + GestionSon.s + 2 + .\Src\GestionSon.s + + + ::CMSIS @@ -1322,12 +1367,7 @@ - <Project Info> - - - - - + StepSon 0 1