Все, заработало! Дело было в неправильной документации на LPC1788, если честно, то я первый раз столкнулся с ошибками в документации на микроконтроллер. Так вот, есть два типа частот, это Fcco и pll_out_clk:
Цитата
pll_in_clk - the frequency of the input to the PLL
FCCO - the frequency of the PLL current controlled oscillator
pll_out_clk - the PLL output frequency
M - PLL Multiplier value from the MSEL bits in the PLLCFG register
P - PLL Divider value from the PSEL bits in the PLLCFG register
The PLL output frequency (when the PLL is active and locked) is given by:
pll_out_clk = M * pll_in_clk - or - pll_out_clk = FCCO / (2 * P)
The CCO frequency can be computed as:
FCCO = pll_out_clk * 2 * P - or - FCCO = pll_in_clk * M * 2 * P
The PLL inputs and settings must meet the following criteria:
• M is in the range of 1 to 32.
• P is one of 1, 2, 4, 8.
• pll_in_clk is in the range of 10 MHz to 25 MHz.
• FCCO is in the range of 156 MHz to 320 MHz.
• pll_out_clk is in the range of 9.75 MHz to 160 MHz.
И из документации видно, что источником частоты является Fcco и что делителем частоты могут быть только числа 0, 4 и 6 (USBCLKSEL - address 0x400F C108, поле USBDIV):
Цитата
0 The divider is turned off., no clock will be provided to the USB subsystem.
4 PLL0 output is divided by 4. PLL0 output must be 192 MHz.
6 PLL0 output is divided by 6. PLL0 output must be 288 MHz.
Others Other values cannot produce the 48 MHz clock required for USB operation.
Но по факту, источником частоты для USB является pll_out_clk, и тогда при частоте pll_out_clk = 96 MH USBDIV = 2.