I have tried to get PWM output of the STM32F030 but no luck. Here is my code
Code: Select all
program STM32F030_PWM
' Declarations section
dim period as word
dim LED as sbit at GPIOA_ODR.B8
sub procedure Init_GPIO()
GPIO_Digital_Output(@GPIOA_BASE, _GPIO_PINMASK_8) ' LED output
end sub
main:
' Main program
Init_GPIO()
' Nothing output on PA6
period = PWM_TIM3_Init(5000)
PWM_TIM3_Set_Duty(period/4, _PWM_NON_INVERTED, _PWM_CHANNEL1)
PWM_TIM3_Start(_PWM_CHANNEL1, @_GPIO_MODULE_TIM3_CH1_PA6)
' This works
while(TRUE)
LED = NOT LED
Delay_uS(100)
wend
end.
Thanks,
Chris