cancel
Showing results for 
Search instead for 
Did you mean: 

Can we generate Sine wave using timer in stm32l053r8 nucleo board

MKuma.8
Associate

Actually i wanted to genrate single sine wave and multiplex it to 8 channels.Basically i need to generate fsk signal.

for logic1-980 HZ

for logic 0-1650Hz

3 REPLIES 3

> Can we generate Sine wave using timer

Do you want to use timer-generated PWM as DAC? Doable, but requires quite a lot of resources. You'd need to run PWM at significantly higher rate than the higher of the frequencies (i.e. tens of kHz up to maybe 100kHz) and have an analog filter after it. You also need to change the PWM's fill factor to generate the sine, preferrably from a table using DMA, so that the processor is not overloaded by interrupts.

1 channel should be fairly simple - you may want to look at [STM32Cube_FW_L0_V1.9.0]\Projects\STM32L053R8-Nucleo\Examples\TIM\TIM_DMA - but get the 'L0 to do this in 8 channels will be challenging...

JW

>>but get the 'L0 to do this in 8 channels will be challenging...

Could likely emulate 8-channel PWM by driving a pattern buffer to a GPIO bank using DMA+TIM

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

>>but get the 'L0 to do this in 8 channels will be challenging...

>Could likely emulate 8-channel PWM by driving a pattern buffer to a GPIO bank using DMA+TIM

For 8ch FSK? Don't think so.

JW