| 
						
						
						
					 | 
					 | 
					@ -1,11 +1,10 @@ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* | 
					 | 
					 | 
					 | 
					;* | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Misto            : CVUT FEL, Katedra Mereni | 
					 | 
					 | 
					 | 
					;* Place            : CVUT FEL, Katedra Mereni | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Prednasejici     : Doc. Ing. Jan Fischer,CSc. | 
					 | 
					 | 
					 | 
					;* Lecturer         : Doc. Ing. Jan Fischer,CSc. | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Predmet          : A4M38AVS, A4B38NVS | 
					 | 
					 | 
					 | 
					;* Subject          : A4M38AVS, A4B38NVS | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Vyvojovy Kit     : STM32L100 DISCOVERY (STM32L100RC) | 
					 | 
					 | 
					 | 
					;* Development kit  : STM32L100 DISCOVERY (STM32L100RC) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Datum            : 12/2010, 10/2015 | 
					 | 
					 | 
					 | 
					;* Authors          : Michal TOMAS (2010), Ondrej Hruska (2015) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Autor            : Michal TOMAS (2010), Ondrej Hruska (2015) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* | 
					 | 
					 | 
					 | 
					;* | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -41,13 +40,14 @@ __use_two_region_memory | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Called by the startup script before calling __main | 
					 | 
					 | 
					 | 
					;* Called by the startup script before calling __main | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SystemInit | 
					 | 
					 | 
					 | 
					SystemInit	PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								EXPORT	SystemInit                      ; Export the address to startup script | 
					 | 
					 | 
					 | 
								EXPORT	SystemInit                      ; Export the address to startup script | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{LR} | 
					 | 
					 | 
					 | 
									PUSH	{LR} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BL		RCC_CNF                     ; Configure clock sources | 
					 | 
					 | 
					 | 
									BL		RCC_CNF                     ; Configure clock sources | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BL		GPIO_CNF                    ; Configure GPIO power and pin settings | 
					 | 
					 | 
					 | 
									BL		GPIO_CNF                    ; Configure GPIO power and pin settings | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BL		SYSTICK_CNF                 ; Configure SysTick timer | 
					 | 
					 | 
					 | 
									BL		SYSTICK_CNF                 ; Configure SysTick timer | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{PC} | 
					 | 
					 | 
					 | 
									POP		{PC} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -55,7 +55,7 @@ SystemInit | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Interrupt handlers... | 
					 | 
					 | 
					 | 
					;* Interrupt handlers... | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SysTick_Handler | 
					 | 
					 | 
					 | 
					SysTick_Handler PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								EXPORT SysTick_Handler                  ; Export the address to startup script (replaces a WEAK stub) | 
					 | 
					 | 
					 | 
								EXPORT SysTick_Handler                  ; Export the address to startup script (replaces a WEAK stub) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{LR} | 
					 | 
					 | 
					 | 
									PUSH	{LR} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -72,6 +72,7 @@ SysTick_Handler | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				STR		R1, [R0] | 
					 | 
					 | 
					 | 
					;				STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{PC} | 
					 | 
					 | 
					 | 
									POP		{PC} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -82,11 +83,8 @@ SysTick_Handler | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* __main is called only once, and does not return! | 
					 | 
					 | 
					 | 
					;* __main is called only once, and does not return! | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					__main | 
					 | 
					 | 
					 | 
					__main		PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								EXPORT	__main                          ; Export the address to startup script | 
					 | 
					 | 
					 | 
								EXPORT	__main                          ; Export the address to startup script | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									ENTRY                              ; Marks the program entry point (shouldnt be here) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					LOOP                                           		; Main loop | 
					 | 
					 | 
					 | 
					LOOP                                           		; Main loop | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; turn LED on | 
					 | 
					 | 
					 | 
									; turn LED on | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LDR		R0, =BB_GPIOC_ODR_8         ; bit-banding address | 
					 | 
					 | 
					 | 
									LDR		R0, =BB_GPIOC_ODR_8         ; bit-banding address | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -107,6 +105,7 @@ LOOP                                               ; Main loop | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BL		DELAY | 
					 | 
					 | 
					 | 
									BL		DELAY | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									B		LOOP | 
					 | 
					 | 
					 | 
									B		LOOP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -116,7 +115,7 @@ LOOP                                               ; Main loop | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Sets PC08 and PC09 as outputs, PA0 as input. | 
					 | 
					 | 
					 | 
					;* Sets PC08 and PC09 as outputs, PA0 as input. | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					GPIO_CNF | 
					 | 
					 | 
					 | 
					GPIO_CNF	PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{R0,R1,LR} | 
					 | 
					 | 
					 | 
									PUSH	{R0,R1,LR} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Enable GPIO peripheral timing | 
					 | 
					 | 
					 | 
									; Enable GPIO peripheral timing | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -139,10 +138,12 @@ GPIO_CNF | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LDR		R0, =GPIOA_MODER | 
					 | 
					 | 
					 | 
									LDR		R0, =GPIOA_MODER | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LDR		R1, [R0] | 
					 | 
					 | 
					 | 
									LDR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BIC		R1,R1, #GPIO_MODER_0 | 
					 | 
					 | 
					 | 
									BIC		R1,R1, #GPIO_MODER_0 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									ORR		R1,R1, #(GPIO_MODER_0 & GPIO_MODER_INPUT); Write the "input" pattern into the bit config area | 
					 | 
					 | 
					 | 
																		; Write the "input" pattern into the bit config area | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									ORR		R1,R1, #(GPIO_MODER_0 & GPIO_MODER_INPUT) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{R0,R1,PC} | 
					 | 
					 | 
					 | 
									POP		{R0,R1,PC} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -152,7 +153,7 @@ GPIO_CNF | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Configures SysTick to fire a SysTick interrupt at 1 Hz | 
					 | 
					 | 
					 | 
					;* Configures SysTick to fire a SysTick interrupt at 1 Hz | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					SYSTICK_CNF | 
					 | 
					 | 
					 | 
					SYSTICK_CNF	PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{R0, R1, LR} | 
					 | 
					 | 
					 | 
									PUSH	{R0, R1, LR} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Use the core clock (undivided) | 
					 | 
					 | 
					 | 
									; Use the core clock (undivided) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -176,6 +177,7 @@ SYSTICK_CNF | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{R0, R1, PC} | 
					 | 
					 | 
					 | 
									POP		{R0, R1, PC} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -185,7 +187,7 @@ SYSTICK_CNF | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Inputs:	R0 = number of loop cycles | 
					 | 
					 | 
					 | 
					;* Inputs:	R0 = number of loop cycles | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					DELAY | 
					 | 
					 | 
					 | 
					DELAY		PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{R2, LR}                    ; Push the changed registers & link register | 
					 | 
					 | 
					 | 
									PUSH	{R2, LR}                    ; Push the changed registers & link register | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					WAIT_OUTER		; Outer loop | 
					 | 
					 | 
					 | 
					WAIT_OUTER		; Outer loop | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -199,16 +201,17 @@ WAIT_INNER		SUBS	R2, R2, #1                 ; Decrement INNER loop counter | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BNE		WAIT_OUTER                  ; Continue the loop if not done | 
					 | 
					 | 
					 | 
									BNE		WAIT_OUTER                  ; Continue the loop if not done | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{R2, PC}                    ; Pop & return | 
					 | 
					 | 
					 | 
									POP		{R2, PC}                    ; Pop & return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
					 | 
					 | 
					 | 
					;*************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Konfigurace systemovych hodin a hodin periferii | 
					 | 
					 | 
					 | 
					;* Clock configuration | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* | 
					 | 
					 | 
					 | 
					;* | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;* Nastavi hodiny na HSI 16 MHz | 
					 | 
					 | 
					 | 
					;* Set clock speed to 16 MHz | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					RCC_CNF | 
					 | 
					 | 
					 | 
					RCC_CNF		PROC | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									PUSH	{R0, R1, LR} | 
					 | 
					 | 
					 | 
									PUSH	{R0, R1, LR} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Flash timing configuration | 
					 | 
					 | 
					 | 
									; Flash timing configuration | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -221,26 +224,14 @@ RCC_CNF | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									ORR		R1, R1, #(FLASH_ACR_PRFTEN :OR: FLASH_ACR_LATENCY) | 
					 | 
					 | 
					 | 
									ORR		R1, R1, #(FLASH_ACR_PRFTEN :OR: FLASH_ACR_LATENCY) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Nastavit hodinove vstupy | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LDR		R0, =RCC_CR | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Additional RCC_CR config | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				LDR		R1, [R0] | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				LDR		R2, =RCC_CR_RTCPRE ; clear RTC prescaler | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				BIC		R1, R1, R2 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				; HseByp allows to use external clock source with HSEON | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				LDR		R2, =(RCC_CR_RTCPRE_DIV2 :OR: RCC_CR_HSEBYP) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				ORR		R1, R1, R2 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;				STR		R1, [R0] | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Power on HSI (runs from MSI on start) | 
					 | 
					 | 
					 | 
									; Power on HSI (runs from MSI on start) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									LDR		R0, =RCC_CR | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									LDR		R1, [R0] | 
					 | 
					 | 
					 | 
									LDR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									ORR		R1, R1, #RCC_CR_HSION | 
					 | 
					 | 
					 | 
									ORR		R1, R1, #RCC_CR_HSION | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									; Wait for HSIRDY | 
					 | 
					 | 
					 | 
									; Wait for HSIRDY | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									ALIGN | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					NO_HSI_RDY		LDR		R1, [R0] | 
					 | 
					 | 
					 | 
					NO_HSI_RDY		LDR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									TST		R1, #RCC_CR_HSIRDY | 
					 | 
					 | 
					 | 
									TST		R1, #RCC_CR_HSIRDY | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									BEQ		NO_HSI_RDY | 
					 | 
					 | 
					 | 
									BEQ		NO_HSI_RDY | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -254,6 +245,7 @@ NO_HSI_RDY		LDR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
					 | 
					 | 
					 | 
									STR		R1, [R0] | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									POP		{R0, R1, PC} | 
					 | 
					 | 
					 | 
									POP		{R0, R1, PC} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								ENDP | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
					 | 
					 | 
					 | 
					;************************************************************************************************** | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |