?? main.c
字號:
#include <LPC21xx.H>
#include <stdio.h>
void UART0 (void);
int main(void)
{
PLLCFG = 0x03; // Set multiplier and divider of PLL
PLLCON = 0x01; // Enable the PLL
PLLFEED = 0xAA; // Update PLL registers
PLLFEED = 0x55;
while (!(PLLSTAT & 0x400)) // test Lock bit
{
PLLFEED = 0xAA; // not sure if this is necessary
PLLFEED = 0x55;
}
PLLCON = 0x03; // Connect the PLL
PLLFEED = 0xAA; //Update PLL registers
PLLFEED = 0x55;
VPBDIV = 0x02; //Set the VLSI Peripheral bus to Divide by 2
UART0 (); //Initilise the UART
while(1)
{
printf("Hello from the LPC2129 \n"); //Call the prinfF function
}
}
void UART0 (void)
{
PINSEL0 = 0x05; // Select TxD and RxD on pin connect block
U0LCR = 0x80; //Enable programming of divisor latches
U0DLL = 0x60; //Program the divisor latch for 19200 baud
U0DLM = 0x00;
U0LCR = 0x33; //Program the line control 8\N\1
U0FCR = 0x4F; //enable the FIFO's
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -