lpc865m201jhi48 usart0 Driver example initialization part doubt

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

lpc865m201jhi48 usart0 Driver example initialization part doubt

143 Views
BerlinRaj
Contributor II

anyone please verify my code

USART0_Init()
{
        uint32_t brgval = 0U;
  SYSCON->SYSAHBCLKCTRL0 |= (1<<14);
/* Reset the module. */
SYSCON->PRESETCTRL0 &=~(1<<14);//Assert the usart0 reset
SYSCON->PRESETCTRL0 |= (1<<14);//Clear the usart0 reset
USART0->CFG &= ~(0x30);//NO PARITY
USART0->CFG &= ~(1<<6);//ONE STOP BIT
USART0->CFG &= ~(1<<11);//Asynchronous mode is selected.
USART0->CFG &= ~(1<<6);//ONE STOP BIT
USART0->CFG &= ~(0x3 << 2);//clear 8-bit data length
USART0->CFG |= (0x1 << 2);//set the 8-bit data length
USART0->CFG |= (1 << 14);//usart0 in master mode
USART0->CFG |= (1 << 0);//Enable the uart
        brgval    = 60000000 / 9600;
        base->BRG = brgval - 1U;
        //enable Tx
        USART0->CFG |= 0X1;
        USART0->CTL &= ~(0X40);
 
}
Labels (1)
0 Kudos
Reply
1 Reply

127 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @BerlinRaj 

Recommend you using USART driver under SDK. 

Also can refer to the source code.

Download from:

https://mcuxpresso.nxp.com/en/select  

 

BR

Alice

0 Kudos
Reply