UART configuration
Discussion in "ARM Development" started by bonois_dailleurs Jun 6, 2011.
Mon Jun 06 2011, 02:23 am
hi , i'm working on PHILIPS NXP LPC2378 device (ARM7TDMI )
and i'm trying to learn how to use the UART(universal asynchrone receiver/transmitter)
i found some difficulties in some of the registers such as :
- UnDLL
-UnDLM
i know that the two registers contains the value of the clock dividor , all that to define the baude rate clock , in other words the speed of the data transmission
but i have no idea about the values that i have to put into thoses registers
please if someone know something tell me more !!
thanks in advance !!
and i'm trying to learn how to use the UART(universal asynchrone receiver/transmitter)
i found some difficulties in some of the registers such as :
- UnDLL
-UnDLM
i know that the two registers contains the value of the clock dividor , all that to define the baude rate clock , in other words the speed of the data transmission
but i have no idea about the values that i have to put into thoses registers
please if someone know something tell me more !!
thanks in advance !!
Tue Jun 07 2011, 10:30 pm
The sequence of events is pretty simple: set DLAB=1, set the baudrate (remember it's X16), then set DLAB=0...
Here's a piece of code to experiment with:
Here's a piece of code to experiment with:
U0FDR = 0;/* Fractional divider not used*/ U0LCR = 0x83;/* DLAB = 1, 8 bits, no Parity, 1 Stop bit */ FreqDivisor = ( (double)(UART_frequency) / 16.0 ) / (double)(baudrate) ; U0DLM = (UNS_32)(rint(FreqDivisor / 256.0));/* baud rate */ U0DLL = (UNS_32)(rint(FreqDivisor)) % 256; U0LCR = 0x03;/* DLAB = 0 */
Tue Jun 14 2011, 12:12 am
thank you for your answers,
i would also know more about TXD0 and RXD0
can i use them like GPIO mode for simulationg sending and receiving data for exemple ??
i would also know more about TXD0 and RXD0
can i use them like GPIO mode for simulationg sending and receiving data for exemple ??
Thu Jun 16 2011, 02:11 am
LPC series controller provides you option to select alternate function of a pin. this is generally done from PINSEL registers (see manual for more help). By default all pins are defined as GPIO. you can select alternate function by setting proper bits in respective PINSEL register for that GPIO.
Sat Jun 18 2011, 02:02 am
look i'm trying to write a program which performs the following things :
-receive data , it means that the microcontroller have to receive an RS232 signal (start bit, the information, stop bit)
and put it into a buffer(memory )
so i asked if this information can be received by toggling the RXD0 of the UART0
thank u
-receive data , it means that the microcontroller have to receive an RS232 signal (start bit, the information, stop bit)
and put it into a buffer(memory )
so i asked if this information can be received by toggling the RXD0 of the UART0
thank u
Sat Jun 18 2011, 02:51 am
well why you want to toggle yourself?? you have hardware UARTs... everything is done by hardware you get the final data in a register thats it. simple.. move it to buffer wherever you want.
Sun Jun 19 2011, 01:26 am
look i'm trying to simulate receiving data , so toggling on RXD0 may be the solution no ??
and after the UART0 will put this information into RX FIFO , and to see it we can use U0RBR
that's it ??
if no please can you tell me the process to follow to perform my action , thank you
and after the UART0 will put this information into RX FIFO , and to see it we can use U0RBR
that's it ??
if no please can you tell me the process to follow to perform my action , thank you
Tue Jun 21 2011, 01:21 am
are you using a software to simulate? which one?
e.g if its proteus then you can connect a virtual terminal to it. If you're testing in Keil then you can open uart window and send data to controller just like a virtual terminal.
toggling RXD pin wont be a solution coz you wont be able to match the transfer baudrate.
e.g if its proteus then you can connect a virtual terminal to it. If you're testing in Keil then you can open uart window and send data to controller just like a virtual terminal.
toggling RXD pin wont be a solution coz you wont be able to match the transfer baudrate.
Powered by e107 Forum System