Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Problem running LPC2106 with MAM, PLL and UART1 interrupts.

2006-04-25 by karlstiller

> >But, you haven't told us the important stuff: what crystal 
frequency,
> >what PLL setup (for a 14.7456 MHz crystal, PLLCFG=0x23 works), what
> >MAM setup (MAMCR=0x02 and MAMTIM=0x04 works) and what VPBDIV (0x01 
works).

Oops.. I knew I forgot something.

I'm running using an external crystal of 14.7456 MHz.  VPDIV = 0 
default -> one fourth of the processor clock.   I'm using the 
following code snippet for setting up the PLL and MAM:

// PLL
PLLCFG = 0x23;    // M = 4 P = 2 -> FOSC x 4 = 58980000(cclk)
PLLFEED = 0xAA;
PLLFEED = 0x55;   // PLL feed sequence
PLLCON = 0x1;     // habilita PLL e conecta PLL
PLLFEED = 0xAA;
PLLFEED = 0x55;   // PLL feed sequence

while( !(PLLSTAT & 0x400) );    // wait for PLL lock

PLLCON = 0x3;      // Connect PLL 
PLLFEED = 0xAA;
PLLFEED = 0x55;    // PLL feed sequence


// MAM

MAMCR = 0x00;
MAMTIM = 0x02;     // 2 processor clocks in duration for fetch cycles
MAMCR = 0x02;

I don't know if its relevant, but I'm using the IAR compiler (version 
4.30) to develop.

> also look at the support routines in the newlib-lpc lib for an 
example that 
> takes the crystal frequency and desired operating frequency as 
inputs and 
> set the PLL registers accordingly.  That might give you a double 
check on 
> your values.
> 
> Robert

Thanks, I'll check that out.

Karl

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.