CODE #include <lpc214x.h> // Define Clock settings #define PCLK 15000000 #define BAUDRATE 9600 // Set Baud Rate here void delay(unsigned char time) { unsigned int i, j; for (j = 0; j < (unsigned int)time; j++) { for (i = 0; i < 8000; i++) { // Delay } } } // Function to Initialize the UART0 void InitUART(void) { unsigned int Baud16; U0LCR = 0x83; Baud16 = (PCLK / (16 * BAUDRATE)); U0DLM = (unsigned char)(Baud16 >> 8); U0DLL = (unsigned char)Baud16; U0LCR = 0x03; } // Function to Transmit a byte void SendByte(unsigned char data) { U0THR = data; while ((U0LSR & 0x40) == 0); } // Function to Transmit a string void SendString(const unsigned char *str) { while (*str != '\0') { Send...
Comments
Post a Comment