sense (28.10.2011 08:16, просмотров: 126) ответил progchip на Помогите плиз запустить UART LPC1114
Вот так должно быть:
LPC_SYSCON->PDRUNCFG &= ~(0x01<<5); //system-osc power ON
LPC_SYSCON->SYSOSCCTRL &= ~(0x01<<0); //sys_osc is not bypassed
LPC_SYSCON->SYSOSCCTRL &= ~(0x01<<1); //select freq range for sys_osc : 1-20 MHz
LPC_SYSCON->SYSPLLCLKSEL = 0x01; //PLLSOURCE = systemosc
LPC_SYSCON->SYSPLLCLKUEN = 0x01; //update
LPC_SYSCON->SYSPLLCLKUEN = 0x00;
LPC_SYSCON->SYSPLLCLKUEN = 0x01;
LPC_SYSCON->MAINCLKSEL = 0x01; //main clock=PLL input
LPC_SYSCON->MAINCLKUEN = 0x01; //Update MCLK clock source
LPC_SYSCON->MAINCLKUEN = 0x00; //Toggle update register once
LPC_SYSCON->MAINCLKUEN = 0x01;
while ( !(LPC_SYSCON->MAINCLKUEN & 0x01) ); //Wait until updated