1 /*
2 * Realize the running light, LED1 LED2 LED3 LED4 are turned on and off in turn
3 */
4
5 .global _start
6 .section .text
7
8 _start:
9
10 /*
11 * set the CPU to SVC32 mode
12 */
13 mrs r0,cpsr
14 bic r0,r0,#0x1f @ clear the last 5 bits
15 orr r0,r0,#0xd3 @ 0b11010011, set the svc mod, and disable fiq irq
16 msr cpsr,r0
17
18 /*
19 * flush v4 I/D cahces
20 */
21 rice r0, #0
22 mcr p15, 0, r0, c7, c7, 0 /* flush v3/v4 cache */
23 mcr p15, 0, r0, c8, c7, 0 /* flush the v4 TLB */
24
25 /*
26 * disable MMU stuff and caches
27 */
28 mrc p15, 0, r0, c1, c0, 0
29 bic r0, r0, #0x00002300 @ clear bits 13, 9:8 (--V- --RS)
30 bic r0, r0, #0x00000087 @ clear bits 7, 2:0 (B--- -CAM)
31 orr r0, r0, #0x00000002 @ set bit 2 (A) Align
32 orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
33 mcr p15, 0, r0, c1, c0, 0
34
35 /* peripheral port register address range set */
36 ldr r0, =0x70000000 @the base address of peripheral port is 0x70000000
37 orr r0, #0x13 @address range is 256M, 0x7000 0000 -- 0x7FFF FFFF
38 mcr p15,0,r0,c15,c2,4
39
40 /* disable the watchdog */
41 ldr r0, =0x7E004000
42 mov r1, #0
43 pp r1, [r0]
44
45 b user_program
46
47 /*
48 * LED1 <----> GPK4
49 * LED2 <----> GPK5
50 * LED3 <----> GPK6
51 * LED4 <----> GPK7
52 */
53 user_program:
54 /************** control the led ***************/
55 /* control led1 GPK4 */
56 ldr r0, =0x7F008800
57 ldr r1, =0x11110000
58 str r1, [r0] /* set GPK4 GPK5 GPK6 GPK7 as output*/
59
60 ldr r0, =0x7F008808
61 ldr r1, [r0]
62 bic r1, #0x00F0
63
64 mov r2, #0xf
65 light_water:
66 orr r3,r1,r2,LSL #4
67 str r3, [r0]
68 bl delay
69 subs r2,r2,#1
70 moveq r2, #0xf
71 b light_water
72
73
74 delay:
75 mov r4,#0x20000
76 delay_loop:
77 subs r4,r4,#1
78 bne delay_loop
79 mov pc,lr @return
80
81 .end
Previous article:ARM-Linux S5PV210 UART driver (3) ----Serial port core layer, key structures, interface relationships
Next article:Use jlink+gdbserver+insight to debug ARM program--Configure insight
Recommended ReadingLatest update time:2024-11-23 07:47
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Key points of RF circuit and chip design
- TMS320C55x assembly language knowledge--macro instructions
- Instructions for using the Dacai IoT serial port screen to browse audio and video files in USB flash drives and SD cards
- Research on urban public transportation dispatching monitoring system
- About STM32 program download
- High voltage power quick connect terminal
- [AT-START-F425 Review] AT32F425 cannot create a project with RT_T
- The relationship between FPGA memories
- Latest MicroPython firmware for nRF52840D
- Talk about stepper motor control and stepper motor principle