cancel
Showing results for 
Search instead for 
Did you mean: 

ST72621 PWM Mode......help

tuswu
Associate II
Posted on April 14, 2003 at 13:37

ST72621 PWM Mode......help

5 REPLIES 5
tuswu
Associate II
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.......!!
florent2399
Associate II
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
florent2399
Associate II
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
florent2399
Associate II
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
tuswu
Associate II
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....