cancel
Showing results for 
Search instead for 
Did you mean: 

Variable frequency pulse train for pulse transformer application

arre24
Associate II
Posted on August 22, 2012 at 17:22

Hi

The objective is to create a

variable 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?
53 REPLIES 53
sanjib
Associate III
Posted on February 21, 2014 at 11:38

Dear joseph

i am trying the same like  the motor should accelerate, maintain the speed for a period T, then decelerate and stop in STM with external interrupt. Did you have any idea of how to do . DO you have any sample code for that ?If you are successful in achieving your desired motor control please help me as I need the same.

joseph
Associate II
Posted on February 22, 2014 at 16:16

i succeeded in doing that task using an external interrupt. do u still need the code?

sanjib
Associate III
Posted on February 25, 2014 at 04:56

Dear Joseph

Thanks and Sorry for the late reply. I was not well. Anyways if you help me with your code I will be grateful to you.

Please mention what that code is doing , as I am a new guy in stm32.

Thanks in advance
sanjib
Associate III
Posted on February 26, 2014 at 05:14

Dear Joseph

Please help me with your code.

sanjib
Associate III
Posted on February 28, 2014 at 05:21

Hi joseph

I need your help.

joseph
Associate II
sanjib
Associate III
Posted on March 07, 2014 at 12:36

Which thing you are referring to?

sanjib
Associate III
Posted on March 07, 2014 at 12:38

Oh! Sorry Thanks a lot Yes I got your attachment. Ignore my previous msg.

joseph
Associate II
Posted on March 13, 2014 at 03:19

you are welcome. if u are familiar with working of USART, can u help me?

joseph
Associate II
Posted on March 13, 2014 at 03:19

you are welcome. if u are familiar with working of USART, can u help me?