Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the different emphasis of single chip microcomputer linux-Android on hardware operation?

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Single-chip linux-Android hardware operation of the different focus is, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

1. Concept

As long as programming is involved and the hardware used is not a computer, it can be considered embedded software development. The so-called "embedding" is to embed the processor into an object so that it has computing power. For example, if there is a single-chip microcomputer in the watch, then the watch is an embedded device, and the single-chip microcomputer program developed above is embedded software; there is a powerful processor in the mobile phone, and it is also an embedded device, which runs the Linux system in the mobile phone and the Android system on the Linux system. These Linux and Android belong to embedded software.

Software or systems running on embedded devices can be divided into three categories: single-chip microcomputer, Linux/WinCE and other large operating systems, Android/IOS/QT and other GUI systems.

When making a product, we consider the ratio of performance to price and use whatever is appropriate, which requires us to have many aspects of development ability. This paper will introduce the emphasis of single-chip microcomputer, Linux and Android system.

two。 Which products use these three types of technologies?

No single technology can be applied to all devices, and most of the time it needs to be combined. For example, UAV can handle all kinds of control events faster with single-chip microcomputer, better image processing and transmission with Linux, and develop an Android APP for you on the mobile phone to make it easier to control.

3. Who has more job opportunities?

We're going to talk with the data, look at the following picture:

Surprisingly, Linux has the largest number of positions. It may be because many Internet products also use Linux, such as virtualization, cloud computing, cloud storage. These Internet companies and cloud products companies also have a large demand for Linux developers, so it is unfair to compare the positions of these companies with those of single-chip microprocessors.

So I'm going to break it down and separate out the Linux positions involving hardware operations, as follows:

These statistics are a little rough, but they can also explain some problems. Let me make a bar chart first:

Perhaps, we can draw such a conclusion: in the position of dealing with hardware, the number of single-chip microcomputer is the most, and the number of embedded Linux is 2/3 of single-chip microcomputer. If you count the number of positions in Linux APP, it seems unfair. Linux APP should be compared with JAVA and so on. The demand for these jobs is also consistent with reality, with the fewest hardware positions, more drivers and the most APP in a company. Most of the time, a few veteran employees in the APP position do all the driving work.

3.1 the threshold of job opportunities for single-chip microcomputer is the lowest

The light switches, washing machines, refrigerators, microwave ovens and other small appliances at your fingertips all use single-chip microcomputer technology; the wireless router and smart TV at home use Linux; the phone you use every day is either Android or Apple.

It can be guessed that the job opportunities of single-chip microcomputer are more concentrated in the field of small household appliances, the threshold is relatively low, and the space for simple technology to rise is also limited. Note that I'm talking about "technological upside". A few years ago, I expressed a view that "there is no future in learning single-chip computers", which was too intense and was scolded by many people. Today, I changed it to "only learning single-chip microcomputer has no future".

Recently, there is a master in teaching me the knowledge of CAN, CAN programming is basically only used in single-chip microcomputer, but Huawei can not hire him with an annual salary of 800000; and he has just begun to learn Linux. He sent me two pictures:

Take a look at the picture above, if you want to get a high salary, the SCM engineer must go deep into the industry and master the core technology of the industry. Otherwise, in terms of single-chip microcomputer technology alone, there is no big difference between 10 years of experience and 2 years of experience. It is easy for you to master the whole program from top to bottom, and you know all the problems. This is very comfortable, and it also means paralysis and crisis. Now 5G, the Internet of things era is coming, single-chip microcomputer will also have new development, I think the focus is on all kinds of RTOS, all kinds of Internet of things norms.

3.2 the number of Linux positions is the largest.

Before writing this article, I also tend to think that there are the most positions in single-chip microcomputer. However, after a rough search on 51JOB, linux has the largest number of positions, even if it only calculates the positions of "embedded linux", it has reached 2/3 of the posts of single-chip microcomputer. This may indicate that China's industrial upgrading, we are no longer satisfied with the use of single-chip microcomputer to complete simple functions, the need to add more and more dazzling functions.

If you are an electronic engineer, you may not have many opportunities to work closely related to hardware, such as "linux driver", because it requires you to have experience. This is the awkward part of the industry. MCU engineers want to change jobs, and the best fit is the position related to hardware programming in embedded Linux, but this position attaches too much importance to experience; in fact, it is easy to find Linux APP development of electronic products.

Now there is a trend in small and medium-sized companies that throwing a project to you requires your team to complete the APP, driver and hardware from top to bottom, and many people are generalists.

Therefore, the technology does not press the body, if you are an electronic engineer, single-chip microcomputer, Linux driver, Linux APP are mastered, perhaps the survivability can be greatly enhanced.

3.3 Android

The popularity of Android has gone down a bit. A small and medium-sized company can't really do Android without a certain amount of strength. This system is so huge that it takes one or two months to mismatch a Bluetooth card. So the companies that need to use Android are mostly purchasing solutions companies' boards, which can help you improve your Android system. After buying the solution, most of these companies are Android APP; people who want to study Android. Maybe it would be better to go to a mobile phone manufacturer or a solution company. For example, a subsidiary of iFLYTEK that I know uses Ruixin micro-series cards of Zhongshan firefly.

4 how does the single-chip microcomputer / Linux/Android engineer light the lamp?

The schematic diagram of the LED is as follows. As long as you let a pin output high or low level, you can turn the LED on or off.

4.1 how to light the lamp with single-chip microcomputer?

To put it simply, it is necessary for the engineer to look at the schematic diagram to determine which pin is and what level to output can light up the LED. Then look at the chip manual to determine how to operate the registers. Finally, write the program.

As for the program you write, it is entirely up to you to play with the style and the name of the function. If other colleagues want to reuse your code in the future, they will have to look at the instructions you wrote or your code.

Now ARM is introducing some HAL specifications, that is, stipulating some hardware operation function interfaces. If everyone abides by these specifications, the APP on the single-chip microcomputer can also be easily transplanted to other boards.

4.2 how does Linux light the lamp?

In Linux, the driver is responsible for operating the hardware, and APP can light up LED by calling standard interfaces such as open and write. When APP calls open, it causes led_open in the driver to be called; when APP calls write, it causes led_write in the driver to be called.

So, how do you write the driver? Led_open and led_write functions should be written out in the driver. Before writing these functions, the driver engineer should also look at the schematic diagram and the chip manual, which is the same as the single-chip microcomputer engineer. These led_open and led_write functions are then provided in accordance with the Linux specification. Therefore, Linux driver = driver framework + hardware operation = driver framework + MCU knowledge. Why bother to introduce a driver framework? Direct operation of the hardware is more cool and direct.

There are 21 reasons. Do not let the APP writers read the schematics and chip manuals. They only need to call the standard open,read,write and other interfaces to operate the hardware. 2. Software and hardware are isolated. No matter how the hardware changes, you only need to change the driver. APP does not need to change.

3.3How do I light the lamp in Android?

Android is a set of GUI system, which runs on Linux, and the hardware operation is completed by Linux. So you can think of Android as a set of APP, which also accesses the driver through interfaces such as open and write, and then operates the hardware.

But too many programs in Android are written in JAVA, these open and write are C language functions, so it is necessary to introduce a layer: JNI interface (Java Native Interface), through which Java can call C functions.

5. How do MCU / Linux/Android engineers use LCD?

Using lighting as an example is too simple to highlight the difference between single-chip microcomputer and Linux, but the difference between Linux and Android seems to be small.

Let's use LCD as an example to explain.

5.1 principles of LCD operation

Suppose the image above is a LCD screen, and a dense black dot on the screen is called a pixel, and each line has several dots. Imagine that there is an electron gun behind a pixel, and then emit three primary colors of red, green and blue to this pixel, and these three colors are combined into any one color in different proportions. Behind the pixel, the electron gun emits light of various colors as it moves. the electron gun moves from left to right, then jumps to the beginning of the next line, continues to move from left to right, and so on, all the way to the pixel in the lower right corner of the screen, and then jumps back to the origin.

Question 1: how does the electron gun move?

A: there is a pixel clock signal line (DCLK) connected to the screen. Every time a pixel clock signal (DCLK) comes, the electron gun moves one pixel.

Question 2: how to determine the color of the electron gun?

A: there are three sets of red, green and blue signal lines (RGB), which are connected to the screen and the colors are transmitted by these three sets of signal lines (RGB)

Question 3: when the electron gun moves to the right edge of the LCD screen, how do I know I need to jump to the beginning of the next line?

A: there is a horizontal synchronization signal line (HSYNC), which connects the screen. When the horizontal synchronization signal (HSYNC) is received, the electron gun jumps to the far left of the next line.

Question4: how does the electron gun know that it needs to jump to the origin?

A: there is a vertical synchronization signal line (VSYNC), which connects the screen. When the vertical synchronization signal line (VSYNC) is received, the electron gun jumps from the lower right foot of the screen to the upper left corner (origin).

Question 5: how does the electron gun know that the color determined by three sets of signal lines (RGB) is what it needs?

A: there is a RGB data enable signal line (DE) connected to the screen. When the data enable signal line (DE) is received, the electron gun knows that the color determined by these three sets of signal lines (RGB) is valid and can be transmitted to the pixel.

The following is a block diagram of the development board, LCD controller, and LCD screen.

The previously mentioned pixel clock (DCLK), three sets of red, green and blue signal lines (RGB), horizontal synchronization signal lines (HSYNC), vertical synchronization signal lines (VSYNC), and RGB data enable signal lines (DE) are all sent from the LCD controller, as long as the development board supports LCD display, it will certainly have a LCD controller.

Question: where does the data on the three sets of signal lines of 6:RGB come from?

The above figure is the block diagram of RGB data source, with a part of the area delineated in memory, which is called Framebuffer. In Framebuffer, we will construct the pixels corresponding to each color. The value in the Framebuffer is read by the LCD controller and transmitted to the electron gun through three sets of RGB wires, which then converts it to red, green and blue and hits it on the screen. For each pixel on the screen, there is a corresponding storage space in the Frambuffer, which contains the color of the corresponding pixel on the screen.

The LCD controller will repeatedly take pixel-by-pixel color values from the Framebuffer, send them to the electron gun, and need to match these signals with DCLK,VSYNC,HSYNC,DE.

To sum up, what the program needs to do is two points: set up the LCD controller, and then write the data in the video memory.

5.2 how to operate LCD by single-chip microcomputer

What the single-chip programmer needs to do is very straightforward: 1. Set up the LCD controller, which will automatically read the data of each pixel from the FrameBuffer and send it to the LCD. 2. Put the text and image to be displayed in the FrameBuffer.

5.3 how does Linux operate LCD?

In Linux, the driver is responsible for operating the hardware. APP can get the parameters of LCD and set LCD by calling standard interfaces such as open and ioctl. Then use mmap to get the address of the Framebuffer, and you can fill it with data. As for the setting of the LCD controller, this is done by the driver.

So, how do you write the driver? Initialize the LCD controller, provide lcd_open, lcd_ioctl, lcd_mmap functions, so that APP can obtain LCD parameters, set parameters, and obtain Framebuffer addresses through these functions. Therefore, Linux driver = driver framework + hardware operation = driver framework + MCU knowledge. Why bother to introduce a driver framework? Direct operation of the hardware is more cool and direct.

There are 21 reasons. Do not let the APP writers read the schematics and chip manuals. They only need to call the standard open,read,write,ioctl,mmap and other interfaces to operate the hardware. 2. Software and hardware are isolated. No matter how the hardware changes, you only need to change the driver. APP does not need to change.

5.4 how does Android operate LCD?

Android is a GUI system, which is similar to QT. In GUI systems such as Android/QT:

LCD will be used by multiple APP. If it is not managed uniformly, it will be messed up.

2.1 APP constructs its own interface and submits it to the display service software

2.2 display service software: merges the final display image according to the front and back levels of multiple APP

So, there must be a management software, or service software:

Finally, call the driver to display it.

Therefore, in the Android system, its focus is on the display service, on the cascading, management and destruction of multiple windows. The operation of the hardware is implemented by Linux.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report