Play with ARM basic functions

Publisher:楼高峰Latest update time:2018-02-01 Source: eefocusKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

     I embarked on the road of embedded development in a daze. Looking back, it was thanks to several friends around me that I slowly embarked on this road through chatting with them: from the earliest circuit design, PCB board making, circuit debugging, simulation, microcontroller development to the later ARM development. Looking back, I was also very nervous and treading on thin ice.

    I started working in electronics with AVR microcontrollers, playing around with I/O, buttons, memory, and peripherals. After I started working, I started playing with ARM. I gradually gained some insights into ARM development during the project.

 

    There are two purposes for learning ARM, depending on whether you are: 1. To gain knowledge and have fun; 2. To engage in ARM development for work. These should be treated separately.

    If you want to broaden your horizons, play around, and prepare for future work, then you should choose very mature devices on the market such as ARM7, ARM9, which have more information and more people playing with them, so problems that arise are easier to solve. If it is required for work, there will not be so many choices, and you must start conquering specific devices according to functional requirements.

    Regardless of the purpose, I feel the learning steps are similar, first bare board, then the operating system:

1.gif

    The reason for this arrangement is that I listened to many suggestions and opinions from experts. As the saying goes, "a tall building starts from the ground", the foundation is very important. Before installing the operating system, you must have a certain understanding of the underlying code, especially the bare board program. In this way, there will be fewer problems involving the underlying layer in the operating system.

    Now I will introduce some basic skills based on my experience of learning ARM11 (s3c6410-1176JZF).

    First of all: you need to have a certain basic knowledge of electronics.

    Isn't this nonsense? If you are playing with ARM, of course you know electronics. Actually, it's not true! Electronics foundation can be deep or shallow, how can it be a beginning? Knowing IC amplifiers and building signal processing circuits are the basic skills in signal processing. For ARM development, I feel that the focus is on signal routing, filtering , voltage regulation and maintaining stable chip performance (analyzing an ARM board will make you understand these principles).

    Let me share my opinion: Understand the functions of components other than integrated IC in ARM board, the most common ones are capacitors , driving LED , speakers , serial port connection, memory connection, LCD screen connection, etc. When you see the serial port, you will remember how to connect; when you see the button, you will remember how to identify it... Basically, the whole system can be connected in hardware.

    Secondly, you need to have a certain level of English reading ability.

    When I was developing, I used the Linux Application Complete Development Manual, the 6410 manual, and the ARM1176jzf kernel manual as the basis. These three documents, one in Chinese and two in English, have a total of 2,500 pages. If you don't have patience and want to complete the development as soon as possible, it's like looking for fish in a tree. The 6410 manual is an introduction to the ARM11 chip and a general introduction to the registers: including GPIO settings, camera interface, Nandflash controller, DRAM controller, etc. 1176jzf is an introduction to the settings of the 1176jzf processor.

2.jpg

    For simple GPIO settings, we can refer to the GPIO chapter of 6410.

3.jpg

    From this we can see the function of each group of pins: each group of pins is mixed multiplexed (except for GPI and GPJ). According to the knowledge of MCU, if the pins are multiplexed, the corresponding register settings must be used to meet the corresponding requirements. At this time, we need to look at the GPIO register setting chapter:

    For the GPA group,

4.jpg

    It can be seen that port A has read and write functions and has corresponding addresses. From the memory mapping diagram, it can be seen that port A can complete the corresponding operation by configuring the corresponding register (that is, the corresponding address) to a suitable value.

5.gif

    For the GPA0 pin, define it as input, output or serial port mode by configuring it to 0000, 0001 or 0010. The specific operations are as follows:

6.jpg

    Through these three operations, GPA0 can be set to output function, and if an external LED is used, the control of the LED light can be realized.

    In addition, there are data registers, pull-up control registers, configuration sleep and pull-up sleep registers. Their operating principles are the same. Put the corresponding register address into a register and write the value to complete the corresponding configuration.

    Third, you need to have some basic knowledge of assembly and C language.

    Why do I say that? First, let's look at the ARM startup code that configures the I/O port for simple input and output:

7.gif

    In the startup code of 6410, registers need to be set and configured in assembly language. Now let's analyze this part briefly:

    When writing a bare board program, you need to start with .globl and pass

8.jpg

    Map peripheral addresses to peripheral addresses, through

9.jpg

    Set the memory size to 256M. How to do it? Check the 1176jzf manual:

10.jpg
11.jpg

    It can be seen that the 6410 manual and the 1176jzf manual are a powerful tool for bare board programming.

    Fourth, learn by analogy, integrate knowledge, and utilize the Internet.

    A 6410 manual has 1378 pages, and a 1176jzf manual has 972 pages. It is an unattainable task to read them all, so it is necessary to be able to draw inferences from one example and integrate them. In addition, you also need the help of Google. During the development process, if you encounter new functions and new interfaces that have not been used before, Google can play its role as a god and lead you to complete the task.

    For example, in a write stack operation, the values ​​of each register need to be saved, and the stmdb instruction needs to be used. If you are not familiar with it, you can ask Google for help.

    Through the introduction, you can understand the specific operations.

    Although ARM is updated very quickly, it does not mean that we have to learn new technologies from scratch every time a new product comes out. As long as we are familiar with and master one MCU, we can expand the technology to the appropriate fields by learning from it.


Keywords:ARM Reference address:Play with ARM basic functions

Previous article:Analysis of wireless audio and video intercom system based on ARM Linux
Next article:Analysis of exception handling based on ARM processor

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号