Forums

PWM6 is not working

Started by Unknown March 29, 2005
Hi all.
I try to use PWM6 on LPC2292/4. That simple program
should have generate PWM wawe on PWM6 output. But,
anything is wrong in the program, becouse PWM6 is not
working. Please, tell me, what is wrong ? Thanks for
any advice or ideas.

#include "lpc229x.h"
int main() //Single edge PWM
{
PCB_PINSEL0 |= (1 << 19); //Set P0.9 as PWM6
PWM_MR0 = 100;// Set the period
PWM_MR6 = 50;// Set PWMMatch6 register
PWM_LER = 0x41; // Latch the Values

PWM_PR = 0; // The TC is incremented every PR+1=1
cycles of pclk
PWM_MCR |= (1 << 19); // PWMTC will be reset if
PWMMR6 matches it
PWM_PCR = (1 << 14); // Enable PWM6 (PWMENA6 - H)
and set single edge PWM (PWMSEL6 - L)

PWM_TCR = 0x9; // PWM enable and Counter enable
while(1) ; //loop
return 0;
}

Regards / S pozdravom Boris Kralik

http://www.geocities.com/kralikbo/
-------------

Send instant messages to your online friends http://uk.messenger.yahoo.com



An Engineer's Guide to the LPC2100 Series