Issue with UART FCR Register

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue with UART FCR Register

445 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by blueshif on Thu Apr 28 00:27:55 MST 2016
Hi all,

We are developing on Keil uVision v4.74 for LPC2478 controller and using Keil ULinkPro for debugging. We are facing issues with the UART FIFO Control Register.
<!--break-->
We are using UART1 interface without Modem capabilities. Follwing is our initialization code:
[color=#781216]
<code>
//configure pin selections for UART1
      // configure UART
      // enable power to UART
      PCONP |= (1 << MODBUS_OPTION2_POWER_BIT);
[color=#781216]
      // RX and TX interrupts
      U1IER = 0x3;
[color=#781216]
      // DLAB = 1
      U1LCR = 0x83;
[color=#781216]
      U1FCR = 0x87; //Issue:actual value set is 0xC1
[color=#781216]
//Set Parity bit, Stop bit and baud rate according to application
[color=#781216]
      U1LCR &= 0x7F ; // DLAB = 0
[color=#781216]
      U1IER = 0x07;
</code>[/color][/color][/color][/color][/color][/color][/color]

The issue we are facing with the UART1 Fifo Control Register U1FCR is not setting the value correctly. U1FCR has following structure:

Bit 0   - FIFO Enable
Bit 1   - Rx FIFO Reset
Bit 2   - Tx FIFO Reset
Bit 5:3 - Reserved
Bit 7:6 - Rx Trigger Level
          00 - Trigger level 0 (1 character or 0x01)
          01 - Trigger level 1 (4 characters or 0x04)
          10 - Trigger level 2 (8 characters or 0x08)
          11 - Trigger level 3 (14 characters or 0x0E)

Everytime we set value 0x87(Trigger Level 2, Rx-Tx Fifo Reset, FIFO Enable), it is setting as 0xC1(Trigger Level 3,FIFO Enable)

Help needed seriously.
Labels (1)
0 Kudos
3 Replies

399 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

399 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by blueshif on Thu Apr 28 21:30:06 MST 2016
Yes Tyler, the Write Only register might be the reason its not getting read properly.
Thanks.
0 Kudos

399 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tdrazich on Thu Apr 28 06:06:22 MST 2016
I believe the clearing of FIFO reset bits (bits 1 & 2) makes sense. They auto clear once the FIFO's have been reset. Not sure for the trigger level bits, but one thing to try is clearing DLAB to '0' before writing the U1FCR register.

A side note, the user manual (UM10237) states that the FIFO control register (U1FCR) has write only access. Maybe the read back values are undefined, otherwise why say it's write only?


-Tyler
0 Kudos