ARM Technical Support Knowledge Articles


Applies to: uVision Debugger


Information in this article applies to:


I am working on a PWM project using the Philips 87LPC768. In the uVision Debugger, the reported PWM frequency does not appear to be correct.


The following program:

void main( void )
        CNSW0 = 0xFF;                                   //PWM Clock Count set to Maximum.
        CNSW1 = 0X03;

        CPSW0 = 0xCC;                                   //Setting duty cycle of channel 0 to 80%
        CPSW1 = 0x98;                                   //Setting duty cycle of channel 1 to 60%
        CPSW2 = 0x64;                                   //Setting duty cycle of channel 2 to 40%
        CPSW3 = 0x30;                                   //Setting duty cycle of channel 3 to 20%

        CPSW4 = 0xE4;                                   //Setting 8-9 bits of output registers

        PWMCON0 |= 0x40;                                //Setting all channels to non-iverted.

        PWMCON1 &= 0x00;                                //Braking disabled  Shadow Memory transfered.

        PWMCON0 |= 0x80;                                //RUN PWM.



configures the PWM to divide the CPU Clock by 1024. If the oscillator frequency is 20MHz, the CPU Clock is 3.333333MHz. Dividing by 1024 gives is PWM Frequency of approximately 3.255KHz.

This is an error. The actual value should be 19.531kHz.

This problem will be corrected in a subsequent release.

Article last edited on: 2004-06-28 21:12:10

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential