Skip to main content
Martin.Sergio
Associate III
October 3, 2017
Solved

PWM TIM4 4KHz 50% Duty Cycle

  • October 3, 2017
  • 2 replies
  • 1101 views
Posted on October 03, 2017 at 09:09

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.
    Best answer by waclawek.jan
    Posted on October 03, 2017 at 10:04

    Don't you have an 8MHz crystal also on that second board?

    JW

    2 replies

    waclawek.jan
    Super User
    October 3, 2017
    Posted on October 03, 2017 at 09:42

       With this PCB(25Mhz) and these configurations the output signal is not 4KHz

    And how much is it?

    You can verify the system clock frequency by outputting it onto a MCO pin.

    JW

    Martin.Sergio
    Associate III
    October 3, 2017
    Posted on October 03, 2017 at 09:51

    Hi,

       The output Frecuency in the PWM Pin is 1.28KHz...

    InputClock

    25MHz/8MHz = 3.125 times faster

    Output Signal

    8MHz -> 4KHZ

    25MHz -> 1.28KHz

    The Output Signal is 3.125 times slower

    Something in my configuration is wrong but I can't find it

    Thanks in advance,

        Sergio

    waclawek.jan
    waclawek.janBest answer
    Super User
    October 3, 2017
    Posted on October 03, 2017 at 10:04

    Don't you have an 8MHz crystal also on that second board?

    JW

    Martin.Sergio
    Associate III
    October 3, 2017
    Posted on October 03, 2017 at 10:13

    Hi,

       That was the mistake

    ...

       I thought I had soldered a 25MHz crystal but soldered one of 8MHz also on this PCB

       I was convinced that I had sold one of 25 and that the error was in the software

    Thank you very much

       Sergio