Design of Real-time Clock Display for LPC2294

Publisher:Xiaohan521Latest update time:2014-03-20 Source: elecfansKeywords:LPC2294 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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.

Debugging with debugging tools such as emulators

  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.

System boot for this chip and application

  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]

program
program
program
program

  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.

Keywords:LPC2294 Reference address:Design of Real-time Clock Display for LPC2294

Previous article:Application of Dual-Port RAM in ARM and DSP Communication System
Next article:Design of motor control system based on network technology

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号