uart4 register unknown

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

uart4 register unknown

358 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Gonzalo_Sipel on Fri Oct 31 08:49:58 MST 2014
Hi everyone:
I'm working with a LPC1788 and I've found in "usart_001.c" and "usart_001.h" files the following piece of code:

[color=#63f]usart_001.c
#if defined(CHIP_LPC177X_8X) || defined(CHIP_LPC407X_8X)
case 4:
#else
case 0:
case 2:
case 3:
#endif
pUART->TER2 = UART_TER2_TXEN;
/* Wait for current transmit complete */
while (!(pUART->LSR & UART_LSR_THRE)) {}
/* Disable Tx */
pUART->TER2 = 0;
break;


usart_001h
typedef struct {/*!< USARTn Structure       */

__IO uint32_t IER;/*!< Interrupt Enable Register. Contains individual interrupt enable bits for the 7 potential
__IO uint32_t DLM;/*!< Divisor Latch MSB. Most significant byte of the baud rate divisor value. The full
....
....
....
#if !defined CHIP_LPC11XX
__IO uint32_t TER2;/*!< Transmit Enable Register. Only on LPC177X_8X UART4 and LPC18XX/43XX USART0/2/3. */
#endif
} IP_USART_001_T;[/color]

The problem is that when I look for pUART->TER2 (UART4) register in the user manul there is any register with that name. Furthermore, when I debug my proyect I see that pUART->TER2 is at 0x400A 405C direction and the last register of UART4 is at 0x400A 4058.
Somebody knows if is a user manual error or a library error??
Labels (1)
0 Kudos
2 Replies

327 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Gonzalo_Sipel on Fri Oct 31 10:18:17 MST 2014
Thanks Mike,
the lpc driver never sets RET(0x30) so is a library bug too. Despite of this, it works because the reset value of RET is (1<<7). I think I will have to be careful using LPC library.
BTW, I've erased the other post ;-)
0 Kudos

327 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Fri Oct 31 09:51:53 MST 2014
Hi. I am using 1778 (same as 1788 but no LCD) with all 5 UARTS.

I do not use CMSIS or LPCOPEN so I cannot comment on their driver or header files.

I have just checked my user manual (latest rev 3.1 Sept 2014) and the "TER" at offset 0x30 is indeed missing for UART4.
And is missing going back as far as version 2.0 it seems.

Since I do not need the modem signals of UART1 or the IRDA of UART4, my (original hand crafted code) has always
assumed that all five UARTS implement (at least) the same registers as documented in UART0/2/3, with TER at 0x30
from the base.

So I never noticed the UM error (I consider it to be an error anyway). I just enable Tx via bit 7 of TER at 30 for each and
all UARTs.

And I can transmit and receive on all 5 UARTS (incl nbr 4). Does the code you got from the LPCOpen sources actually
work -- can you transmit on UART4? If not, this implies a library bug too.

Anyway, hope this helps. Mike

BTW I amd not sure that you should double post in two different forums like this!






0 Kudos