I understood why PINSEL0 is used for P0_15 & PINSEL1 is used for P0_16 .
I tend to get confused when i see different codes being used for different Application notes.
PINSEL0 |= 0x00050000; // Select UART1 RXD/TXD
How TXD/RXD is being selected through PINSEL0 inspite it is clear that RXD OF Uart1 can be slected only by PINSEL1 ?
Why do you create new threads for the same subject? http://www.keil.com/forum/19109/
Don't you notice the difference between "Start a thread" and "Reply"?
Next thing.
You are confused by this line:
That would set bits affecting P0.8 and P0.9. P0.8 have alternatives (P0.8, I2STX_WS, MISO1, MAT2.2) P0.9 have alternatives (P0.9, I2STX_SDA, MOSI1 or MAT2.3)
So the question then is: Where did you see that line? If you want help with a specific line that doesn't make sense, it would definitely help if you posted where you found it. Don't you think so?
#define TX_BUFSIZE 80 static unsigned char txbuf[TX_BUFSIZE]; static unsigned char txptr = 0; static unsigned char typtr = 0; void UART1_Init(void) { // Fpclk = 12.000.000 MHz // DLM,DLH = Fpclk / (19200*16) = 39 = 0x27 <PINSEL0 |= 0x00050000; // Select UART1 RXD/TXD> U1FCR = 7; // Enable and clear FIFO's U1LCR = 0x83; // 8N1, enable Divisor latch bit U1DLL = 0x27; // baud rate fixed to 19200 @ PCLK = 12 Mhz U1DLM = 0; U1LCR = 3; // Disable Divisor latch bit } static void SendString(char *text) { if (txptr == 0) // previous message send ? { typtr = 0; while(*text) { txbuf[txptr++] = *text++; if(txptr >= TX_BUFSIZE) txptr = 0; } } } static void UART1_Tx_Int(void) // Called from the main loop { char i = 16; if (U1LCR && 0x20) // transmit FIFO empty ? { while (i && txptr) { U1THR = txbuf[typtr++]; txptr --; i --; } } } int main (void) { UART1_Init(); while (1) { SendString("Hello magnificent world of the LPC2000\r\n"); UART1_Tx_Int(); } } I got this code from NXP'S site in application technical note section.
As shown here: www.danlhenry.com/.../keil_code.png
View all questions in Keil forum