No video

Tutorial CubeMX- 8- ADC_DMA+USART_DMA STM32F4 Discovery

  Рет қаралды 34,074

Sever Spanulescu

Sever Spanulescu

8 жыл бұрын

Using HAL API and Cube Mx, we program an ADC in DMA circular mode, and the results are transmitted using USART with DMA. The very high speed of the transmission needs a proper USB-TTL adapter (FTDI and CH340 worked well, other China clones didn't!).
© Universitatea Hyperion 2016.
www.hyperion.ro

Пікірлер: 23
@NowYouTravel
@NowYouTravel 7 жыл бұрын
This is the most beneficial video about DMA I've ever seen :) Thank you master.
@kgriffi22222
@kgriffi22222 5 жыл бұрын
great tutorial on DMA, i need to use the ADC to read consistently while needing the cpu and this has helped understanding if it. kudos
@Tp_Tp_TimePass
@Tp_Tp_TimePass 5 жыл бұрын
Thank you so much, sir, very nice tutorial. for terminal output required FTDI board.
@oas3610
@oas3610 7 жыл бұрын
Thank you so much!! What you show me via your video is so clear.
@SeverSpanulescu
@SeverSpanulescu 7 жыл бұрын
For 12 bit transmission, one must select it in Cube configuration and in the main.c the converted value must be included in a string containing the four digits and a terminator (like 0D+0A) as in video 13 Tutorial ARM Cortex M4 - ADC+USART API, at 16:15. You may also use an instruction like sprintf(buf,"%d ",c); where c is the converted value (uint16_t) and buf is declared as char buf[6];
@user-563o45
@user-563o45 6 жыл бұрын
multumesc
@gabrielcuellar4045
@gabrielcuellar4045 7 жыл бұрын
Now I understand, thank you Sever Spanulescu
@moisasorin4876
@moisasorin4876 3 жыл бұрын
Thank you Sir, highly appreciated
@shaki7888
@shaki7888 7 жыл бұрын
Nice tutorial! Thank you! I have a question: How to receive data using DMA? After configuring UART Rx on DMA1 Channel 5 and Tx on DMA1 channel 4 in MXCube, HAL_UART_Transmit_DMA() completes successfully and after that I receive callback in void HAL_UART_TxCpltCallback(UART_HandleTypeDef *handle) { HAL_UART_Transmit(handle, (uint8_t *)"DMA_TX_SUCCESS", 14, 20); } custom declared function. But Rx is not working and RxCpltCallback is not executing. I have tried to put HAL_UART_Receive_DMA() before man loop, also in DMA1_Channel5_IRQHandler() AFTER HAL_DMA_IRQHandler(&hdma_usart1_rx); But still callback function is not executing.
@Abhishekkumar-vf8qe
@Abhishekkumar-vf8qe 6 жыл бұрын
What are the benefits of using DMA over Interrupt in UART
@user-vr7wk9os9u
@user-vr7wk9os9u 7 жыл бұрын
Hi! Thanks for useful video! How to send 12 bit resolution to UART? In advance thank you for answer.
@jitendrasalvi5763
@jitendrasalvi5763 7 жыл бұрын
Dear Sever, how to get the value of APB for a particular sampling rate? Thank you
@SeverSpanulescu
@SeverSpanulescu 7 жыл бұрын
APB2=Sampling rate*ADC prescaler*(nr. sample cycles+nr. bits). For example, Sample rate=2.4MHz, ADCPRE=2 (pag. 425 Ref Manual), SMPx=3 (pag. 418) , nr. bits=12, gives APB2=72 Mhz, and APB1=APB2/2=36 MHz. Of course, for lower sample rates you may use higher sample time SMPx and higher divisor ADCPRE, to obtain core frequency as close to 168MHz as possible.
@SanArulme
@SanArulme 7 жыл бұрын
pls share UART Rx in DMA video also
@raedbouchaa9139
@raedbouchaa9139 8 жыл бұрын
Hi, Can you Please make your future videos without cubex (From the beginning by writing the hole code)
@SeverSpanulescu
@SeverSpanulescu 8 жыл бұрын
+Raed Bouchaa Hi, I have already published 20 videos without Cube. You may find on my channel the same subjects written both with standard peripheral drivers and with direct registers programming. I hope you will find them useful, and if you suggest a particular program i'll try to publish it.
@raedbouchaa9139
@raedbouchaa9139 8 жыл бұрын
+Sever Spanulescu thank you for the reply, I really wish some tutorials abouts sensors that can help to build robots , like Infrares sensor , gyroscope sensor . . . with details in the explanation . Thank you, Keep It Up !
@dennisleng1914
@dennisleng1914 4 жыл бұрын
Hello master ! I want to put " HAL_UART_Transmit_DMA" to continuously sending in while(1), but no way, And must add "hal_delay(10)". like this : HAL_UART_Transmit_DMA(&huart1,(uint8_t*)str1,10); HAL_Delay(10); HAL_UART_Transmit_DMA(&huart1,(uint8_t*)str2,10); HAL_Delay(10); So I added a flag in "HAL_UART_TxCpltCallback", then judge this flag, Still failed. like this: while(UartReady !=SET ); UartReady = RESET ; Must put it in “USART1_IRQHandler”, But not controlled, I am puzzled for a few weeks, i hate to use Delay! Stm32 F411ceu6, DMA NVIC Are all enable, normal mode, I‘m wrong or serial port has a problem? thank you!
@babotvoj
@babotvoj 4 жыл бұрын
is your device connected to the PC via USB or?
@SeverSpanulescu
@SeverSpanulescu 4 жыл бұрын
Of course, I used an USB-TTL adapter.
@corruption1234
@corruption1234 5 жыл бұрын
why no audio??
@Graham1904
@Graham1904 4 жыл бұрын
No sound!!!!
@SeverSpanulescu
@SeverSpanulescu 4 жыл бұрын
Yes, I thought it was'n really necessary...
HAL: #6 How to - USART with DMA
6:00
Web learning
Рет қаралды 42 М.
Tutorial CubeMX - 7- USART RxTx Interrupts STM32F4 Discovery
9:31
Sever Spanulescu
Рет қаралды 90 М.
The Joker saves Harley Quinn from drowning!#joker  #shorts
00:34
Untitled Joker
Рет қаралды 58 МЛН
Top 10 Emerging Technologies of 2024 (According to Science)
10:45
AI Uncovered
Рет қаралды 22 М.
The Raw Reality Of Losing Your Job To AI
11:28
TheAIGRID
Рет қаралды 792
The IBM 1401 compiles and runs FORTRAN II
23:41
CuriousMarc
Рет қаралды 1,2 МЛН
Tutorial STM32F4 Discovery CAN using New HAL_CAN API functions.
19:43
Sever Spanulescu
Рет қаралды 57 М.
HAL: #4 How to - UART Interrupt
7:00
Web learning
Рет қаралды 85 М.
Tutorial STM32F746g Discovery   LCD using Keil MDK RTX
9:51
Sever Spanulescu
Рет қаралды 20 М.
Top 5 Beginner PCB Design Mistakes (and how to fix them)
12:52
Altium Academy
Рет қаралды 213 М.