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;
}
}
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.
Hope it helps!
Victor.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
Are you sure that there is no Baud Rate mismatch? (Do the other bytes get received with the correct value?)
Regards
Mark
Thanks for your reply.
I am sure that Baud Rate is matched.
And data other than '0x00' are correctly transmitted.
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