Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; SysTickTestMain.s
- ; Runs on LM4F120/TM4C123
- ; Test the SysTick functions by activating the PLL, initializing the
- ; SysTick timer, and flashing an LED at a constant rate.
- ; Daniel Valvano
- ; September 12, 2013
- ; This example accompanies the book
- ; "Embedded Systems: Introduction to ARM Cortex M Microcontrollers",
- ; ISBN: 978-1469998749, Jonathan Valvano, copyright (c) 2014
- ; Program 4.6, Section 4.3
- ; Program 4.7, Section 4.4
- ;
- ;Copyright 2014 by Jonathan W. Valvano, valvano@mail.utexas.edu
- ; You may use, edit, run or distribute this file
- ; as long as the above copyright notice remains
- ;THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
- ;OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
- ;MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
- ;VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
- ;OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
- ;For more information about my classes, my research, and my books, see
- ;http://users.ece.utexas.edu/~valvano/
- GPIO_PORTF_DATA_R EQU 0x400253FC
- IMPORT SYSTICK_INIT
- IMPORT SYSTICK_WAIT
- IMPORT PRECISE_DELAY
- IMPORT SYSTICK_READ
- IMPORT GPIOF_INIT
- AREA |.text|, CODE, READONLY, ALIGN=2
- THUMB
- EXPORT __main
- __main
- BL SYSTICK_INIT ; initialize SysTick timer
- ; initialize Port F
- prevent
- BL SYSTICK_READ
- BL SYSTICK_READ
- B prevent
- BL GPIOF_INIT
- LDR R4, =GPIO_PORTF_DATA_R ;
- LDR R5, [R4] ; R5 = [R4]
- loop
- EOR R5, R5, #0x04 ; R5 = R5^0x04 (toggle PF2)
- STR R5, [R4] ; [R4] = R5
- MOV R0, #2000 ; Ask for 100 ms
- BL PRECISE_DELAY
- B loop
- ;-------------------------------------------------------------------
- ALIGN ; make sure the end of this section is aligned
- END ; end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement