Skip to main content
Visitor II
April 14, 2003
Question

ST72621 PWM Mode......help

  • April 14, 2003
  • 5 replies
  • 988 views
Posted on April 14, 2003 at 13:37

ST72621 PWM Mode......help

    This topic has been closed for replies.

    5 replies

    tuswuAuthor
    Visitor II
    April 14, 2003
    Posted on April 14, 2003 at 05:29

    Dear all:

    i can't get the wave form PWM1(PB.7)

    My_Init()

    SetBit (PBDDR ,7); //PB.7 --->output

    PWMCR = 0x20; // PWM1 (PB7) is selected

    ARTCSR = 0x78; // CPU clock, 62.5kHz, counter enabled

    PWMDCR1 = 0x00;

    something is woring?? help me please.......!!
    Visitor II
    April 14, 2003
    Posted on April 14, 2003 at 07:14

    Hi,

    Are you sure of the output IO? On my datasheet, I see the PWM output located from PB0 to PB3. By the way, you don't need to configure the IO in output mode, as the peripheral itself configures the IO in the right state.

    Rgds

    Florent
    Visitor II
    April 14, 2003
    Posted on April 14, 2003 at 07:26

    Sorry, I thought you were speaking about the ST72321 MCU...PB7 IO might be OK!

    Rgds

    Florent
    Visitor II
    April 14, 2003
    Posted on April 14, 2003 at 07:55

    I think that the PWMDCR value is not OK. It has to be greater than ARTARR, moreover greater than 0x00. Please check ARTARR & PWMDCR values....

    Rgds

    Florent
    tuswuAuthor
    Visitor II
    April 14, 2003
    Posted on April 14, 2003 at 13:37

    Hi Florent....

    i found the bug,

    PWMCR register does not mapping address correct in the .map file

    thanks for your help....