2012-08-22 08:22 AM
Hi
The objective is to create avariable frequency
pulse train with as little CPU intervention as possible. This was quite straightforward with the TMS320 TI MCU. It had a feature called ''PWM chopper'' where it was possible to configure frequency, pulse width, duty cycle and number of pulses. To achieve the same kind of functionality with the STM32F4, the idea that first came to mind was to use the Advanced Control Timer & DMA peripheral. A table which consists of the timer periods that define the pulse train characteristics is setup in RAM. The have the DMA transfer these values to the timer compare register using memory increment mode. The timer output pin is configured to toggle at every compare match. Also, it is desired to have control of the time interval between each consecutive pulse train. Therefore a timer capture/compare interrupt is enabled. In the interrupt, the pulse train starting time (first positive flank) is defined as: Current time (time when the interrupt occurs) + A settable delay The time when the next interrupt occurs is also settable. The questions are: 1) Is the method described above possible with the STM32F4? 2) Are there any other ways to get the same result?2015-03-25 11:46 PM
No works well .. Maybe I did not understand the steps.
It is a commentary on the double buffer based on a RAPID reading. I have not implemntado. I seemed at first code more flexible to change.2017-03-13 10:49 PM
Hi,
I have the same problem. I'm trying to make a short chirp centered on 40 kHz. To get a 50% duty cycle which is rough enough for my chirp I used a second timer clocked by the first. In this way only the ARR period reg needs updating via DMA. Problem is after the first update the ARR gets loaded wit 0 rather than my sorted array so the timer stops.
I like the timers but the documentation is diabolical.
OGFT
2017-03-14 01:20 AM
Is there a question?
If yes, please start your own thread and post code.
JW
2017-07-05 12:18 PM
Hi Clive
I need your help. In the previous example it works correctly, but for it to work I have to put a breakpoint in my debugger, and then continue. No debugger no ST-Link does not work. Do not start DMA.Thanks in advance and greetings