We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello!!! i just purchased a new ARM7 bases LPC2148 Development Board, it is having on chip crystal of 12Mhz
As i don't know the Clock on which my controller is executing can any one tell me that what is the instruction cycle timing for my board and how to evaluate this.
Here is my Startup.s file in Keil UVision IDE
www.edaboard.com/.../79624d1346723074-startup_file.png
Some one please explain me this, as i have to calculate the value of U0DLM and U0DLL
I my example program that comes with my development board, the Serial Port Initialization code is given. which is as follow:-
Code:
void init_serial (void) {
PINSEL0 = PINSEL0 | 0X00000005;
U0LCR = 0X83; /*8 bits, no Parity, 1 Stop bit */
U0DLL = 0XC3;
U0DLM = 0X00;
U0LCR = 0X03;
}
I didn't get the meaning of this line PINSEL0 = PINSEL0 | 0X00000005; /* Enable RxD0 and TxD0 */
Can any one help me regarding all this..
How to determine the clock of my board and the meaning of above line..
Thanks in advance
Hi,
means enabling the function of Pin0.19 & Pin0.21 as TxD0 & RxD0; ORing is done in order to select just only the specified bits of PINSEL0 Register & not altering the other bits of PINSEL0. PINSEL0 Register is used to select the other function of the pins other than GPIO. Please read the datasheet You can know your PCLK by a simple formula if you are an engineer
baudrate = PCLK/16(U0DLM + U0DLL)
The big question here - have you checked the user manual for the processor?
Have you read the actual description of PINSEL0? It is a long table specifying every bit of the register.
And the UART chapter also contains very specific information how to compute baudrate information.
This forum can never match the amount and quality of information you find in that user manual. So you really don't have much options but to download it and spend some quality time reading it.