I have summarized two types of chips: master and slave ). This method is just for convenience. Okay. Let's take a look at the master. Generally, this role can be called a SoC (system on chip), that is, a system-level chip. SOC can be divided into three types: MCU (micro control unit), MPU (micro processor unit), and DSP (DSP, there is no clear line between MPU and MCU, but I think this distinction is still very necessary.
Let's first look at a MCU manual. First look at a very commonStm32FromIFA semiconductor.Datasheet. Some people say that they do not look for Chinese characters. Generally, the chip manuals do not have Chinese characters, and the layout of the Chinese Chip manuals is generally not very standard, but it does not seem quite satisfactory. According to my experience in reading the manual, reading the manual has little to do with my own English skills.CET-4You can. If someone tells you to read the manual and learn English well, this kind of person is generally mixed.
First, let's look at the bookmarks next to it (Figure 2-1), which is equivalent to the directory where we read the book. The directory provides a basic overview of some information.
(Figure 2-1)
Generally, introduction is very short and has no content. skip this step. Description,
Here is (2-2 ).
Next let's take a look at the description:
(Figure 2-2)
We can get the following basic information:
1. The frequency reaches 72 MHz, and the flash memory in the chip is 128 K and sram20k.
2. Two APB buses (clock)
3. Two 12-bit ADCs are generally carried by MCU, but not by MPU.
4. Peripheral Bus I2C SPI usart USB can
Q: for these attributesStm32Where does it mean?
Da: 1. The clock is the heart of the chip, flash block storage, and static memory of SRAM. If you don't know about it, you should find a 51 book.
2. APB is designed to reduce power consumption. We can stop the clock corresponding to the peripherals when there is no need for some peripherals, and enable the clock when necessary, thus achieving the goal of saving power.
3. ADC (analog-to-digital converter) is not explained much.
4. For the peripheral bus system, we can raise a question:
What are these peripheral bus used?
Can we all guess that this is a standard, just like a socket, with three heads, two heads, and the Internet. So can these peripheral bus systems be connected to chips with the same peripheral bus configured? For convenience, do people propose a standard to regulate these chips, so that the SOC peripherals correspond to the chip peripherals one by one.
For our developers, do we have mastered the connections of digital circuits when we have mastered these peripheral buses. Is it possible to solve the complicated schematic diagram! OK. I will provide additional instructions later.
In description, there will be someClock Graph,Device Overview,Wait for these things to be constructed inside the chip to help you better understand the entire chip. Generally, you can look back at it.
The specific analysis of the specific situation is also complicated. I will write another special description.
(Figure 2-3)
Pin description (Figure 2-4)
Osc OS is system C, that is, clock. nc indicates that it is not connected to the internal system. Its significance lies in maintaining encapsulation.
GenerallyPin DefinitionsThe table details the role of each pin.
The red circle draws out reusable functions, which can be declared in the program.
Generally, these functions correspond to the peripheral bus, such as the I2C SPI usart USB can mentioned above. How to use these functions should not be obtained from the specific chip manual, the manual won't tell you everything. You should find Google or view the slave chip manual when using it (which may be ).
(Figure 2-4)
Electrical CharacteristicsElectrical characteristics are generally viewed by PCB engineers.
Package CharacteristicsEncapsulation features are generally viewed by PCB engineers.
Order CodesIt indicates that each chip model has different features, such as the flash size.
OK, so it will be over. It turns out that this manual is for hardware engineers. In general, I don't know how to draw a canvas, and the schematic diagram is okay. I am always too ugly to wiring. At first glance, I will know that I am a newbie.
So what should our driver engineers look?
Timeline chart! But it seems there is no such thing!
Let's find one. Let's take a look. Use Samsung 2440 in my hands. This is an MPU 32-bit, ARM 9 architecture. Stm32 is also a 32-bit chip cm3 architecture. After reading 2440, let's look at the differences between MCU and MPU.
We can see whether there are manyStm32The same peripheral bus, UART, I2C, SPI, USB.
Describe the ADC & touch here. The touchpad is not the same as the stm32 ADC. Stm32 is used for sampling, of course, it must be used as a touchpad I think it is also possible, but I have never used it, I used a TFT controller ra8875 with a touch module on it. Just connect touch pan to ra8875.
No.
(Figure 2-5)
OK. Let's take a look.
Let's look at SPI.
Four SPI modes, I will talk about the first one.
MSB (most significant bit) is the highest effective bit, that is, bit7.
Mosi -- master out slave in, that is, 2440 sends commands to peripheral SPI devices. We can see this sequence chart.
Communication Principles between chips,
B can understand what a says.
B is worth keeping up.
(1) We can see that the data is read when the rising edge of the Basic Public spiclock is listed, and a new data is prepared when the descending edge is listed. Cycle until the entire data is sent 8 bits.
In fact, SPI is a protocol agreed between chips. When writing a driver, we need to take care of both our master and the specific peripheral circuit. Spiclock cannot be too fast, otherwise slave will not respond.
OK, so we need to adjust the parameters of control registers in the master based on the specific chip to adapt to a specific chip or achieve the corresponding functions.