⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 Hitex LPC2100 insider guide source code
💻 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 + -