UART address detect mode

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

UART address detect mode

1,032 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by EdizonTN on Tue Apr 07 00:39:33 MST 2015
Hi,

I have to use UART1 with address detection mode (LPC1549).
I found bit definition UART_CTRL_ADDRDET (Address detect mode) in uart15xx.h but a cannot find ADDR register (location 0x4004 402C for UASRT1).
How to I set address register? Write to 0x4004 402C directly?

Thanks.
Labels (1)
0 Kudos
2 Replies

722 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by EdizonTN on Fri Apr 17 13:02:49 MST 2015
Hi support's guy and all others,

Yes, I modified LPC_UART structure (uart_15xx.h) from this:
/**
 * @brief UART register block structure
 */
typedef struct {
__IO uint32_t  CFG;/*!< Configuration register */
__IO uint32_t  CTRL;/*!< Control register */
__IO uint32_t  STAT;/*!< Status register */
__IO uint32_t  INTENSET;/*!< Interrupt Enable read and set register */
__O  uint32_t  INTENCLR;/*!< Interrupt Enable clear register */
__I  uint32_t  RXDATA;/*!< Receive Data register */
__I  uint32_t  RXDATA_STAT;/*!< Receive Data with status register */
__IO uint32_t  TXDATA;/*!< Transmit data register */
__IO uint32_t  BRG;/*!< Baud Rate Generator register */
__IO uint32_t  INTSTAT;/*!< Interrupt status register */
} LPC_USART_T;


to this:

**
 * @brief UART register block structure
 */
typedef struct {
__IO uint32_t  CFG;/*!< Configuration register */
__IO uint32_t  CTRL;/*!< Control register */
__IO uint32_t  STAT;/*!< Status register */
__IO uint32_t  INTENSET;/*!< Interrupt Enable read and set register */
__O  uint32_t  INTENCLR;/*!< Interrupt Enable clear register */
__I  uint32_t  RXDATA;/*!< Receive Data register */
__I  uint32_t  RXDATA_STAT;/*!< Receive Data with status register */
__IO uint32_t  TXDATA;/*!< Transmit data register */
__IO uint32_t  BRG;/*!< Baud Rate Generator register */
__IO uint32_t  INTSTAT;/*!< Interrupt status register */

__IO uint32_t  OSR;/*!< Oversample selection register */
__IO uint32_t  ADDR;/*!< Address match register */
} LPC_USART_T;


This two missing registers brings error in peripherial view of UART1 and UART2 in LPCXpresso also! You can try it.
btw: what is right name: UART or USART??

Next, I added a bit definition for Automatic address matching enable:
#define UART_CFG_AUTOADDR       (0x01 << 19)/*!< Automatic Address matching enable */

-this is not a big mistake, this is only for my idea for next release of CMSIS library....

Now, 9-bit communication working perfectly in my board.
In attachment, you can find modified uart_15xx.h header file.
0 Kudos

722 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nerd herd on Fri Apr 17 08:52:00 MST 2015
Hi EdizonTN,

I am looking at the LPC15xx LPCOpen code base and it seems like you have discovered a bug for us! There are two missing UART registers that are not defined in the LPC_USART_T structure (OSR and ADR). Unless you add those two registers into the structure yourself, yes, it looks like you will have to address the register directly with a volatile integer pointer.
0 Kudos