UART Err

cancel
Showing results for 
Search instead for 
Did you mean: 

UART Err

535 Views
xiaoqiangfu
Contributor I

UART project is created using MKE02Z64 with PE in codewarrior.

When sending "0x00" in HEX using serial debug, there is always AS1_OnError() interrupted by Noise error.

When sending other number than "0x00", everything goes well.

It puzzles me long time.

The sample project is attached.

void AS1_OnError(void)
{
  /* Write your code here ... */
    
    AS1_TError error;        // TError type is defined in the AS1.h header file
      
      AS1_GetError(&error);    // determine the type of error
      if(error.errName.Parity) {
        //Parity error
      } else if(error.errName.Framing){
        //Framing error
      }

}

void AS1_OnRxChar(void)
{
  /* Write your code here ... */
    char ch;
    if(AS1_RecvChar(&ch) == ERR_OK)
    {
        received = 1;

        index++;
        data_receive[index] = ch;
    }
}

Labels (1)
Tags (2)
0 Kudos
4 Replies

303 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Xiaoqiang Fu,

I recommend you to download the SDK for the MKE02Z64. You can use the UART example projects as a guide to see what is causing this problem on your project. 

Link to download the SDK.

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos

303 Views
mjbcswitzerland
Specialist V

Hi

Are you sure that there is no Baud Rate mismatch? (Do the other bytes get received with the correct value?)

Regards

Mark

0 Kudos

303 Views
xiaoqiangfu
Contributor I

Thanks for your reply.

I am sure that Baud Rate is matched.

And data other than '0x00' are correctly transmitted.

0 Kudos

303 Views
mjbcswitzerland
Specialist V

Hi

Try a binary from one of the pages below (they have UART at 115kBaud) since I never experienced any difficulties with the UARTs.
If it is limited to PE generated code you could also try the free Open Source uTasker project which supports your device and CodeWarrior (search for it on GiTHub).

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis KE:
- http://www.utasker.com/kinetis/FRDM-KE02Z.html
- http://www.utasker.com/kinetis/FRDM-KE02Z40M.html

0 Kudos