dear dun han you wrote I had NOT enabled MAM before. I enabled it and the system works correctly now. Thank you for your useful advices.
same problem we have our led is 2-3 mhz.and we know we must see 30 mhz around.
which is correct about pll and MAM?
Sorry, but the LPC21xx series has very slow I/O. It takes many cycles to toggle a pin since the pin is not on a local bus.
You have to use a LPC23xx to get the newer I/O interface. But even then, you would get into troubles if you _need_ 1 cycle/operation.
MAM will just speed up your instruction processing by caching memory accesses. But it can't help out with the slow transfers of I/O commands from the ARM core to the I/O module.
Once more: You have to learn that m = milli = 0.001. M = mega = 1000000. Hz = hertz = periods/second.
So mega-hertz is MHz not mhz. Small m is a difference of 1000000000 compared to M and that is a quite big difference...