Frequency change

AK-mini2440
Hi,
I'm trying to change the frequency of the CPU and LCD, but I can't seem to
get my head around the settings.
I setup the CPU clock in my startup file as follows:

  ldr  r0,=CLKDIVN
  ldr  r1,=0b0010    

  ldr  r0,=UPLLCON
  ldr  r1,=0x00038022 ;48MHz  
  str  r1,[r0]

  nop  
  nop
  nop
  nop
  nop
  nop
  nop

  ldr  r0,=MPLLCON
  ldr  r1,=0x000ad022 ;271.5MHz
  str  r1,[r0]

So the crystal on board clock (Fin) is at 12MHz. The USB clock (UCLK)is set
at 48MHz as recommended. And the MPLLCON value (HCLK) is set to give me
271.5MHz, but with the CLKDIVN dividing it down by 2.
My LCD configuration is as follows:
  rLCDCON1 = (2 << 8); //clkval

The LCD clock is dependant on HCLK, which should be 135.75MHz. Which would
give me a VCLK value of 33MHz if CLKVAL is set to 2.
Is this procedure in determining the LCD clk right? Or am I missing
something?
Now I'm try to get VCLK approximately 40MHz, so that would be HCLK =
160MHz, which would mean MPLLCON = 0x00044011 (304MHz), and CLKDIVN =
0b0010.
However the mini2440 halts when the CLKDIVN is set to make HCLK equal to
FCLK or FCLK/2 (CLKDIVN=0b0010 or =0b0000)
Has anyone got any suggestions how to configure the clock and pll? Or
better explanation on how the clock works?

Thanks!