当前位置:网站首页>Hardware knowledge 1 -- Schematic diagram and interface type (based on Baiwen hardware operation Daquan video tutorial)

Hardware knowledge 1 -- Schematic diagram and interface type (based on Baiwen hardware operation Daquan video tutorial)

2022-07-23 12:15:00 Mountains

One 、 Schematic diagram

Schematic diagram , It is a diagram showing the connection principle between devices on the circuit board . Through the analysis of the schematic diagram , You can understand the input and output of a module , See the specific parameters of each electronic component and the connection relationship between each component . Through the schematic diagram, users can quickly get familiar with some structures and relationships of the system .

1.1 Common devices

On the circuit board , Because of the limited space , It is impossible to write out the names of each component , So all kinds of devices are abstracted into symbols to represent . Use a specific number to indicate the type of components . For example, use R Represents resistance , A number added to the back indicates a specific resistance , Such as R1、R2、R3 Each represents three resistors .

 Insert picture description here

Through the above component number , The user can know the specific components on the circuit board .

1.2 Representation of device connection

1、 use attachment Indicates that there is a link between two devices .

 Insert picture description here

2、 use Network label Indicates that there is a link between two devices .

 Insert picture description here

As shown above , Add the same network label to the two lines , It means they are connected to each other . Three LED And MCU respectively 46、47、135 Pin to pin .

Two 、 Interface type

Interface is the connection mode between chips . Single chip computer through GPIO Connect with various modules , To transmit data 、 The signal . Interface types can be divided into the following :

1、 Ordinary GPIO Interface

Usually there is only one pin , Only responsible for output 、 Input high and low levels .

For example, output high and low level control LED、 Buzzer ; As the key input pin, judge whether the key is pressed .

2、 Protocol class GPIO Interface

One or more data lines transmit data according to a certain protocol , Pin is still output input high and low level , But the output and input are determined according to the Protocol , such as IIC agreement , Only when the clock line is low , Data line can be used for high-low level conversion , When the clock line is high , The data line must remain at the same level ( Start signal 、 Except for the end signal ).

This situation is generally used to transmit complex data , For example, with various sensors 、LCD Isoconnection .

Common protocols are IIC、SPI、CAN、FSMC etc. .

3、 Memory interface

For example, with Nor Flash、SDRAM、DDR、 network card DM9000 Isoconnection .

This kind of interface has address bus 、 data bus 、 Reading data 、 Write data and chip selection signals .

4、 Analog interface

The first three interfaces GPIO The input and output of are high and low levels , The level signal is not 0 Namely 1.

Analog interface GPIO Input and output are uncertain . The simple understanding is that the input and output are analog signals , It can change continuously , Can output 0-Vmax Any value between .

GPIO The operation process

For different chips ,GPIO The internal structure may vary , But they all have the following three functions .

1、 Functional selection
One pin , It can be connected to the module A, It can also be connected to the module B, For example, it can be used as ordinary GPIO Use , It can also be used as a serial port TXD Use .

So set some registers , Select the function used by the pin .

such as STM32F103 Of GPIO Function configuration , To configure GPIOx_CRL You can configure the GPIO The reuse mode of .
 Insert picture description here

2、 Set pin direction

Select whether the pin is input or output mode .

STM32F103 in , Also in GPIOx_CRL Middle configuration GPIO I / O mode of .
 Insert picture description here

3、 Read 、 Set pin level

stay GPIO Inside , There must be data registers , Save the level data of each pin .

such as STM32F103 in , Also in GPIOx_ODR Middle configuration GPIO Output , To which bit Write 1, The corresponding pin outputs high level .
 Insert picture description here

3、 ... and 、 Diode and triode

Diodes and triodes are used very frequently in circuits , Here is a brief introduction .

1、 diode

For diodes, you only need to know that diodes have unidirectional conductivity , He can only conduct in one direction .

 Insert picture description here

The current can only be positive (+) Flow to negative (-).V just - V negative > VAL Then conduct .VAL It's usually 0.7v, Different materials VAL It will be different .

The protection circuit can be made by using the single conductivity of diode , For example, prevent the reverse connection of the power supply . If the power supply is connected reversely , Then the diode is not conductive , No current can be formed .

2、 triode

The triode is also conductive only under certain conditions . It is often used as a switching circuit .

The triode is divided into PNP and NPN Two kinds of , But the principle is similar .

For triodes , Just remember Through the base b And the transmitter e On control collector c And the transmitter e On of .

NPN:

 Insert picture description here

Judge the current flow according to the arrow in the figure . If the base voltage Vb Greater than the emitter voltage Ve, be be There is continuity between , Which leads to ce There is continuity between . that V2 It is connected with low ,V2=0.

Usually Vb-Ve > 0.7v I think be There is continuity between , This voltage may vary depending on the material .

Vcon = 1,be Conduction ,ce Conduction ,V2 =0 Low level .

Vcon = 0,be end ,ce end ,V2 = V High level .

You can see ,V2 Voltage and Vcon The voltage is opposite , So a triode can be used as a reverse circuit .

PNP:

PNP Type triode and NPN Similar .
 Insert picture description here

Judge the current flow according to the arrow in the figure . If emitter voltage Ve Greater than base voltage Vb, be eb There is continuity between , Which leads to ec There is continuity between . that V2 Just like V Connected to a ,V2=V, High level .

Vcon = 1,eb end ,ec end ,V2 =0 Low level .

Vcon = 0,eb Conduction ,ec Conduction ,V2 = V High level .

Four 、 common GPIO circuit

With LED For example , Use GPIO control LED, Generally, there are several connection methods :

1、 Direct connection LED, The chip lights up

 Insert picture description here

This connection method is intuitive , Understandability . But the driving ability of chip pins may not be enough ,LED The maximum luminous intensity may not be reached .

2、 Direct connection LED, The external power supply is on

 Insert picture description here

This connection method GPIO Output low level ,LED Lit by an external power supply . But when the current enters the chip too much , It may burn the chip .

3、 Use 1 Three transistor connections , High level lighting

 Insert picture description here

GPIO Output high level ,LED By Vcc Lighten up , The current will not flow to the chip , So it won't burn the chip .

here GPIO Only high level can light up LED.

4、 Use 2 Three transistor connections , Low level on

 Insert picture description here

GPIO Output low level ,Q2 end ,Q1 Conduction ,LED By Vcc Lighten up , The current will not flow to the chip , Will not burn the chip .

here GPIO Low level on LED.
The above four connection methods , The latter two are usually used . For other components such as buzzer 、 Keys, etc. are the same as the above LED The connection method is similar .

原网站

版权声明
本文为[Mountains]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207230539103822.html