Uart framing error TWR-k53n512 in code warrior v10.6

cancel
Showing results for 
Search instead for 
Did you mean: 

Uart framing error TWR-k53n512 in code warrior v10.6

Jump to solution
247 Views
communitycommun
Contributor III

I am trying to print a char 'a' via uart3 in Tower k53n512.But after configuring the setting and baud rate still i am getting a wrong output at console..i have attached the nxp given code and the error photo..

 

please take look the attached project

 

Real term shows a error:UART framing error with some junk people coming along with some delay..

 

<code>

int core_clk_khz;

int core_clk_mhz;

int periph_clk_khz;

 

void main (void)

{

    //MCU_Init();           // MCU Initialization Clock, WatchDog etc

    //turn_power_on();     // Turn ON, the device connected at Medical connector

    //Timer_Init();         // Periodic Timer interrupt initialization - 1ms

    //initopamp();        // OpAmps Initialization           

    //ADC_Init8b();        // ADC Initialization

   

    //int core_clk_khz= 50*1000;

        

    //long int periph_clk_khz = core_clk_khz / (((SIM_CLKDIV1 & SIM_CLKDIV1_OUTDIV2_MASK) >> 24)+ 1);

 

    //core_clk_mhz = pll_init(CORE_CLK_MHZ, REF_CLK);

   

    //SIM_SCGC4 |= SIM_SCGC4_UART1_MASK ;

   

    SIM_SCGC4 |=  SIM_SCGC4_UART3_MASK ;

   

                 SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK

                              | SIM_SCGC5_PORTB_MASK

                              | SIM_SCGC5_PORTC_MASK

                              | SIM_SCGC5_PORTD_MASK

                              | SIM_SCGC5_PORTE_MASK );

   

    core_clk_khz = 48*1000;                                    //core_clk_mhz * 1000;

   

    periph_clk_khz = core_clk_khz / (((SIM_CLKDIV1 & SIM_CLKDIV1_OUTDIV2_MASK) >> 24)+ 1);

   

   

    

    /* Enable the UART1_TXD function on PTC4 */

    //    PORTC_PCR4 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin

 

    /* Enable the UART1_RXD function on PTC3 */

        //PORTC_PCR3 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin

 

   

    

   

      /*Enable the UART3_TXD function on PTC17 */

  PORTC_PCR17 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin

 

/* Enable the UART3_RXD function on PTC16 */

  PORTC_PCR16 = PORT_PCR_MUX(0x3); // UART is alt3 function for this pin

      

       /*Enable the UART3_RXD function on PTB10*/    

    PORTB_PCR10 = PORT_PCR_MUX(0x3);

 

  /*Enable the UART3_TXD function on PTB11*/

        PORTB_PCR11=  PORT_PCR_MUX(0x3);

     

uart_init (UART3_BASE_PTR , periph_clk_khz , 115200 );

//uart_init (UART1_BASE_PTR , core_clk_khz , 115200 );

 

 

while(1)

{

     

uart_putchar(UART3_BASE_PTR ,'a');

//uart_putchar(UART1_BASE_PTR ,'a');

time_delay_ms(1000);

     

}   

}

Labels (1)
0 Kudos
1 Solution
99 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Sorry there is not a tool to convert it directly ,

i recommend you can create one IAR simple project ,then copy the code to the project,

for the code is little and simple , so it is easy to copy, then build ,  until there is no error .

BR

Alice

View solution in original post

0 Kudos
3 Replies
99 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

1) Through UART port to send , the character not show on the console of IDE, it show

in the terminal of UART.

And when you use the UART3 to send , the hardware port is in the TWR-SER board of TOWER system.

If you not clearly about i said , please take a photo about your board connection .

2) About the error ,  when it shows ? Please take a screenshot bout it .

BR

Alice

0 Kudos
99 Views
communitycommun
Contributor III

thanks for the reply..

Alice is there a possibility to import the code warrior mcu project into IAR work bench...if so tell me the steps for that..
meanwhile the code warrior project is already in NXP site named "med steth"

I wanted that code warrior project to get converted in to IAR work bench

0 Kudos
100 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Sorry there is not a tool to convert it directly ,

i recommend you can create one IAR simple project ,then copy the code to the project,

for the code is little and simple , so it is easy to copy, then build ,  until there is no error .

BR

Alice

View solution in original post

0 Kudos