diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_1/BacASable.uvoptx index ed76561..2224968 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 @@ -75,7 +75,7 @@ 1 0 - 1 + 0 18 @@ -153,7 +153,39 @@ -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 + 22 + 1 +
134218692
+ 0 + 0 + 0 + 0 + 0 + 1 + .\Src\principal.c + + \\BacASable\Src/principal.c\22 +
+
+ + + 0 + 1 + VarTime + + + + + 1 + 0 + 0x20000000 + 0 + + 0 @@ -174,7 +206,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -196,6 +228,18 @@ + + + 0 + ((portb & 0x00000002) >> 1 & 0x2) >> 1 + FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000E03F1300000000000000000000000000000000000000C0030008 + + + 1 + `VarTime + 00008000000000000000000000000000F8FF0F410000000000000000000000000000000056617254696D65000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004100000002000000000000000000E03F1300000000000000000000000000000000000000C4030008 + + 1 0 @@ -260,7 +304,7 @@ 1 0 - 0 + 1 18 @@ -339,6 +383,13 @@ + + + 0 + 1 + VarTime,0x0A + + 1 @@ -367,7 +418,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -389,6 +440,12 @@ + + + System Viewer\GPIOB + 35905 + + 1 0 diff --git a/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_1/BacASable.uvprojx index 9c192f5..47feae6 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 @@ -424,7 +424,7 @@ CibleSondeKEIL 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -528,9 +528,9 @@ DARMSTM.DLL -pSTM32F103RB SARMCM3.DLL - + -pSTM32F103RB TCM.DLL - -pCM3 + -pSTM32F103RB @@ -1338,11 +1338,6 @@ <Project Info> - - - - - 0 1 diff --git a/soft/PjtKEIL_StepDeb_1/Src/Delay.s b/soft/PjtKEIL_StepDeb_1/Src/Delay.s index bf49175..9ddba22 100644 --- a/soft/PjtKEIL_StepDeb_1/Src/Delay.s +++ b/soft/PjtKEIL_StepDeb_1/Src/Delay.s @@ -10,8 +10,8 @@ ;Section RAM (read write): area maram,data,readwrite -VarTime dcd 0 - +VarTime dcd 0 ; int VarTime = 0; + EXPORT VarTime ; =============================================================================================== @@ -21,6 +21,7 @@ TimeValue equ 900000 EXPORT Delay_100ms ; la fonction Delay_100ms est rendue publique donc utilisable par d'autres modules. + ;Section ROM code (read only) : area moncode,code,readonly @@ -41,19 +42,19 @@ TimeValue equ 900000 Delay_100ms proc - ldr r0,=VarTime + ldr r0,=VarTime ; r0 = &VarTime; - ldr r1,=TimeValue - str r1,[r0] + ldr r1,=TimeValue ; r1 = 900000; + str r1,[r0] ; *r0 = VarTime = 900000; BoucleTempo - ldr r1,[r0] + ldr r1,[r0] ; r0 = VarTime - subs r1,#1 - str r1,[r0] + subs r1,#1 + str r1,[r0] ; VarTime -= 1 bne BoucleTempo - bx lr + bx lr ; si timer == 0 retour de la fonction (fin du timer donc retour a l'execution du code) endp diff --git a/soft/PjtKEIL_StepDeb_1/Src/principal.c b/soft/PjtKEIL_StepDeb_1/Src/principal.c index a2e1f67..3532006 100644 --- a/soft/PjtKEIL_StepDeb_1/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_1/Src/principal.c @@ -3,30 +3,22 @@ extern void Delay_100ms(void); -int main(void) -{ +int main(void) { + // =========================================================================== + // ============= INIT PERIPH (faites qu'une seule fois) ===================== + // =========================================================================== -// =========================================================================== -// ============= INIT PERIPH (faites qu'une seule fois) ===================== -// =========================================================================== + // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers + CLOCK_Configure(); -// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers -CLOCK_Configure(); - -// configuration de PortB.1 (PB1) en sortie push-pull -GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); - - - - -//============================================================================ - - -while (1) - { + // configuration de PortB.1 (PB1) en sortie push-pull + GPIO_Configure(GPIOC, 12, OUTPUT, OUTPUT_PPULL); + + //============================================================================ + while (1) { Delay_100ms(); - GPIOB_Set(1); + GPIOC_Set(12); Delay_100ms(); - GPIOB_Clear(1); + GPIOC_Clear(12); } } diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx b/soft/PjtKEIL_StepDeb_2/BacASable.uvoptx index f1315bb..46a4e0a 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 @@ -75,7 +75,7 @@ 1 0 - 1 + 0 18 @@ -154,6 +154,13 @@ + + + 0 + 1 + FlagCligno + + 0 @@ -267,7 +274,7 @@ 1 0 - 0 + 1 18 diff --git a/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx b/soft/PjtKEIL_StepDeb_2/BacASable.uvprojx index d99d0f0..f01d9e2 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 @@ -424,7 +424,7 @@ CibleSondeKEIL 0x4 ARM-ADS - 5060750::V5.06 update 6 (build 750)::.\ARMCC + 5060960::V5.06 update 7 (build 960)::.\ARMCC 0 @@ -1338,11 +1338,6 @@ <Project Info> - - - - - 0 1 diff --git a/soft/PjtKEIL_StepDeb_2/Src/principal.c b/soft/PjtKEIL_StepDeb_2/Src/principal.c index 4d726a1..7307daf 100644 --- a/soft/PjtKEIL_StepDeb_2/Src/principal.c +++ b/soft/PjtKEIL_StepDeb_2/Src/principal.c @@ -17,7 +17,8 @@ CLOCK_Configure(); // configuration du Timer 4 en débordement 100ms //** Placez votre code là ** // - +Timer_1234_Init_ff(TIM4, 72*100000); +Active_IT_Debordement_Timer(TIM4, 2, timer_callback); // Activation des interruptions issues du Timer 4 @@ -29,7 +30,7 @@ CLOCK_Configure(); // configuration de PortB.1 (PB1) en sortie push-pull -GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); +GPIO_Configure(GPIOC, 12, OUTPUT, OUTPUT_PPULL); @@ -49,12 +50,12 @@ void timer_callback(void) if (FlagCligno==1) { FlagCligno=0; - GPIOB_Set(1); + GPIOC_Set(12); } else { FlagCligno=1; - GPIOB_Clear(1); + GPIOC_Clear(12); } } diff --git a/soft/PjtKEIL_StepSon/Src/GestionSon.s b/soft/PjtKEIL_StepSon/Src/GestionSon.s index 8a75b7a..8494b7d 100644 --- a/soft/PjtKEIL_StepSon/Src/GestionSon.s +++ b/soft/PjtKEIL_StepSon/Src/GestionSon.s @@ -6,25 +6,49 @@ ;Section RAM (read only) : area mesdata,data,readonly - + IMPORT LongueurSon + IMPORT Son + ;Section RAM (read write): area maram,data,readwrite +IndexSon DCW 0 +SortieSon DCW 0 + EXPORT SortieSon ; =============================================================================================== - - + EXPORT CallbackSon ;Section ROM code (read only) : area moncode,code,readonly ; écrire le code ici - - - - +CallbackSon proc + ldr r0, =IndexSon ; r0 = &IndexSon + ldrh r1, [r0] ; r1 = IndexSon + + ldr r2, =LongueurSon ; r2 = &LongueurSon + ldr r3, [r2] ; r3 = LongueurSon + + cmp r1, r3 + blt NoReset + mov r1, #0 ; si IndexSon >= LongueurSon alors IndexSon = 0 +NoReset + ldr r3, =Son ; r3 = &Son + ldrsh r2, [r3, r1, LSL#1] ; r2 = Son[IndexSon] + add r2, #0x8000 ; translater de [-32768;32767] à [0;65535] + mov r7, #720 ; r7 car pas besoin de le sauvegarder + mul r2, r7 ; on veut passer r2 de [0;65535] à [0;719], on multiplie par 720 puis LSR de 16 pour eviter une instruction de division + lsr r2, #16 + add r1, #1 ; r1 = IndexSon + 1 + str r1, [r0] ; IndexSon++; + ldr r0, =SortieSon ; r0 = &SortieSon + strh r2, [r0] ; SortieSon = ce qu'on veut + bx lr + + ENDP - - END \ No newline at end of file + END + \ No newline at end of file diff --git a/soft/PjtKEIL_StepSon/Src/principal.c b/soft/PjtKEIL_StepSon/Src/principal.c index d09be75..2dd039c 100644 --- a/soft/PjtKEIL_StepSon/Src/principal.c +++ b/soft/PjtKEIL_StepSon/Src/principal.c @@ -1,8 +1,6 @@ - - #include "DriverJeuLaser.h" - +extern void CallbackSon(void); int main(void) { @@ -13,14 +11,12 @@ int main(void) // Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers CLOCK_Configure(); - - - - - +GPIO_Configure(GPIOB, 0, OUTPUT, ALT_PPULL); +PWM_Init_ff(TIM3, 3, 720); +Timer_1234_Init_ff(TIM4, 6552); // (91*10^-6)*(72*10^6) = 6552 +Active_IT_Debordement_Timer(TIM4, 2, CallbackSon); //============================================================================ - while (1) { } diff --git a/soft/PjtKEIL_StepSon/StepSon.uvoptx b/soft/PjtKEIL_StepSon/StepSon.uvoptx index a13d7da..d8c97ae 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 @@ -154,6 +154,21 @@ + + + 0 + 1 + SortieSon + + + + + 1 + 1 + SP + 0 + + 0 @@ -174,7 +189,7 @@ 0 0 0 - 0 + 1 0 0 0 @@ -199,8 +214,8 @@ 0 - ((portb & 0x00000002) >> 1 & 0x2) >> 1 - FF000000000000000000000000000000E0FFEF400100000000000000000000000000000028706F7274622026203078303030303030303229203E3E2031000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000F03F160000000000000000000000000000000000000096020008 + `SortieSon + 008000000000000000000000000000905D78864100000000000000000000000000000000536F72746965536F6E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004100000001000000000000000000F03F0D0000000000000000000000000000000000000094080008 @@ -460,7 +475,7 @@ 1 0 - 1 + 0 18 @@ -666,6 +681,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..c69c3c5 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 @@ -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