Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

DMA-based SPI communication method, electronic device, storage medium, and device

A communication method and technology of a communication device, which are applied in the computer field, can solve the problems that the function cannot realize the SPI communication of the external chip, the speed and efficiency of the program communication are low, and the running speed of the single-chip microcomputer is slowed down, so as to increase the stability, save the cost, and improve the operation. effect of speed

Active Publication Date: 2018-12-21
广州星雨光电设备有限公司
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The program communication speed and efficiency of this method are very low, occupying a large amount of time resources of the single-chip microcomputer, causing the running speed of the single-chip microcomputer to slow down, and when the function of the product is more complicated or there are many transactions to be processed, the SPI communication with the external chip cannot be realized.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • DMA-based SPI communication method, electronic device, storage medium, and device
  • DMA-based SPI communication method, electronic device, storage medium, and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0030] Below, the present invention will be further described in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of not conflicting, the various embodiments described below or the technical features can be combined arbitrarily to form new embodiments. .

[0031] DMA-based SPI communication method, such as figure 1 shown, including the following steps:

[0032] Initialize the SPI interface, after the processor is powered on, the SPI interface is initialized; in the present embodiment, the processor is specifically a single-chip microcomputer, preferably, in the initialization SPI interface, the transmission mode, mode of operation, data bits, and Transmission speed, specifically, the processor configures the SPI interface as the host bidirectional two-wire mode, the working mode is 0, the data bit is 8 bits, and the transmission speed is 10M.

[0033] Initialize the DMA program, and the processor initi...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a SPI communication method based on DMA, comprising the following steps: after the processor is powered on, the SPI interface is initialized; the processor initializes the receiving and transmitting configurations of the DMA; a main program of the processor cycle to detect the SPI interface, when the main program of the processor detects the data to be sent, the DMA is started to send the data to be sent in parallel, and when the data to be sent is finished, the DMA generates a transmission completion interrupt; a main program of the processor cycle to detect the SPI interface, when the main program of the processor detects the data to be receive, the DMA is started to receive the data to be received in parallel, and when the data to be received is received, the DMAgenerates a reception completion interrupt. The present invention relates to an electronic device and a readable storage medium for performing the method described above. The invention also relates toa DMA-based SPI communication device. The invention adopts the DMA technology and the interrupt generated by the DMA to enable the main program of the processor to quickly fetch the data and processthe data in the interrupt service program, thereby obviously reducing the time resource occupying of the single chip microcomputer.

Description

technical field [0001] The invention relates to the technical field of computers, in particular to a DMA-based SPI communication method, electronic equipment, storage media and devices. Background technique [0002] In the single-chip microcomputer system, there are usually many external chips connected to the single-chip microcomputer. These external chips can realize a specific function that the single-chip microcomputer cannot realize, such as data memory, temperature sensor, Ethernet network communication, etc. The single-chip microcomputer communicates with the external chip through a specific interface protocol, such as the SPI interface protocol, so as to achieve the purpose of controlling the external chip. Therefore, the speed and efficiency of the interface protocol for communicating with external chips is very important. [0003] At present, most single-chip microcomputers do not have integrated DMA function. The SPI communication method with external chips is us...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F13/30G06F13/42G06F13/38
CPCG06F13/30G06F13/385G06F13/4282G06F2213/3852G06F2213/0002
Inventor 刘润稼
Owner 广州星雨光电设备有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products