Skip to main content
Visitor II
January 25, 2021
Question

Not able to generate 6 step pwm signal using timer1

  • January 25, 2021
  • 4 replies
  • 2932 views

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

    This topic has been closed for replies.

    4 replies

    Graduate II
    January 25, 2021

    If you get constant 5 V, something is wrong. Either your supply voltage if to high ( 5 V vs 3.3V) or your drive 5 V to a non-5 Volt tolerant pin.

    Graduate II
    January 27, 2021

    PB2,PB1,PB0 has default function "analog input". You have to remap their function to TIM1 complementary outputs by programming option bits.

    Ajadh.1Author
    Visitor II
    January 27, 2021

    how should I program option bits?

    Please guide

    thank you!

    Ajadh.1Author
    Visitor II
    January 28, 2021

    I have set option bits too. Still I am not get complementary waveform at PB2 PB1 PB0. Now I am not getting 5v dc as am getting initially before option byte set.

    But now only noise is present at this pins.

    do i have to change anything else as hardware point of view or software

    Thanks in advance

    Ajadh.1Author
    Visitor II
    February 10, 2021

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

    Thanks

    Ajadh.1Author
    Visitor II
    February 17, 2021

    I have resolved the problem, Thanks