cancel
Showing results for 
Search instead for 
Did you mean: 

STM8S103F remapping timer 1 chan nel 1 to output C6

sthvw
Associate II

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...)

1 ACCEPTED SOLUTION

Accepted Solutions
sthvw
Associate II

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.

View solution in original post

2 REPLIES 2
AA1
Senior III

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.

sthvw
Associate II

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.