Giter Club home page Giter Club logo

stm32_adc_multich_oversmp_dma_triggertimer's Introduction

STM32H7 ADC Multi Channel Multi Conversion TriggerTimer with Oversample and data transmit with DMA

 

Tested with STM32H750 in HAL & LL library, should be able ported to others.
This example will convert several channels in burst mode from HW trigger: timer peripheral.
Oversample ratio set to max 1024 and leftshift 10bits to average 1024 sample.
DMA is configured to transfer conversion data in an array, in circular mode.
Timer is configured in time base and to generate TRGO events.

Disable Discontinuous conversion for burst conversion
Disable continuous conversion for single conversion
End of conversion selection set to "End of sequence Conversion"

 

To calculate minimum conversion time:
ADCFreq = 37.5 / 2 = 18.75MHz
Minimum Tconv = 1.5 + 0.5 + (16/2) = 10 cycle
Sample Time = 10 cycle / 18.75 MHz = 0.533 us
According the Datasheet, Vref need at least 4.3us, so minimum Vref sampling time must 8.5 cycles.

 

The Rank Setting:

 

Using basic timer TIM6 and set it to 10kHz(10000 cycle/second),
10000 counter to trigger event at 1 second interval.

 

ADC value is convert to voltage with build in macro,
ADC_INP0 --> GND
ADC_INP1 --> VCC
The Output in Live Expression:

 

Check the logic pin to see if the ADC is converted with 1sec interval.

 

Comment/Suggestion are highly welcome!

stm32_adc_multich_oversmp_dma_triggertimer's People

Contributors

sweesineng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stm32_adc_multich_oversmp_dma_triggertimer's Issues

HAL_ADC_ConvCpltCallback never fired

Hi there, I was wondering if you maybe know what could be the reason that HAL_ADC_ConvCpltCallback is never fired

ADC seams to not work

I am using STM32H750B-Dk and I did everything the same as your pictures shows (I even tried your project (added HAL libraries into it, because you don't have them in)

but HAL_ADC_ConvCpltCallback is never fired and I am not sure why

Now this did happen on different projects sometimes as well and I am realy not sure why, I copy everything exept the clock

because I cannot just copy clock function (SystemClock_Config)

because every STM board has something different

Could clock be the problem maybe? I left clock configuration like CubeIDE configured it, I never touched it

I hope you could maybe know what the problem would be, here is my project: https://www.mediafire.com/file/gvlaamxudv86ym9/Osciloskop_H7.zip/file

Maybe you could take a look

Also what is minimum conversion time and why would I need to calculate that?

Thanks for Anwsering and Best Regards

PS: Is there a particular reason u used TIM6 and ADC3 (could I also use TIM1 and ADC1 for instance? (I would like to read PA0_C and PA1_C which user manual says are connected to ADC12_IN0 and ADC12_IN1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.