 For next, hands-on, we will look on the ADC and the DMA together. When the ADC last time, we used only the interrupt, this means after the ADC finished the conversion, it notified us with the interrupt and we were forced to read this value. But now we use the DMA. This means after the ADC reads the value, it asked the DMA to transfer this value for him into the memory automatically. On the end, we are still notified with the interrupt, but we are sure that this value was transferred automatically. Again, our famous QPMix and we start the new project. Here is the Siri F4, 401 line and the package LQFP64 pin. And the device will be STM32F401RET. Okay, we have here our pinout. Like before, we will use almost the same configuration. We connect the PC13 and PA0 together to allow our ADC to read the button. Here, I use the IN0, like before, in the ADC. This is all from the pinout. In the clock configuration, I am okay with 16 MHz. And here, in the configuration, I need to configure the ADC a little bit differently. Then first of all, in the parameters, I am okay with the clock settings in the resolution, but not in the mode. Definitely, I want to use the continuous mode. This means that after I start the ADC, it will convert the values all the time without stopping. This means the continuous mode. And also, because I want to use the DMA, I want to send the DMA request after each conversion. If you not use the continuous DMA request, the DMA stops after first conversion cycle. In our case, after one conversion. Then I need to use the continuous DMA request. Here in the channel, again, I can set here, for example, now a little bit different. Or maybe this one, for example, sampling rate. And now I can need to configure the rest. Then I can here configure the DMA. For this, I added this DMA request from the ADC, from the PayPal to memory. The direction is okay. Definitely, I want to increase the memory address. For example, why not? The data width is half-word, it's okay. But here, because I want to sample the values all the time, I need to use the circular mode to keep the DMA running all the time. Okay, then this part is here okay. I can confirm it. I can store my project here into my projects. And now, in this case, I will use the IR. And I name it like the ADC and DMA, for example. I can store my project and I can generate my project for IDE. Okay, I can open my project in IR. Sorry, it will be in application in my main. The configuration is almost the same like before. Here is my ADC initialization. The DMA will be in the MSP package. You can find it here. It's very similar to the USART, which we use before. Now, what we need to do is here start the ADC. Then again, a-h-a-l-a-d-c underscore start. And I will use it at DMA. The first parameter is again the handle. And here with the DMA is more parameters. And the second parameter is the buffer, which I want to fill and the length of this buffer. Then I need to create, for this reason, my buffer, my ADC data buffer for one value. Okay, I will use my ADC data. And I put it here. And the size will be one. Now, I can check if he can allow this because I think he has problem with the type because he expects the biggest type, which is possible. Then I here need to re-type it to the 32-bit pointer. But even if I re-typing to the 32-bit, he still uses the configuration, which is in the DMA, which is 16-bit. Okay, this part is okay. Now, this transfer for me automatically the data inside the memory. In case that I want to be notified about the end of the conversion, I can use the callback. If not, I don't have to. But I for sure put here my callback again on the score week. Not MSP in it, not MSP data in it. But definitely, I need to use the conversion complete callback. Then I will return here. I put here my callback. But I don't need to put here anything because I don't need to read this value manually. They are already read with the DMA. Here, it's only for me for the notification. Then to allow me, put here the breakpoint. I don't know what I can put here. I can put here no operation. But I worry that my compiler will optimize this part. Then I here can change the optimization level to none. Allow me to put here also the breakpoint to see if my code is running. I can run my debug. We will see how this will work. I can run it and I can put here my debug. You see, I get the interrupt all the time. I can here also check my values to add them into my watch. If I put here the breakpoint, we can see the value. It's all right. You can see changing if I press the button. Zero. Now it's up. Now it's down. Again, I can try this with my STM Studio to see it a little bit better. I close this one. I close the debug. And I can open again the STM Studio. I can again import my variables to search for my executable. At least you will see that I can use the different truechains, not only the Eclipse based. The cube. The projects. And here it will be the ADC with the DMA. Here the executable will be in the evarm, in the DMA, and here in the executable. And here is .out. I can import this. I can import my data zero. Import again is here. I can import it into viewer and I can run. And now I forget to change the maximum and the minimum. 4096. And you can see I still hear my value. If I press the button, it is changing. Then it is working. You can try to do, to watch the different values, which can be very good. But you can connect for example the signal generator in case you have it. If not, I can here also recommend try to sample here the temperature sensor which can be also very useful because the temperature sensor is inside the silicon of the STM32. Then in case that you will a little bit warm the STM32 up, the values will be also changing. But please count the change of the temperature is not so big and on the values, the change of the value in the IDC will be not so big. Okay, this is all from this my example.