cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to generate 6 step pwm signal using timer1

Ajadh.1
Associate II

Hi,

I am working with stm8s105c6 controller. I want to generate 6 PWM using timer1. For that I am using 6 step PWM sample. I am getting pwm at pc1, pc2, pc3 but complementry pwm at pb0, pb1, and pb2 is not available.

At pb0, pb1 and pb2 I am constantly getting 5V Dc. why?

will you plz help?

Thanks

15 REPLIES 15

I have attached datasheet. Please check page no27 , table no 5. It has mentioned about option bits and pin no. As per that i have set on stvp.

Thank

Be sure that you write option bytes into MCU. Read option bytes by STVD. Set option bytes tab at bottom. Next click Read-Read current tab. Next look at line AFR4. Is there PB0,1,2,3 alternate function TIM1 ?

0693W000007D0zwQAC.jpg

I have set option byte as per shown in image.

first I have pressed all tab program (tab)

then i have opened main.hex file

and again pressed all tab program (tab)

Am I following wrong procedure?

hope you will understand the mistake

thank you

If you read out option bytes with that configuration, then PB0 to PB3 should be TIM1 outputs. If you are running std.periph. example you should get signal on them. If not, consider if you are uploading right hex.file. If yes, look for hardware error (probe directly MCU pin). I cant help you more ... good luck :)

Ajadh.1
Associate II

I have solved the issue, some changes I have done in hardware.

Thanks

Ajadh.1
Associate II

I have resolved the problem, Thanks