Discussion in "ARM Development" started by    bonois_dailleurs    Jun 6, 2011.
Mon Jun 06 2011, 02:23 am
#1
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 !!
Mon Jun 06 2011, 06:36 pm
#2
did you see datasheet? they have given the formula there see it once.
Tue Jun 07 2011, 10:30 pm
#3
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:
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
#4
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 ??
Wed Jun 15 2011, 09:42 pm
#5
I don't understand your question. Can you please rephrase it?
Thu Jun 16 2011, 02:11 am
#6
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
#7
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
Sat Jun 18 2011, 02:51 am
#8
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
#9
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
Tue Jun 21 2011, 01:21 am
#10
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.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

JefferyBrazy
Sat May 11 2024, 02:33 pm
autogCar
Sat May 11 2024, 03:38 am
Dulcehet
Fri May 10 2024, 04:22 pm
ElvasKl
Fri May 10 2024, 04:54 am
RonaldNak
Thu May 09 2024, 07:45 pm
Jamescon
Thu May 09 2024, 12:52 pm
RobertSkats
Thu May 09 2024, 10:23 am
hvCar
Thu May 09 2024, 05:53 am