Hi,
I have mcb2140 which two serial ports COM1 and COM0. I want to connect COM1 to my computer and COM0 to other evaluation board PN544.
I want to basically send commands from my computer to arm board through COM1 and then send command to pn544 evaluation board through COM0 and in turn get and pass response from PN544 to computer via arm board.
Please can anyone suggest how sould i do this.
1)Can two serial ports on arm board work simulataneously.
2)Any specific jumper settings required?
3)Can anyone explain me what is PINSEL0 = 0x00050000; U1LCR = 0x83; U1DLL = 97; U1LCR = 0x03;
how do we define which serial port to use com1 or com0
4)what is U1THR,U1LSR?
cose is as follows:(serial.c)
#include <LPC21xx.H> /* LPC21xx definitions */
#define CR 0x0D
void init_serial (void) { /* Initialize Serial Interface */ PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */ U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ U1DLL = 97; /* 9600 Baud Rate @ 15MHz VPB Clock */ U1LCR = 0x03; /* DLAB = 0 */ }
/* implementation of putchar (also used by printf function to output data) */ int sendchar (int ch) { /* Write character to Serial Port */
if (ch == '\n') { while (!(U1LSR & 0x20)); U1THR = CR; /* output CR */ } while (!(U1LSR & 0x20)); return (U1THR = ch); }
int getkey (void) { /* Read character from Serial Port */
while (!(U1LSR & 0x01));
return (U1RBR); }
--- Looking for any suggestion. thanks
NXP can supply examples. Keil already has supplied examples. Have you looked at them?