LPC2388 UART1 flow control

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC2388 UART1 flow control

487 Views
gc
Contributor I

Hello,

I have Problem to get data over uart1. If I send data to LPC2388, than the Rx Buffer is Always Zero. Also I have never seen that if I send to LPC2388, it comes to the Interrupt function. The sending from LPC2388 to the PC works. But sending from PC to LPC2388 doesn't work.

My configuration:

PINSEL4 |= 0x00000002; //TXD1 mit flow control
 PINSEL4 |= 0x00000008; //RXD1 mit flow control
 PINSEL4 |= 0x00000020; //CTS1 mit flow control
 PINSEL4 |= 0x00008000; //RTS1 mit flow control
 
 U1IER = 0;               /* Disable UART1 Interrupts */
 
 VICVectAddr7 = (unsigned long)sio_irq_UART1;
  VICVectCntl7 = 15;//15       /* use it for UART1 Interrupt */
  VICIntEnable = 1 << 7;   /* Enable UART1 Interrupt */
 
 
  U1LCR = 0x83;                              /* 8 bits, no Parity, 1 Stop bit*/
 
 //Baudrate 38400
 U1DLL = 19;
 U1DLM = 0;
 U1FDR = 0; 
 
  U1LCR = 0x03;                              /* DLAB = 0                     */
 
 dummy = U1IIR;                /* Read IrqID - Required to Get Interrupts Started */
  
 U1FCR = 0x07;/* Enable and reset TX and RX FIFO. */
 U1MCR = 0xC2;         /* Enable Auto RTS and Auto CTS. */
 U1IER = 0x8D;
Best regards
Labels (1)
0 Kudos
7 Replies

285 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Güney Can,

I think the line is correct that you configure the P2[1] pin as RXD1 function:

 PINSEL4 |= 0x00000008; //RXD1 mit flow control

I suggest you check the PINSEL4 register in debugger to confirm if the register configuration is correct.

Anyway, you can configure the P0[16] pin as RXD1, no problem, by  PINSEL1 |= 0x00000001; //RXD1 mit flow control

Pls have a try.

BR

Xaingjun Rong

0 Kudos

285 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Guney,

I think that it is correct that the RTS is low, because the RXD pin is ready to receive data. If you have another processor transmit data no matter what the RTS logic is, can the uart of LPC receive data?

BR

XiangJun Rong

0 Kudos

285 Views
gc
Contributor I

Hi XiangJun Rong,

if another processor send, I can see via Oszilloskop that the data arrives the pin but 

VICVectAddr7 = (unsigned long)sio_irq_UART1;
  VICVectCntl7 = 15;//15       /* use it for UART1 Interrupt */
  VICIntEnable = 1 << 7;   /* Enable UART1 Interrupt */

 

the Information doesn't receive in the function sio_irq_UART1(). Also if I polling  the U1RBR Buffer, it has all time the value 0. 

I use the PINs:

P2[2] CTS1

P2[1] RXD1

P2[0] TXD1

P2[7] RTS1

I have seen in the datasheet of LPC2388, it can also use:

P0[17] CTS1

P0[16] RXD1

P0[15] TXD1

P0[22] RTS1

Have I the wrong Pins?

best regards

Güney Can

0 Kudos

285 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Guney,

Regarding your question, I do not know whether the RTS/CTS signal leads to receiver failure. As a test, you can use loopback mode, in detail, you can disconnect to another board, while you can connect the uart1_TX to uart1_rx with a cable, what is the result?

You can use software loopback mode by U1MCR[LoopbackModeSelect]=1, then check the result.

Hope it can help you

BR

Xiangjun Rong

0 Kudos

285 Views
gc
Contributor I

Hi Xiangjun Rong,

thank you for your answer. I have tested with loopback mode. It works. Now, sending Data with flow Control works also. Only receive data doesn't work. Must I set a Register to 1 or 0 for receive data? How can I Control the RTS?

best regards

Güney Can

0 Kudos

285 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Guney,

Firstly, the RTS signal is an output signal connected to another processor, which means that the uart is ready to receive data.

If you set the U1MCR = 0xC2;         /* Enable Auto RTS and Auto CTS. */

can you test the RTS signal logic via oscilloscope when you receive the data?

BR

XiangJun Rong

0 Kudos

285 Views
gc
Contributor I

Hi Xiangjun Rong,

My RTS on LPC2388 is connected to CTS of the another processor and my CTS with the RTS of another processor.

U1MCR has the value 0xC2

U1MSR has the value 0x10

U1LSR has the value 0x60 (in Loopback Mode, 0x61 if data received)

U1IER has the value 0x00000001

If send from another Processor to LPC2388 RX pin [106] toggled between 3.3V and 0V.

The RTS pin on LPC2388 has always 0V.

The RTS and RX Signal measured over Oszilloskop.

best regards

Güney Can

0 Kudos