Do UART Serial Ports Need DMA for Transmission?

Do UART Serial Ports Need DMA for Transmission?

DMA is a commonly used feature in embedded real-time task processing. Using DMA for UART data packet transmission can significantly reduce CPU processing time, preventing excessive waste of CPU resources, especially when transmitting a large number of data packets (such as high-frequency command transmissions). Brief Introduction to DMA DMA: Direct Memory Access. In simple terms, … Read more

How to Swap UART Rx and Tx Pins and Invert Levels

How to Swap UART Rx and Tx Pins and Invert Levels

Follow+Star Public Account, don’t miss wonderful content Source | AI Electronics Today I will share with you some features of UART in STM32, mainly targeting newer series of STM32 (such as: STM32H7, G0, G4, etc.), which allows changes to the Rx and Tx pins, level inversion, high-low order, and introduces timeout, etc. Embedded Column 1 … Read more

STM32G4 TIM+SPI+DMA Application Example

STM32G4 TIM+SPI+DMA Application Example

Currently, there are STM32 users developing products using the STM32G474R chip, where TIM1 is used for power drive, with TIM1 operating in center-aligned counting mode. There is a demand to trigger external ADC device sampling at the moment indicated by the arrow in the figure below during each cycle of TIM1. After the ADC completes … Read more

Why Does SPI DMA Circular Reception Fail When CRC Is Enabled?

Why Does SPI DMA Circular Reception Fail When CRC Is Enabled?

Someone is using the STM32G4 internal SPI configured as a slave full-duplex mode, using DMA for receiving. When the DMA is configured to CIRCULAR mode, problems occur where data transmission results in CRC verification failures and reception anomalies. If the DMA transfer mode is configured to NORMAL, there are no issues, and the received data … Read more

Can MCU Access Non-Standard SPI Interfaces?

Can MCU Access Non-Standard SPI Interfaces?

Currently, many precision analog-to-digital converters (ADCs) have a Serial Peripheral Interface (SPI) or some form of serial interface to communicate with controllers, including Microcontroller Units (MCUs), DSPs, and FPGAs. The controller writes to or reads from the internal registers of the ADC and reads the conversion codes. The PCB wiring for SPI is simple, and … Read more

Using MDK Built-in Logic Analyzer to Display Arbitrary Waveforms

Using MDK Built-in Logic Analyzer to Display Arbitrary Waveforms

I mentioned in a previous article about the information on outputting waveforms using the MDK built-in logic analyzer. I found that some people are interested in using the MDK built-in logic analyzer to implement waveform output. Below, I will use the STM32F334 DAC module to output an arbitrary waveform and display the waveform using the … Read more

Summary of STM32 Embedded Interview Topics

Summary of STM32 Embedded Interview Topics

Scan to follow "Learn Embedded Together", learn together, grow together. 1. What are the differences between STM32F1 and F4? Different cores: F1 has Cortex-M3 core, F4 has Cortex-M4 core; Different clock frequencies: F1 has a clock frequency of 72MHz, F4 has a clock frequency of 168MHz; Floating-point operations: F1 has no floating-point unit, F4 does; … Read more

Why Are 2 Data Points Lost During SPI Transmission?

Why Are 2 Data Points Lost During SPI Transmission?

Someone used the STM32F4 chip to validate the SPI functionality. When using two on-chip SPI modules for transmission and reception based on interrupts, it was found that there was always a loss of received data, seemingly losing the last 2 data points. The code used the HAL library’s API functions. What could be the reason? … Read more

Principles of Communication Protocol Design for Embedded Devices and PCs

Principles of Communication Protocol Design for Embedded Devices and PCs

Click below【Learn Embedded Together】 to follow, learn together, and grow together Embedded devices need to set parameters during operation, which is often accomplished by a PC. A communication protocol must be designed for both parties, with three representative protocols as follows: From the table above, it can be seen that embedded devices generally have limited … Read more