uart issues in r5f51305adfn

Hello,

                  I have written the below code snippet which is the setting for the uart for channel SCI1. I am unable to get the output  for the uart.

 

 

unsigned long sckcr_dummy=0x0000000; 

SYSTEM.PRCR.WORD = 0xA507U;

/* Enable writing to MPC pin function control registers */
MPC.PWPR.BIT.B0WI = 0U;
MPC.PWPR.BIT.PFSWE = 1U;

 

/* Set system clock */

SYSTEM.SCKCR.LONG = sckcr_dummy;

while (SYSTEM.SCKCR.LONG != sckcr_dummy);

/* Disable sub-clock */
SYSTEM.SOSCCR.BIT.SOSTP = 1U;

/* Wait for the register modification to complete */
while (1U != SYSTEM.SOSCCR.BIT.SOSTP);

/* Disable sub-clock */
RTC.RCR3.BIT.RTCEN = 0U;

/* Wait for the register modification to complete */
while (0U != RTC.RCR3.BIT.RTCEN);

/* Set HOCO */

SYSTEM.HOCOCR.BIT.HCSTP = 0U;

/* Wait for HOCO wait counter overflow */
while (1U != SYSTEM.OSCOVFSR.BIT.HCOVF);

/* Set clock source */
SYSTEM.SCKCR3.WORD = _0100_CGC_CLOCKSOURCE_HOCO;

while (SYSTEM.SCKCR3.WORD != _0100_CGC_CLOCKSOURCE_HOCO);

/* Set LOCO */
SYSTEM.LOCOCR.BIT.LCSTP = 1U;


SYSTEM.PRCR.WORD = 0xA507U;

/* Enable writing to MPC pin function control registers */
MPC.PWPR.BIT.B0WI = 0U;
MPC.PWPR.BIT.PFSWE = 1U;

//--------------------------------------------------------------------------------
SYSTEM.PRCR.WORD = PRCR1_ENA; /* Enables writing to the registers */
SYSTEM.MSTPCRB.BIT.MSTPB30 = 0; /* SCI1 module stop mode release */
SYSTEM.PRCR.WORD = PRCR1_DIS; /* Disables writing to the registers */

IPR(SCI1, ERI1) = 15;

SCI1.SCR.BYTE = 0x00; /* Clear the SCR.TIE, RIE, TE, RE and TEIE bits */

/* Set RXD1 pin */
MPC.P30PFS.BYTE = 0x0AU;
PORT3.PMR.BYTE |= 0x01U;

/* Set TXD1 pin */
PORT2.PMR.BYTE |= 0x1A;//0x04;
PORT2.PODR.BYTE |= 0x40U;
MPC.P26PFS.BYTE = 0x0AU;
PORT2.PDR.BYTE |= 0x40U;

SCI1.SCR.BIT.CKE = 0;

SCI1.SIMR1.BIT.IICM = 0;

SCI1.SPMR.BYTE = 0x00;

SCI1.SMR.BIT.CKS = 0x01; /* Clock Select = PCLK/4 */
SCI1.SCMR.BYTE = 0x72;


SCI1.SEMR.BYTE = 0x10;


SCI1.BRR = 0x0C; //38400 baudrate

 

 

 

 

Any suggestions would be appreciated .

 

B.R

John