Traditional Culture Encyclopedia - Traditional customs - Single chip microcomputer communicates with computer through USB interface.

Single chip microcomputer communicates with computer through USB interface.

As shown in the figure: MCU 5 1 and temperature sensor 18B02 are required. Serial port line from USB to RS485. Use the serialport control to set communication parameters directly, and then send data to the serial port.

For example, send 1, and then use the event trigger to receive the data of the single chip microcomputer. If there is no problem in communication between the two parties, the computer will receive 2, and then display it or do other processing.

Extended data:

The controller consists of a program counter, an instruction register, an instruction decoder, a timing generator and an operation controller. It is the "decision-making body" that issues orders, that is, it coordinates and directs the operation of the whole microcomputer system. Its main functions are:

(1) fetches an instruction from memory and indicates the location of the next instruction in memory.

(2) Decode and test the instructions, and generate corresponding operation control signals to facilitate the execution of the specified actions.

(3) Command and control the direction of data flow among CPU, memory and input/output devices.

The microprocessor interconnects the ALU, the counter, the register and the control part through the internal bus, and is connected with the external memory and the input/output interface circuit through the external bus.

The external bus, also known as the system bus, is divided into data bus DB, address bus AB and control bus CB. Through the input and output interface circuit, the connection with various peripheral devices is realized.

Baidu encyclopedia-single chip microcomputer

Baidu encyclopedia-communication circuit