Jump to content

Accessing the PWM Mode of STM32


Trantuete
 Share

Recommended Posts

Hi,

 

quick question:

 

I want to generate a fast and accurate PWM signal with the stm32 integrated PWM-mode of the general purpose timer. Right now the timer function of MIOS32 does not enable me to access this mode. How can that be done?

So far, I know that the corresponding GPIO pin has to be configured in Alternate Function mode, to be able to connect to on chip peripheral signal sources like the PWM Generator. I added this mode to the pin modes in mios32_board.c and the correspondig header file.

But I can't seem to figure out, how to initialize the timer for that mode. :no:

Help please?

 

Regards

 

Link to comment
Share on other sites

Hi,

 

you could use the related SW driver which is already available in the repository:

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=/trunk/drivers/STM32F10x/v3.3.0/STM32F10x_StdPeriph_Driver/inc/stm32f10x_tim.h

http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=/trunk/drivers/STM32F10x/v3.3.0/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.c

 

It's even compiled into the project by default, so that you can directly start to use these functions via #include <stm32f10x_tim.h>! :smile:

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...