Preface
I searched for a long time in the blog garden to find the corresponding bare metal development program of mini2440. What disappointed me was that no one gave a detailed answer to the arm part. I didn't know how to do it and how to configure it. I was very confused. So I spent nearly a week reading books, looking up information, and browsing forums. Finally, I figured out the whole process by myself! And who said that students of ARM hardware platform don't do open source? As hardware dogs, we are also happy to share our projects with you!
Personal goal setting
Use the buzzer on the mini2440 to make a call.
Prepare
Mini2440 development board, keil 4 for arm
Keil Configuration
OK, first we need to create a new project
Project->new uvision project
After writing your project name, you need to choose your own CPU
OK, we chose Samsung's S3C2440A chip
Ask you whether to add Keil to the project, we choose no and configure it ourselves
Press F2 to modify the project name
Of course, we can also right-click and select Mange Project Items to manage our project
Click OK
Our project now has a complete system
The following is to set the keil target.
Find the button
Set the ROM start address. As for why it is 0x30000000, please check the chip manual.
Setting RAM
Set the location where the file is generated. We usually put it in the Out directory
Click select folder for objects
Choose the path you want
Check the run#1 item in USER to indicate how to connect during the compilation process.
The command is as follows:
fromelf.exe --bin -o ./out/@l.bin ./out/@l.axf
Since keil cannot generate bin files by default, you need to use the fromelf.exe tool to generate bin files
Header file introduction settings
OK, basically our project is set up!
Start your Beep journey
To operate the hardware, we must know what its circuit diagram looks like?
You see, we need to find the GPB0 port to operate the buzzer.
Then we need to operate this port, we must find its address, we go to find the MINI2440_CPU chip document
OK, we found the register of the GPB port
You have seen the GPB0 port in the chip manual, OK, then we should use the OUTPUT mode, um! Basically we have an idea.
OK, this is the register where we set the data, haha, that’s it!
Look at the blue line, English is really important! When the port is set as an output port, the GPBDAT register is set to the corresponding value.
Coding Time
OK, we have explained how to configure it very clearly above. A clear idea has been formed in our minds, and the following is how we can implement it.
Create a new blank file.
Then coded:
AREA RESET,CODE,READONLY ENTRY LDR R1, =0x56000010 LDR R2, =0x1 STR R2, [R1] MainLoop LDR R1, =0x56000014 LDR R2, =0x1 STR R2, [R1] LDR R1, =0xFFFFFF Delay1 SUB R1, R1, #1 CMP R1, #1 BNE Delay1 LDR R1, =0x56000014 LDR R2, =0x0 STR R2, [R1] LDR R1, =0xFFFFFF Delay2 SUB R1, R1, #1 CMP R1, #0 BNE Delay2 B MainLoop END
Save and save our file in demo.s format
Add our files to our src directory
Add existing file to ….
Compile
See the results:
Obviously, there is no error in this project. OK, use MINItool to download the bin file in the OUT directory!
Previous article:My story with ARM 2JINLK burning nor flash
Next article:ARM Architecture and Programming Series Blog - ARM's History and Application Scope
Recommended ReadingLatest update time:2024-11-16 13:57
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- DSP C6000 Architecture
- Application of millimeter wave radar technology in barriers
- (Bonus 3) GD32L233 Review - Unboxing and showing off the big box
- CPLD
- Help, after the load power supply has been working for a period of time, the microcontroller will shut down automatically
- The silk screen is AA6B SOT23-6 package with 2.2UH inductor 3.7~4.2V boost to 5V
- Add uart6 driver
- How fast can electric vehicles be “fast charged”?
- 5G millimeter wave RF algorithm technology
- Share NFC universal card reader circuit diagram