Basic knowledge of "embedded Linux+arm" hardware (Gate circuit _UART_I2C_SPI)

Source: Internet
Author: User
Tags ack sdo

Some basic knowledge, even if the water, some basic knowledge of the circuit needs to understand, need to accumulate slowly, the actual work needs to accumulate the hardware related knowledge well;

Body Start:

1. Gate Circuit

Several signs with doors, or doors, and non-doors need to be remembered, especially the back two not to be confused, and draw them yourself again:


The actual circuit can be used in combination: such as with non-gate, or non-gate and other complex circuit.

These are relatively simple, do a simple review:

With gate: 1 1-->1 1 0-->0 0 1-->0 0 0-->0

OR gate: 1 1-->1 1 0-->1 0 1-->1 0 0-->0

Non-gate: 1-->0 0-->1

There are other combinations, such as with non-doors, or non-doors, etc.;


2. Pull- up resistor and pull-down resistor

It is primarily used to determine a point voltage, especially when the state of the point is uncertain.

The pull-up resistor is usually connected to the positive end of the power supply, which is connected to the related pin by a resistor, which can improve the driving capability;

The pull-down resistor has the function of signal protection.


3. the difference between the input pin and the output pin

is actually a GPIO, an old-fashioned thing;

Input pin: Read value from register

Output pin: Write value to register

Interrupt pin: 1. The function of the input pin, 2. The CPU can be interrupted.

In fact, a lot of gpio pin function can have multiple, such as a PIN can be used as a common IO pin, can also be reused as interrupt pin, serial port PIN, ad acquisition and so on;

4. build the embedded hardware environment:

Target Machine and host

The host is used for editing, compiling the program, the target machine is used to test and run the program;

Usually there are three kinds of connection methods;

jtag Connection (Burn write program)

Serial connection (Operation Bootloader and Linux)

Network (transfer file NFS);


5. UART Protocol

all protocol classes, normal use needs to meet two conditions:

You say that others can understand:--the agreement between the two parties to agree on the signal

You have to be able to keep up:---The two sides meet the timing requirements

Serial baud rate (difference from bit rate):

the rate at which a microcontroller or computer communicates at the serial port. Refers to the signal is modulated after the change in the unit time, that is , the number of times the carrier parameter changes in the unit time, such as 240 characters per second, and each character format contains 10 bits (a starting bit, 1 stop bit, 8 data bits), At this time the baud rate is 240Bd, bit rate is 10 bits * 240/second =2400bps. The number of bits transmitted per second, referred to as bit rate. Bit rate indicates the transfer rate of valid data, with B/s, bit/s, bit/sec, read: bits per second.

the relationship between baud rate and bit rate:

bitrate = Baud rate * Number of bits corresponding to a single modulation state

For example, if the data transfer rate is 120 symbols per second (SYMBOL/S) (that is, the baud rate is 120Baud), and assuming that each symbol is a 8 bit (bit), it transmits a bit rate of (120symbol/s) * (8bit/symbol) =960bps.

UART (using the SCI Protocol), Unlike SPI, the SPI is synchronous, and the SCI is asynchronous, and the SPI has a clock line more than the SCI;

Universal Async Receive/transmit Universal Asynchronous accept/transmitter-serial port;

How does the board transmit data to the host via the UART?

because the computer's serial port is RS232 level ( -3v-15v->1 3-15v->0), and the General MCU is TTL level (+5v->1 0v->0) so there needs to be a level shifter chip, such as max232 6.


6. I²c protocol

is actually two lines ( a data line SDA, a clock line SCL), but to configure the things are still a lot of;

2440 (2440 in the I²c controller) —————— can be multiple i²c devices.

Start signal: The SCL is high, and SDA jumps from high to low to start transmitting data.

End signal: When the SCL is high, SDA jumps from low to high, ending the transfer of data.

2440 stop Operation SDA, at which point the I²C device will pull the SDA low (send an ACK response signal)

Master waits for an ACK of slave after every 8bit data is sent.

That is, at the 9th clock, if the ACK,SDA from the IC will be pulled low.

If no ACK,SDA will be raised, this will cause master to occur restart or stop process


7.SPI Serial Peripheral Interface (Serial peripheral Interface)

SPI devices typically have output data pins (SDO), input data pins (SDI), clock Signal (SCLK), chip-select signal (CS)

The SPI communication principle is very simple, it works in the master-slave mode, which usually has a master device and one or more slave devices, requires at least 4 wires, in fact 3 can also (unidirectional transmission). It is also common to all SPI-based devices, which are SDI (data input), SDO (data output), SCLK (clock), CS (chip Select).

1) sdo– main equipment data output, from the device data input;

2) sdi– The main equipment data input, from the device data output;

3) sclk– clock signal, generated by the main equipment;

4) cs– from the device enable signal, controlled by the main device.


Note: Original article, reproduced please indicate the source:


Basic knowledge of "embedded Linux+arm" hardware (Gate circuit _UART_I2C_SPI)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.