EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

LPC2103 Timer 3 as PWM Problem!!

Started by Gigi August 20, 2007
Please!!!

Help me, I have used the example 17 of lpcbook for configure the timer
3 of lpc2103 as a pwm autput but this not work...

My major problem is also , in debug mode with keil CARM Not exist the
timer 3 peripheric

Have you any other example?

An Engineer's Guide to the LPC2100 Series

The pwm function on the LPC2101/2/3 is different from all the other
LPC2000 parts. The PWM example in the Hitex book will not work on the
LPC2103. You will have to study the user manual.

Jeff

--- In l..., "Gigi" wrote:
>
> Please!!!
>
> Help me, I have used the example 17 of lpcbook for configure the
timer
> 3 of lpc2103 as a pwm autput but this not work...
>
> My major problem is also , in debug mode with keil CARM Not exist the
> timer 3 peripheric
>
> Have you any other example?
>
Thanks,
Now i have the solution this code work correctly:

void ISR (void) __irq;

int main(void)
{

PINSEL1 |= 0x00000800;
T3PR = 0x0000005; //Load prescaler
T3TCR = 0x00000002; //Reset counter and prescaler
T3MCR = 0x00000018;
T3MR1 = 0x00000101;
T3MR0 = 0;
T3EMR = 0x00000011; //On match clear MAT0
T3TCR = 0x00000001; //enable timer

VICVectAddr4 = (unsigned)ISR; //Set the timer ISR vector address
VICVectCntl4 = 0x0000003b; //Set channel control
VICIntEnable |= 0x08000000; //Enable the TIMER2 interrupt
while(1);
}

void ISR (void) __irq
{
T3MR0++;//Increment PWM Duty cycle
T3MR0 = T3MR0 & 0x00003FF; //Limit duty cycle
T3EMR |= 0x00000001; //On match clear MAT0
T3IR |= 0x00000001; //Clear match 0 interrupt
VICVectAddr = 0x00000000; //Dummy write to
signal end of interrupt

}
--- In l..., "ksdoubleshooter" wrote:
>
> The pwm function on the LPC2101/2/3 is different from all the other
> LPC2000 parts. The PWM example in the Hitex book will not work on
the
> LPC2103. You will have to study the user manual.
>
> Jeff
>
> --- In l..., "Gigi" wrote:
> >
> > Please!!!
> >
> > Help me, I have used the example 17 of lpcbook for configure the
> timer
> > 3 of lpc2103 as a pwm autput but this not work...
> >
> > My major problem is also , in debug mode with keil CARM Not exist
the
> > timer 3 peripheric
> >
> > Have you any other example?
>

The 2024 Embedded Online Conference