ADC driver with DMA in C | Embedded System Project Series #22

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 10

  • @michajoko7534
    @michajoko7534 Год назад +3

    Hello, I saw your channel for the first time a week ago and hope to see many more videos. I like the content on your channel which is very helpful. Keep going on 👍

    • @artfulbytes
      @artfulbytes  Год назад

      Hello! More videos to come, thanks for checking in

  • @Rahul-po9yg
    @Rahul-po9yg Год назад

    nice work. ❤ , thanks.
    I wish this channel to be grow exponentially

  • @NotSionnix
    @NotSionnix Месяц назад

    Hi! Could you explain in more detail why you copy the values from adc_dtc_block to adc_dtc_block_cache once more? The way I understand it is your ADC finishes sampling the sequence of channels and once that is finished the DMA autonomously transfers data to adc_dtc_block without the processor having to be involved. Once this is done, it raises a DMA transfer finished interrupt, and then inside of that ISR, it transfers the values from adc_dtc_block to adc_dtc_block_cache.
    My question is, isn't this doing double the work and couldn't you just access the values directly from adc_dtc_block? I know in the video you said you didn't want the application to touch the same array the DMA is touching and my understanding is it's easier to briefly disable interrupts and access it from adc_dtc_block_cache than disable DMA or the ADC while trying to read from adc_dtc_block directly, but I'm not sure if I understood it correctly. Would appreciate any insight.
    Sorry for the all the questions, it's my first time getting deep into embedded and DMA has been quite confusing to get set up haha. As always the video series has been really enlightening and using it as a reference to do my own project has been a godsend! Thanks!

    • @artfulbytes
      @artfulbytes  Месяц назад +1

      ADC/DMA won't run while we are in the interrupt function, so it's safe to touch adc_dtc_block there. After we are done copying the values to adc_dtc_block_cache, we manually start the adc/dma/sampling again (see adc_enable_and_start_conversion). If we were to access the adc_dtc_block in adc_get_channel_values, then we would risk accessing it at the same time as the DMA. An added bonus of having the additional array is that we get them in the right order as well (DMA writes them in opposite order.

    • @NotSionnix
      @NotSionnix Месяц назад

      @artfulbytes that clears it up thanks so much for answering all my questions!

  • @olivialinden8699
    @olivialinden8699 Год назад +1

    First

    • @artfulbytes
      @artfulbytes  Год назад +1

      always 😃

    • @Henry-sv3wv
      @Henry-sv3wv Год назад

      I don't have MSP. But i do have ESP32 or Pico with RP2040.