Fin du 1er TD
This commit is contained in:
		
							parent
							
								
									15cdcee56f
								
							
						
					
					
						commit
						1d1d62e535
					
				
					 4 changed files with 51 additions and 26 deletions
				
			
		|  | @ -10,7 +10,7 @@ | |||
|     <aExt>*.s*; *.src; *.a*</aExt> | ||||
|     <oExt>*.obj; *.o</oExt> | ||||
|     <lExt>*.lib</lExt> | ||||
|     <tExt>*.txt; *.h; *.inc</tExt> | ||||
|     <tExt>*.txt; *.h; *.inc; *.md</tExt> | ||||
|     <pExt>*.plm</pExt> | ||||
|     <CppX>*.cpp</CppX> | ||||
|     <nMigrate>0</nMigrate> | ||||
|  | @ -75,7 +75,7 @@ | |||
|       <OPTFL> | ||||
|         <tvExp>1</tvExp> | ||||
|         <tvExpOptDlg>0</tvExpOptDlg> | ||||
|         <IsCurrentTarget>1</IsCurrentTarget> | ||||
|         <IsCurrentTarget>0</IsCurrentTarget> | ||||
|       </OPTFL> | ||||
|       <CpuCode>18</CpuCode> | ||||
|       <DebugOpt> | ||||
|  | @ -154,6 +154,21 @@ | |||
|         </SetRegEntry> | ||||
|       </TargetDriverDllRegistry> | ||||
|       <Breakpoint/> | ||||
|       <WatchWindow1> | ||||
|         <Ww> | ||||
|           <count>0</count> | ||||
|           <WinNumber>1</WinNumber> | ||||
|           <ItemText>VarTime,0x10</ItemText> | ||||
|         </Ww> | ||||
|       </WatchWindow1> | ||||
|       <MemoryWindow1> | ||||
|         <Mm> | ||||
|           <WinNumber>1</WinNumber> | ||||
|           <SubType>0</SubType> | ||||
|           <ItemText>0x20000000 </ItemText> | ||||
|           <AccSizeX>0</AccSizeX> | ||||
|         </Mm> | ||||
|       </MemoryWindow1> | ||||
|       <Tracepoint> | ||||
|         <THDelay>0</THDelay> | ||||
|       </Tracepoint> | ||||
|  | @ -174,7 +189,7 @@ | |||
|         <AscS3>0</AscS3> | ||||
|         <aSer3>0</aSer3> | ||||
|         <eProf>0</eProf> | ||||
|         <aLa>0</aLa> | ||||
|         <aLa>1</aLa> | ||||
|         <aPa1>0</aPa1> | ||||
|         <AscS4>0</AscS4> | ||||
|         <aSer4>0</aSer4> | ||||
|  | @ -196,6 +211,13 @@ | |||
|       <pszMrulep></pszMrulep> | ||||
|       <pSingCmdsp></pSingCmdsp> | ||||
|       <pMultCmdsp></pMultCmdsp> | ||||
|       <LogicAnalyzers> | ||||
|         <Wi> | ||||
|           <IntNumber>0</IntNumber> | ||||
|           <FirstString>`VarTime</FirstString> | ||||
|           <SecondString>0080000000000000000000000000000080842E410000000000000000000000000000000056617254696D65000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000001000000000000000000F03F1200000000000000000000000000000000000000C4030008</SecondString> | ||||
|         </Wi> | ||||
|       </LogicAnalyzers> | ||||
|       <DebugDescription> | ||||
|         <Enable>1</Enable> | ||||
|         <EnableFlashSeq>0</EnableFlashSeq> | ||||
|  | @ -260,7 +282,7 @@ | |||
|       <OPTFL> | ||||
|         <tvExp>1</tvExp> | ||||
|         <tvExpOptDlg>0</tvExpOptDlg> | ||||
|         <IsCurrentTarget>0</IsCurrentTarget> | ||||
|         <IsCurrentTarget>1</IsCurrentTarget> | ||||
|       </OPTFL> | ||||
|       <CpuCode>18</CpuCode> | ||||
|       <DebugOpt> | ||||
|  | @ -339,11 +361,18 @@ | |||
|         </SetRegEntry> | ||||
|       </TargetDriverDllRegistry> | ||||
|       <Breakpoint/> | ||||
|       <WatchWindow1> | ||||
|         <Ww> | ||||
|           <count>0</count> | ||||
|           <WinNumber>1</WinNumber> | ||||
|           <ItemText>VarTime</ItemText> | ||||
|         </Ww> | ||||
|       </WatchWindow1> | ||||
|       <MemoryWindow1> | ||||
|         <Mm> | ||||
|           <WinNumber>1</WinNumber> | ||||
|           <SubType>257</SubType> | ||||
|           <ItemText>r0</ItemText> | ||||
|           <ItemText>0x00000000</ItemText> | ||||
|           <AccSizeX>0</AccSizeX> | ||||
|         </Mm> | ||||
|       </MemoryWindow1> | ||||
|  | @ -367,7 +396,7 @@ | |||
|         <AscS3>0</AscS3> | ||||
|         <aSer3>0</aSer3> | ||||
|         <eProf>0</eProf> | ||||
|         <aLa>0</aLa> | ||||
|         <aLa>1</aLa> | ||||
|         <aPa1>0</aPa1> | ||||
|         <AscS4>0</AscS4> | ||||
|         <aSer4>0</aSer4> | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ | |||
|       <TargetName>Simu</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> | ||||
|  | @ -1338,11 +1338,6 @@ | |||
|     <Layers> | ||||
|       <Layer> | ||||
|         <LayName><Project Info></LayName> | ||||
|         <LayDesc></LayDesc> | ||||
|         <LayUrl></LayUrl> | ||||
|         <LayKeys></LayKeys> | ||||
|         <LayCat></LayCat> | ||||
|         <LayLic></LayLic> | ||||
|         <LayTarg>0</LayTarg> | ||||
|         <LayPrjMark>1</LayPrjMark> | ||||
|       </Layer> | ||||
|  |  | |||
|  | @ -4,19 +4,20 @@ | |||
| 
 | ||||
| ; ====================== zone de réservation de données,  ======================================
 | ||||
| ;Section RAM (read only) :
 | ||||
| 	area    mesdata,data,readonly | ||||
| 	area    mesdata,data,readonly ; Déclaration de la variable
 | ||||
| 
 | ||||
| 
 | ||||
| ;Section RAM (read write):
 | ||||
| 	area    maram,data,readwrite | ||||
| 		 | ||||
| VarTime	dcd 0 | ||||
| VarTime	dcd 0 ; Réserve 32 bits en mémoire pour Vartime et on lui affecte la valeur 0
 | ||||
| 
 | ||||
| 	EXPORT VarTime ;On rend la variable globale pour pouvoir l'observer avec le débugger
 | ||||
| 	 | ||||
| ; ===============================================================================================
 | ||||
| 	 | ||||
| ;constantes (équivalent du #define en C)
 | ||||
| TimeValue	equ 900000 | ||||
| TimeValue	equ 900000 ; TimeValue = 900000 
 | ||||
| 
 | ||||
| 
 | ||||
| 	EXPORT Delay_100ms ; la fonction Delay_100ms est rendue publique donc utilisable par d'autres modules.
 | ||||
|  | @ -39,21 +40,21 @@ TimeValue	equ 900000 | |||
| ;
 | ||||
| ; et donc possède un intérêt pour débuter en ASM pur
 | ||||
| 
 | ||||
| Delay_100ms proc | ||||
| Delay_100ms proc ; début de procédure
 | ||||
| 	 | ||||
| 	    ldr r0,=VarTime  		   | ||||
| 	    ldr r0,=VarTime ; Stockage de l'adresse de VarTime dans r0	  
 | ||||
| 						   | ||||
| 		ldr r1,=TimeValue | ||||
| 		str r1,[r0] | ||||
| 		ldr r1,=TimeValue ; Stockage de l'adresse de TimeValue r1
 | ||||
| 		str r1,[r0] ; Ecriture de la valeur stockée dans r1 dans r0
 | ||||
| 		 | ||||
| BoucleTempo	 | ||||
| 		ldr r1,[r0]     				 | ||||
| BoucleTempo	 ; début de la boucle
 | ||||
| 		ldr r1,[r0] ; Stockage de la valeur pointée par r0 dans r1  				
 | ||||
| 						 | ||||
| 		subs r1,#1 | ||||
| 		str  r1,[r0] | ||||
| 		bne	 BoucleTempo | ||||
| 		subs r1,#1 ; Désincrémentation de la valeur de r1
 | ||||
| 		str  r1,[r0] ; Ecriture de la valeur de r1 dans r0
 | ||||
| 		bne	 BoucleTempo ; "Branch on Not Equal" --> Effectue un saut vers BoucleTempo si la valeur de r1 est différente de 0, sinon continue 
 | ||||
| 			 | ||||
| 		bx lr | ||||
| 		bx lr ; renvoie la valeur de lr
 | ||||
| 		endp | ||||
| 		 | ||||
| 		 | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ int main(void) | |||
| CLOCK_Configure(); | ||||
| 
 | ||||
| // configuration de PortB.1 (PB1) en sortie push-pull
 | ||||
| GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); | ||||
| GPIO_Configure(GPIOB, 1, OUTPUT, OUTPUT_PPULL); // 1 = 3.3V // 0 = 0V
 | ||||
| 	 | ||||
| 	 | ||||
| 	 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue