diff --git a/Etape_2.uvoptx b/Etape_2.uvoptx index a30a4b3..dabfc33 100644 --- a/Etape_2.uvoptx +++ b/Etape_2.uvoptx @@ -125,7 +125,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=15,39,661,712,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=463,144,884,571,1)(121=476,571,897,998,1)(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=18,101,612,852,0)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=-1105,32,-511,783,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=15,39,661,712,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=10,69,431,496,1)(121=30,595,451,1022,1)(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=18,101,612,852,0)(131=255,99,849,850,0)(132=49,93,643,844,0)(133=-1105,32,-511,783,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 @@ -142,7 +142,7 @@ 0 0 - 89 + 65 1
134222334
0 @@ -153,14 +153,14 @@ 1 .\Principale.asm - \\Simu_Etape0\Principale.asm\89 + \\Simu_Etape0\Principale.asm\65
1 0 - 59 + 66 1 -
134222326
+
134222338
0 0 0 @@ -169,14 +169,14 @@ 1 .\Principale.asm - \\Simu_Etape0\Principale.asm\59 + \\Simu_Etape0\Principale.asm\66
2 0 - 56 + 92 1 -
134222316
+
134222342
0 0 0 @@ -185,14 +185,14 @@ 1 .\Principale.asm - \\Simu_Etape0\Principale.asm\56 + \\Simu_Etape0\Principale.asm\92
3 0 - 118 + 171 1 -
134222508
+
134222642
0 0 0 @@ -201,14 +201,30 @@ 1 .\FonctionEtape2.asm - \\Simu_Etape0\FonctionEtape2.asm\118 + \\Simu_Etape0\FonctionEtape2.asm\171
4 0 + 170 + 1 +
134222638
+ 0 + 0 + 0 + 0 + 0 + 1 + .\FonctionEtape2.asm + + \\Simu_Etape0\FonctionEtape2.asm\170 +
+ + 5 + 0 80 1 -
134222362
+
134222370
0 0 0 @@ -219,22 +235,6 @@ \\Simu_Etape0\FonctionEtape.asm\80
- - 5 - 0 - 150 - 1 -
134222588
- 0 - 0 - 0 - 0 - 0 - 1 - .\FonctionEtape2.asm - - \\Simu_Etape0\FonctionEtape2.asm\150 -
6 0 @@ -254,7 +254,7 @@ 7 0 - 92 + 150 1
0
0 @@ -263,14 +263,14 @@ 0 0 0 - .\FonctionEtape.asm + .\FonctionEtape2.asm
8 0 - 82 + 182 1
0
0 @@ -279,14 +279,14 @@ 0 0 0 - .\Principale.asm + .\FonctionEtape2.asm
9 0 - 93 + 96 1
0
0 @@ -302,7 +302,7 @@ 10 0 - 94 + 97 1
0
0 diff --git a/FonctionEtape2.asm b/FonctionEtape2.asm index a27f770..0ddc754 100644 --- a/FonctionEtape2.asm +++ b/FonctionEtape2.asm @@ -14,6 +14,7 @@ EXPORT Set_SCLK EXPORT Reset_SCLK EXPORT DriverGlobal + EXPORT Tempo ;************************************************************************** @@ -32,6 +33,7 @@ SCLK EQU 5 SIN1 EQU 7 +MILSEC EQU 1304 PF DCD (1<<31) DataSend DCB 1 @@ -109,6 +111,24 @@ Reset_SCLK PROC ENDP +Tempo PROC + MOV R1,#10 ;******* + MUL R0,R0,R1 ;10*Argument + MOV R2,#MILSEC ;1304, la constante pour avoir 0.01ms + MOV R3,#0 ;0 +WHILE_NBMIL ;for(int i=0;i<10*Arg;i++) + ADD R3,R3,#1 ;i++ + MOV R1,#0 ;j=0 + CMP R3,R0 ;SI i==10*Arg alors on arrête la boucle + BXEQ LR +WHILE_NOPL ;for(int j=0;j<1304;j++) + NOP ;Timing + ADD R1,R1,#1 ;j++ + CMP R1,R2 ;SI j==1304 alors on arrête la sous-boucle + BNE WHILE_NOPL ;NON : On retourne dans cette boucle + B WHILE_NBMIL ;OUI : On retourne dans la surboucle + ENDP + ;**************************************************************************** ;R1 = *ValCourante ;R2 = NBLed (i) diff --git a/Principale.asm b/Principale.asm index 3e5a1d3..6f8a965 100644 --- a/Principale.asm +++ b/Principale.asm @@ -29,6 +29,7 @@ IMPORT Set_SCLK IMPORT Reset_SCLK IMPORT DriverGlobal + IMPORT Tempo EXPORT main @@ -60,7 +61,9 @@ main PROC ;******************************************************************************* ; ETAPE 2 ;******************************************************************************* - BL DriverGlobal; + BL DriverGlobal ;******************* + MOV R0, #10 ;Argument : 10ms + BL Tempo; :Tempo(10) ;******************************************************************************* ; ETAPE 1 diff --git a/README.md b/README.md index 64fcdd7..d8c70fa 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Le but sera de faire fonctionner diverses LEDS à l'aide d'un STM32 et tout cela |Set_X|**1** - R0 : PINAX||Pour un output donné, met à 1 ce dernier.| |Reset_X|**1** - R0 : PINAX||Pour un output donné, force à 0 ce dernier.| |DriverGlobal|||Pour une Barette de LED donnée, envoie les signaux demandés| +|Tempo|**1** - R0 : Nms||Pour un temps donné, le processeur se met en attente (similaire à sleep)| --- Chaque fonction prendra des arguments de R0 à R3 (avec R3 étant une référence au tas si le besoin d'argument est supérieur à 3). Le renvoi se fait sur R0.