Skip to main content
con3
Senior
October 17, 2017
Solved

Interrupt speed stm32f7

  • October 17, 2017
  • 2 replies
  • 1504 views
Posted on October 17, 2017 at 17:40

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.
    Best answer by waclawek.jan
    Posted on October 17, 2017 at 19:00

    It's the DMA which should act upon the pin change.

    Read that AN you linked to again carefully.

    JW

    2 replies

    waclawek.jan
    Super User
    October 17, 2017
    Posted on October 17, 2017 at 18:19

    store their values via DMA to memory in an interrupt.

    I don't Cube and won't read the code above, but this is a flawed concept.

    DMA is to be used to avoid using software (i.e. interrupt) for moving data around.

    JW

    con3
    con3Author
    Senior
    October 17, 2017
    Posted on October 17, 2017 at 18:38

    I just want to use the interrupt to tell the DMA when to act or when it should start moving the data.

    The interrupt will be tied to a clock pin( which will be tied to the timer as in the application note), whenever it goes high, the DMA should move the data from the pins to memory.

    I'm not sure how else I would effectively be ably to move the data from the pins at 4MHz? In the interrupt I'm just toggling a pin and the max frequency I can do that at is 800 kHz. The DMA's use would be to spare the CPU so that I don't further slow down the interrupt from 800kHz. Is there any other way that I could read data off of two pins at 4 MHz? 

    Thank you for the quick reply and input!

    waclawek.jan
    waclawek.janBest answer
    Super User
    October 17, 2017
    Posted on October 17, 2017 at 19:00

    It's the DMA which should act upon the pin change.

    Read that AN you linked to again carefully.

    JW

    waclawek.jan
    Super User
    October 18, 2017
    Posted on October 18, 2017 at 20:18

    Q1 - draw a timing diagram with signals (clock, data, anything else), indicating who is the source of which signal.

    Generally, DMA is clocked by the system clock (HCLK). It takes several clocks of arbitration after the trigger arrives - this may take longer if other DMA streams are active in the same DMA unit; then it reads from the source - this may take longer if there is contention on the target slave bus on the bus matrix due to other masters accessing the same slave bus, plus if the target is on an APB bus then there's delay due to APB bus running on a different clock; then it writes to the target - the same applies as for source. See AN4031.

    Q2 - where is the question?

    If you need to read state of 2 pins (which have to be on the same half of the same port if you want to transfer only 8bits) then 6 pins remain, not 2.

    You don't need to tie them low or high, you will simply mask the data in software when processing them later.

    JW

    con3
    con3Author
    Senior
    October 19, 2017
    Posted on October 19, 2017 at 16:45

    Sorry JW,

    The lack of sleep must have caught up to me on Q2. my actual question was that I am unsure what they meant by discarded data? are these bits that aren't read and why not? Then If possible if these bits aren't read how can I ensure that the 2 bits from the ADC are always read(if bits need to be discarded, the other 6 can be). 

    Thank you for all the help.I really appreciate it! After I understand this I'll close the question.