Software environment: ADS1.2
Hardware platform: GEC210 development board
Running method: Use uboot to download to memory 0x30008000, then use the go command to run and view the effect.
The effect of this program is that all the LEDs are lit at the beginning, and then they change according to the binary addition until all the lights are off, and then the cycle repeats. The program will not return to uboot, it is an infinite loop
Schematic Description:
The 4 LEDs are connected to the positive pole of the power supply through pull-up resistors, and the cathode of the LED is connected to the corresponding pins 0-3 of GPJ2io.
So these 4 LEDs will light up when the CPU outputs a low level, and will go out when the CPU outputs a high level
The program code is as follows:
AREA init,code,readonly; Set segment attributes, code segment, code segment name inti, read-only attribute
entry; entry, the same project should not have multiple entries
ldr r0,=0xe0200280; led corresponding GPIO control register
ldr r1,=0x1111 ;Configure as output mode
str r1,[r0] ;Configure the corresponding pin to output mode
loop0
mov r1,#0x0
loop
strb r1,[r0,#4]
add r1,r1,#1
bl delay
cmp r1,#0xf
bne loop
b loop0
mov pc,lr; if the go command is used in uboot, it will jump back to uboot
;Not applicable to this program because the previous one is an infinite loop.
;The delay function is to let the CPU do something that has nothing to do with the LED, such as subtraction.
delay
move r2, #0xff00000
delay1
subs r2,r2,#1
bne delay1
mov pc,lr; until it decreases to 0, the delay function will return
end
Note: If you use arm-linux-gcc to compile, pay attention to some differences in usage.
Previous article:Introduction to arm architecture registers
Next article:arm assembly pseudo-instructions and position-dependent codes
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- [Zhongke Bluexun AB32VG1 RISC-V Evaluation Board] Try to use RTThread multitasking
- CC3200 wireless wifi processor full voice interactive control smart home system
- Pre-registration for the prize live broadcast | ON Semiconductor's advanced image sensor solutions for the Internet of Things
- Excuse me, how does the electric meter with both steps and peaks and valleys work?
- Free | VIP tickets to EDI CON, the annual RF conference (Beijing, April 1-3)
- Year-end benefits! 2019 TI Industrial Applications Selected Courses Summary, Grab the Building to Win Gifts
- [OrCAD] How to display the name of the offpage connector after it is manually hidden?
- AD9 interface issues
- It seems like I'm in trouble. I dropped a bunch of chips on the ground. I have to pick them up with my hands or tweezers. I'm waiting online. It's urgent.
- 【LuatOS-ESP32】Development environment construction