Content originally posted in LPCWare by ktownsend on Mon Feb 15 16:24:05 MST 2010
I just went through all the initialisation code again, comparing it line for line against the NXP examples as well as the UM, and I seem to be setting up the USB clock correctly (multiplier 4 using the external 12MHz crystal), and the system clock is set to 72MHz (multiplied 6, divider 1). It runs fine at 72MHz until I call usb init, and the rom-based code is definately dropping the system clock down to 48MHz (messing up SPI, UART, etc.). For the moment I've adjusted to code to run the system clock at 48MHz which solves the problem, but at the expense of losing 1/3 processing speed. I'll likely have to implement a SW USB stack if there is no work around for this with the ROM drivers (which would be a shame since I'll lose a couple KBs flash as well).
Is this a bug in the rom-based code, though? I was under the impression that the USB and sys clocks can be run at different speeds (by adjusting the multiplier/divider settings).