2023-07-01 12:46 PM
Hi, I bought me some STM8S103F3 small developent boards from china. Nice stuff. But I would like to make timer 1 channel 1 generate a PWM signal on output C6. This needs some remap of the timer 1 peripheral. Therefore I managed to set the AFR0 bit in OPT2 and clear this bit in NOPT2. The onboard led goes off when the cycletime Update event is executed and goes on if the compare value event (dutycycle time) is reached. I monitored the onboard led by oscilloscope and all works nice as expected showing my PWM signal. But still no signal is appearing on output C6 which is configured as output pushpull. Anyone has some experience with remapping timer 1 or what am I doing wrong? I am using the STVD IDE with COSMIC8 toolset. (spend 8 hours trying to find out, chatgpt is telling me nonsense...)
Solved! Go to Solution.
2023-08-08 07:28 AM
Hi, I finally got it to work. Only Timer1 has a MOE (Main Output Enable) bit in register TIM1_BKR. When this bit is set to 1 all works fine! Thanks anyway.
2023-07-05 07:20 AM
Did you check that OPT2 have the correct value?
Maybe it is missing something in timer configuration. See all timer registers and bits.
Try to remap other OPT2 bits and verify if remapping is working.
2023-08-08 07:28 AM
Hi, I finally got it to work. Only Timer1 has a MOE (Main Output Enable) bit in register TIM1_BKR. When this bit is set to 1 all works fine! Thanks anyway.