Hi , I'm newbee to ARM controller family.I'm trying to Receive a Message from GPS(Global Positioning System) and Sending to an GSM modem.
I'M using LPC2148 controller. My freq for controller is 12MHz. I need Help on how to intialize both the UARTs.
My code for Intilization is written as fallows,
void SerialInit1 (void) // this intialization for transmitting a msg to GSM modem { PINSEL0 = 0x00050000; // Enable RxD1 and TxD1 (for UART1) U1LCR = 0x00000083; // 8 bits, no Parity, 1 Stop bit U1DLL = 0x000000C2; // 9600 Baud Rate @ 30MHz VPB Clock U1LCR = 0x00000003; // DLAB = 0 } void SerialInit0 (void) // this intialization for receiving msg from GPS { PINSEL0 = 0x00000005; // Enable RxD1 and TxD1 (for UART1) U0LCR = 0x00000083; // 8 bits, no Parity, 1 Stop bit U0DLL = 0x000000C2; // 9600 Baud Rate @ 30MHz VPB Clock U0LCR = 0x00000003; // DLAB = 0 }
I doubt this is not the the proper way of intializing the Both UARTs..Can someone throw light on it?
Thank you Regards, Kush
Yes, the LPC have some registers with Set and Clear in the names. This is mostly for GPIO output values and for interrupt enable registers. For GPIO output state, you also have a direct-write register, so the software can select what is most efficient for every situation.
PINSEL0, on the other hand, does not have any set/clear alternatives so it's up to the software to modify the bits as needed without destroying other bits.