ARM (Advanced RISC Machine) is the name of the company that designed this processor core. The ARM core is not a chip. The ARM core is combined with other components, such as RAM, ROM, and on-chip peripherals, to form a real chip. ARM is a general name for a type of microprocessor. As a low-power, high-performance 32-bit embedded microprocessor, it has now been widely used in various fields.
ARM application development tools mainly include integrated development environment IDE, evaluation board and JTAG emulator. The most commonly used IDE in China are ARM's SDT, ADS and Embest IDE. Emulators include ARM's Muti-ICE and Embest series ARM JTAG emulators.
You can develop an embedded system on a PC, use the integrated development environment to write and compile and link to generate ARM processor execution code, then use debugging tools such as emulators to debug and download the code to the hardware, as shown in Figure 1.
In the process of programming and developing embedded systems, the main technical difficulty lies in the writing of the system boot program. For this purpose, a relatively complete small project is provided to analyze in detail the key code of the boot program when developing embedded systems based on ARM7, and briefly introduce the main functions of the application.
LPC2294 is based on a 16/32-bit ARM7TDMI-SCPU that supports real-time simulation and tracing, with 256 KB embedded high-speed Flash memory. It has extremely low power consumption, multiple 32-bit timers, RTC module, WDT module, etc.
This article mainly tries to write a project in the ARM small system with LPC2294 as the core, without using an operating system, and downloads it to the external memory of the development board (the external memory of the development board is 4 MB external 32-bit data bus width Flash memory). After connecting the VFD display module, the real-time clock is displayed successfully when running offline.
This project uses ADS development software, under CodeWarrior IDE integrated development environment, to compile and use AXD and TechorICE simulators from Techor to test and download the program. The VFD module uses PT6311 driver chip.
The engineering program is mainly divided into two parts: the system boot (BOOT) part and the application part.
1 System boot part
System boot (BOOT) is a section of code executed after the chip is reset and before entering the application program. It mainly provides a basic operating environment for running the application program and initializes the system hardware and software operating environment. These tasks are completed in assembly language and C language. It is the beginning of the application program in the embedded system. It is solidified in ROM together with the application program and runs on the system first.
Designing a good system boot (BOOT) is the key to designing embedded programs and is also a prerequisite for the normal operation of the system. The operations performed by the system boot (BOOT) mainly depend on the type of CPU core and the resources on the CPU chip that need to be used in the embedded system software being developed. The flow of the system boot (BOOT) code for this chip and application is shown in Figure 2.
The following is a key code analysis based on the relevant files of the startup code that appear in sequence when debugging the project in the on-chip RAM:; The vector table gives the program that should be executed when the CPU chip fails [page]
After the system boot module completes various initialization tasks, it uses a jump instruction to enter the main entrance of C Main, and from then on, the control is transferred to the C application. [page]
2 Application section
For each module in the LPC2294 chip used in this project, such as I/O port, RTC, TIMER1, all registers in the module should be initialized in the corresponding function first, so that they can be displayed smoothly when running offline.
The following is a brief introduction to the main functions used in the main.c program.
hitVfdl312();
This function first initializes all P0 ports of LPC2294 as GPIO ports. In this project, PO.6, P0.7 and P0.8 are set as outputs, and are connected to the data line, chip select line and clock line of the PT6311 module in hardware connection. Then, P0.6, P0.7 and P0.8 are used to send data to the VFD module, initialize the VFD, and add the initialization data. In fact, it is initialized to a blank space, and then all VFDs are lit.
RTCIni();
Initialize the real time clock and start the RTC.
TIMERl_InitTimef();
Initialize timer 1 and set it to generate an interrupt every 1ms, that is, set the MR0 bit in the IR of the timer; and reset the timer counter TC.
TIMERl_StartTimer();
Removes timer 1 from reset state and starts timing.
pollint();
Set the variables _mSet, _10mSct, and _100mSct, whose values represent the units of 1ms, 10ms, and 110ms respectively. As timer 1 is continuously set and reset, their values also change accordingly.
GetTime();
Every 1 second, read the time in the RTC and send it to the VFD buffer.
UpdateVfdl312();
Every 100ms, read the value in the VFD buffer and refresh the VFD display.
Conclusion
After applying the project to the external memory of the LPC2294-based development board, it can be run offline, the VFD real-time clock is fully lit, and the displayed time is correct.
LPC2294 is suitable for developing tax control equipment. There are many modules on the tax control equipment, and VFD customer display module is one of them, which can be used to display time.
Previous article:Application of Dual-Port RAM in ARM and DSP Communication System
Next article:Design of motor control system based on network technology
- Popular Resources
- Popular amplifiers
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
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- [15th Anniversary] Points Exchange - The last round of chip currency exchange, chip points are officially launched!
- My EEWorld 2018 year-end summary @ [chat, laugh, make noise]
- How to use a funnel amplifier to amplify current measurements?
- Share the open source information of the creative Coke power bank I collected, including schematics, PCB, and code
- Real-time control technologies meet the demands of real-time industrial communications – Part 3
- Share a STMF105RBT6 and 103RCT6_keil_C++ source program
- MSP430 MCU Example 3 - Colored Light Control
- EEWORLD University-What is an isolated gate driver?
- Burning image and mounting USB disk with busybox file system failed
- Switching Circuit