Joinwin Electronics HK Limited518031About Join WinJoinwin Electronics HK Limited FLAT/RM 29, 22/F, YAN’S TOWER, 25-27 WONG CHUK HANG ROAD,ABERDEEN HONGKONG Shenzhen ZhongYiYingTong Technology Limited Room 1610, Block A, Overseas Decorative Building, Zhenhua Road,Huaqiang North Street, Shenzhen, 518031Join-Win will be your one-stop purchasing assistant. Join together, achieve win-win!Joinwin Electronics HK Limited518031About Join WinJoinwin Electronics HK Limited FLAT/RM 29, 22/F, YAN’S TOWER, 25-27 WONG CHUK HANG ROAD,ABERDEEN HONGKONG Shenzhen ZhongYiYingTong Technology Limited Room 1610, Block A, Overseas Decorative Building, Zhenhua Road,Huaqiang North Street, Shenzhen, 518031Join-Win will be your one-stop purchasing assistant. Join together, achieve win-win!Joinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics HK LimitedJoinwin Electronics

  1. Home
  2. News
  3. STM32 Getting Started Series - Linking STM32 Models to DMA

STM32 Getting Started Series - Linking STM32 Models to DMA

0
As a STM32 beginner, you will usually choose to acquire a development board, because there are a lot of modules that have been integrated on the development board, such as infrared module, key module, LED module, DAC module, ADC module, can module, 485 module, Ethernet module, WiFi module, buzzer module, SRAM module, display and so on. Some of you may want to use stm32 to do infrared detection cart, then you need to use infrared module; some of you may need to use WiFi module for communication product design.

The Main Presentation Is Divided Into Three Parts:

  • What is STM32;
  • The relationship between STM32 and ARM;
  • What STM32 can do.

What is STM32

Literally:
  1. ST: STMicroelectronics, a company name.
  2. M: Abbreviation for Microelectronics, indicating a microcontroller, note the difference between a microcontroller and a microprocessor.
  3. 32: 32bit means that this is a 32bit microcontroller.

The Relationship Between STM32 And ARM

ARM is a British chip design company, and its most successful products are nothing more than 32-bit embedded CPU cores - that is, we are now introduced to the ARM series, and the most commonly used are ARM7 and ARM9, ARM mainly provides IP (Intellectual Property ARM mainly provides IP (Intellectual Property core) core, that is, the core structure of the CPU, including only the most core part, rather than the complete processor.ARM sells this core to the various

ARM sells this core to major semiconductor companies, such as Philips, Samsung, ATMEL, and even Intel, etc. In order to improve the competitiveness of the 8-bit market, ARM launched a series of Cortex-M cores, the STM32 is the Cortex-M as a core, through a number of peripherals, such as a combination of packaged together into today's popular 32-bit embedded processors.
The ARMv7 architecture defines three families for different applications:

The "A" series: for virtual memory-based operating systems and user applications;
  • "R" series: for real-time systems;
  • The "M" series: for microcontrollers.
  • Cortex-M4 utilizes ARMv7-ME architecture, Cortex-M0 utilizes ARMv6-M architecture.
Cortex-A5/A8 adopts ARMv7-A architecture, and the traditional ARM7 series adopts ARMv4T architecture.

What The STM32 Can Do

The usefulness of the STM32 depends on its internal resources, as you learned earlier the STM32 has a very large number of internal communication interfaces. So if you use the module has this interface can communicate. For example:
  • USART: ESP8266 WIFI module, GSM module, Bluetooth module, GPS module, fingerprint identification module and so on.
  • IIC: EEPROM, MPU6050 gyroscope, 0.96-inch OLED screen, capacitive screen and so on.
  • SPI: Serial FLASH, Ethernet W5500, VS1003/1053 audio module, OLED screen with SPI interface, resistive screen, etc.
  • AD/DA: photosensitive sensor module, smoke sensor module, combustible gas sensor module, simple oscilloscope and so on.

What is DMA (Basic definition of DMA)

DMA, in full, is Direct Memory Access.

DMA transfer copies data from one address space to another, providing high-speed data transfer between peripherals and memory or between memory and memory.

We know that CPU has many functions such as transferring data, calculating, controlling program transfer, etc. The core of system operation is CPU.

CPU is always dealing with a large number of affairs, but some things are not so important, such as data copying and storing data, if we take out this part of the CPU resources, so that the CPU to deal with other complex computational affairs, is not a better use of CPU resources?

Therefore: transferring data (especially transferring large amounts of data) is possible without CPU involvement. For example, if you want to copy data from peripheral A to peripheral B, you only need to provide a data path for both peripherals, so that the data can be directly copied from A to B without CPU processing.

DMA Definition:

DMA is used to provide high-speed data transfers between peripherals and memory or between memory and memory. Without CPU intervention, data can be moved quickly through DMA. This saves CPU resources for other operations.

DMA Transfer Method

The role of DMA is to realize the direct transfer of data, and remove the traditional data transfer requires the involvement of the CPU registers, mainly involved in four cases of data transfer, but essentially the same, are transferred from one area of memory to another area of memory (peripheral data registers are essentially a storage unit of memory). The four cases of data transfer are as follows:
  • Peripheral to memory
  • Memory to peripheral
  • Memory to memory
  • Peripheral to peripheral

DMA Transfer Parameters

As we know, for data transfer, the first thing we need is 1 the source address of the data, 2 the destination address of the data transfer location, 3 the amount of data transfer to transfer the data, and 4 the number of times to transfer the transfer mode. The core parameters needed for DMA are these four.

When the user will set the parameters, mainly related to the source address, target address, the amount of data transferred these three, the DMA controller will start the data transfer, when the remaining amount of data transferred to 0 to reach the end of the transmission, the end of the DMA transmission, of course, the DMA there are also cyclic transmission mode, when it reaches the end of the transmission will restart the DMA transmission.
  
That is to say, as long as the amount of data remaining to be transferred is not zero, and the DMA is activated, then the data transfer will take place.

Key Features Of DMA

Each channel is directly connected to a dedicated hardware DMA request, and each channel equally supports software triggering. These features are configured through software;

Priority between multiple requests on the same DMA module can be set programmatically by software (there are four levels: very high, high, medium, and low), with hardware determining when priority settings are equal (request 0 is prioritized over request 1, and so on);
Transmission widths (byte, half-word, full-word) for independent data source and destination data areas, simulating the process of packing and unpacking. Source and destination addresses must be aligned by data transfer width;
Supports cyclic buffer management;
Each channel has 3 event flags (DMA Half Transfer, DMA Transfer Complete and DMA Transfer Error) which logically or become a single interrupt request;
Transfers between memory and memory, peripherals and memory, and memory and peripherals;
Flash memory, SRAM, SRAM of peripherals, APB1, APB2 and AHB peripherals can be used as sources and targets for accesses;
Number of programmable data transfers: maximum 65535.

STM32 Less DMA Resources?

For high-capacity STM32 chips there are 2 DMA controllers Two DMA controllers, DMA1 with 7 channels and DMA2 with 5 channels.
Each channel can be configured with some peripheral addresses.

① DMA1 controller

7 DMA requests generated from peripherals (TIMx[x=1,2,3,4], ADC1, SPI1, SPI/I2S2, I2Cx[x=1,2], and USARTx[x=1,2,3]) are input to DMA1 controller through logical or where each channel corresponds to a specific peripheral:
② DMA2 controller

5 requests generated from peripherals (TIMx[5, 6, 7, 8], ADC3, SPI/I2S3, UART4, DAC channels 1 and 2, and SDIO) are input to the DMA2 controller via logical or, where each channel corresponds to a specific peripheral:
 
TOP
RFQ List ( 0 items)