MENU

Fun & Interesting

Getting Started With STM32 & Nucleo Part 4: Working with ADC and DMA - Maker.io

DigiKey 231,175 6 years ago
Video Not Working? Fix It Now

As we continue the series with STM32, let’s take a look at how to use the analog-to-digital converter (ADC). At first, we set up a single conversion that samples the voltage from a potentiometer and transmits the raw value over UART. We can then read this information on a serial terminal. We run into problems, however, when we want to sample analog voltages at a much faster rate. So, we introduce the concept of direct memory access (DMA) to help pipe data from the ADC (or any other peripheral) to memory. We can also use the DMA controller the other way, too. We start by showing an example of reading a large buffer of test data out over UART via DMA. From there, we build a quick demo of filling a circular buffer with ADC readings with the DMA controller. We’ll simply peek at the buffer contents in the STM32CubeIDE debugger to show how the DMA can act without CPU intervention. WRITTEN TUTORIAL If you would like to see the steps performed in this video in written form along with the code, please see the tutorial here: https://www.digikey.com/en/maker/videos/shawn-hymel/getting-started-with-stm32-and-nucleo-part-4-working-with-adc-and-dma ADDITIONAL RESOURCES Related Projects https://www.digikey.com/maker/search-results?&k=Getting%20Started%20with%20STM32%20and%20Nucleo Download STM32CubeIDE: https://www.st.com/en/development-tools/stm32cubeide.html STM32 HAL documentation (click on family from graphic and then Resources tab) : https://www.st.com/en/embedded-software/stm32cube-mcu-mpu-packages.html Using the STM32F0/F1/F3/G0/Lx Series DMA Controller: https://www.st.com/content/ccc/resource/technical/document/application_note/47/41/32/e8/6f/42/43/bd/CD00160362.pdf/files/CD00160362.pdf/jcr:content/translations/en.CD00160362.pdf Maker.io: https://www.digikey.com/en/maker Digi-Key’s Blog - TheCircuit: https://www.digikey.com/en/blog Connect with Digi-Key on Facebook: https://www.facebook.com/digikey.electronics/ And follow us on Twitter: https://twitter.com/digikey

Comment