SHARE
TWEET

Untitled

a guest Nov 19th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; SysTickTestMain.s
  2. ; Runs on LM4F120/TM4C123
  3. ; Test the SysTick functions by activating the PLL, initializing the
  4. ; SysTick timer, and flashing an LED at a constant rate.
  5. ; Daniel Valvano
  6. ; September 12, 2013
  7.  
  8. ;  This example accompanies the book
  9. ;  "Embedded Systems: Introduction to ARM Cortex M Microcontrollers",
  10. ;  ISBN: 978-1469998749, Jonathan Valvano, copyright (c) 2014
  11. ;  Program 4.6, Section 4.3
  12. ;  Program 4.7, Section 4.4
  13. ;
  14. ;Copyright 2014 by Jonathan W. Valvano, valvano@mail.utexas.edu
  15. ;   You may use, edit, run or distribute this file
  16. ;   as long as the above copyright notice remains
  17. ;THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  18. ;OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  19. ;MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  20. ;VALVANO SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
  21. ;OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  22. ;For more information about my classes, my research, and my books, see
  23. ;http://users.ece.utexas.edu/~valvano/
  24.  
  25. GPIO_PORTF_DATA_R EQU 0x400253FC
  26.    
  27.         IMPORT   SYSTICK_INIT
  28.         IMPORT   SYSTICK_WAIT
  29.         IMPORT   PRECISE_DELAY
  30.         IMPORT   SYSTICK_READ
  31.         IMPORT     GPIOF_INIT
  32.        
  33.         AREA    |.text|, CODE, READONLY, ALIGN=2
  34.         THUMB
  35.         EXPORT  __main
  36. __main
  37.     BL SYSTICK_INIT                ; initialize SysTick timer
  38.     ; initialize Port F
  39. prevent
  40.     BL SYSTICK_READ
  41.     BL SYSTICK_READ
  42.     B prevent
  43.    
  44.     BL GPIOF_INIT
  45.    
  46.     LDR R4, =GPIO_PORTF_DATA_R            ;
  47.     LDR R5, [R4]                    ; R5 = [R4]
  48. loop
  49.     EOR R5, R5, #0x04               ; R5 = R5^0x04 (toggle PF2)
  50.     STR R5, [R4]                    ; [R4] = R5
  51.     MOV R0, #2000                      ; Ask for 100 ms
  52.     BL  PRECISE_DELAY
  53.     B   loop
  54.        
  55. ;-------------------------------------------------------------------
  56.     ALIGN                           ; make sure the end of this section is aligned
  57.     END                             ; end of file
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top