2011-03-17 03:12 AM
[solved] STM8AF6166 TIM2 CC3 output compare (PWM out) nothing happend !
2011-05-17 06:12 AM
I found by myself !
You need to set the option byte OPT2 = 0x02 (NOPT2 = 0xFD) to enable TIM2 CC3 and disable TIM3 CC1, following is the asm file to add in your project :;This file contains the values to program in the option bytes.
;You can change the values below according to the device datasheet. ;Be careful to respect the complement bytes, ; or the default values of the option bytes will be used. ;See the device datasheet for more information on the meaning of each bit. cseg at 04800h db 000h ;LOCKBYTE db 000h ;OPT1 db 0FFh ;NOPT1 db 002h ;OPT2 //0x02 will enable TIM2 CC3 and disable TIM3 CC1 db 0FDh ;NOPT2 db 000h ;OPT3 db 0FFh ;NOPT3 db 000h ;OPT4 db 0FFh ;NOPT4 db 000h ;OPT5 db 0FFh ;NOPT5 db 000h ;OPT6 db 0FFh ;NOPT6 db 000h ;OPT7 db 0FFh ;NOPT7 end2011-05-17 06:12 AM
An easy way can be to set OPT2 which is AFR option through STVP.
brazov2