Menu

ADC on the STM32F407

2021-04-20
2021-04-21
  • Richard Close

    Richard Close - 2021-04-20

    Hi once again. I am needing help now to get ADC working on the STM32F407 discovery board.
    I have looked at Terry Porters's article on ADC for the STM32F0 and tried to use it as a model for the F407.
    However, there are a lot of differences in register use and setup and certain steps seem to be in another order.
    The RM0090 manual is full of information about what everything does, but little about what to do with it! A paragraph on the steps to initialise the ADC would have been a help.
    After spending a few days in getting very confused, I am asking for help with the attached code I have managed to create so far.
    Many thanks,
    Richard

     
  • Terry Porter

    Terry Porter - 2021-04-20

    Richard,
    What type of ADC set up are you after ?
    i.e. polled, interrupt, dma, single channel, multi channel ?

     
  • Richard Close

    Richard Close - 2021-04-20

    Hi Terry
    I was trying to set up something like the example you had for the F0 board - polled, no DMA and a number of channels (3 probably).

     
  • Terry Porter

    Terry Porter - 2021-04-21

    Hi Richard,
    There is sample code for the 407 in the Mecrisp-Stellaris release tarball. This directory is a good place for sample code.

    mecrisp-stellaris-2.5.8/stm32f407/adc.txt

     
  • Richard Close

    Richard Close - 2021-04-21

    Hi Terry
    Thanks. I should have thought of looking there before. I have loaded it and it runs OK. I will now see what is the same in it with some code I spent a couple of hours on today. Time not wasted - I learnt a lot from going back and forth in the RM0090 manual!
    Your help much appreciated as before.
    Cheers
    Richard

     
  • Terry Porter

    Terry Porter - 2021-04-21

    No worries, I have never used the F407 ADC which it totally different to the one in my F051, no wonder you couldn't find any common ground there.

    I find that the Mecrisp_Stellaris release is a great source of examples and code, probably the best source. Just polish up on your GREP !

    Cheers,
    Terry

     

Log in to post a comment.

MongoDB Logo MongoDB