Hi,
I´m new with freescale microcontrollers and I am testing a board with
MK20DX256VLH7 microcontroller. I have startedwith a Project developed with
the Processor Expert tool. In order to develop the application I have
followed step by step "the Processor Expert Software Microcontrollers
Driver Suite Getting Started Guide" tutorial. Then when I had to test
debugging I saw that the LED was flashing well with the correct frequency,
but I checked that the message sent to Tera Term Application by UART wasn't
correct. Tera Term has received something but there are some strange
characters. The string that I send is "Hello World". The direction where is
stored the string is 0xfc0 allways, although I change the string, and I saw
that all characters are stored in them.
<https://community.nxp.com/servlet/JiveServlet/showImage/2-889025-179793/str
ange_characters.png> Descripción: Strange characters recrived in Tera Term
Application
The configuration is the same in Tera and in AS1 component, the baud rate is
9600, no parity, stop bit, 8 bits, and no control flow.
<https://community.nxp.com/servlet/JiveServlet/showImage/2-889025-179779/Ter
aTermConfiguration.png> Descripción: Tera Term Configuration
<https://community.nxp.com/servlet/JiveServlet/showImage/2-889025-179792/UAR
T_Component_Configuration.png> Descripción: UART Component Configuration
When I execute step by step inside the "AS1_SendBlock" function, I can see
how the characters are saved. For example the character that I can see in
*DeviceDataPrv->OutDataPtr is 0x48h, that is the hexadecimal character of
first letter "H". Then later it is executed the next line:
UART_PDD_EnableInterrupt(UART2_BASE_PTR, UART_PDD_INTERRUPT_TRANSMITTER);
Here I think it´s the sending order. Why don´t send the string correctly?
There are something in the configuration? The configuration should be
different with MK20DX256VLH7? The baud rate is ok?
In my application AS1_SendBlock function is executed step by step like it
should be, but when I want to see where the data are sent (in which output
registers) when the transmission interrupt is enable, I dont know where
because they are unknown for me. Do you Know the registers in which appears
the UART output transmission data or the UART output buffer for
mK20dx256vlh7 microcontroller?? I´m reading in the datasheet and I don´t
find any registers related on them. I want to see if the transmission data
in these registers are the same that I want to transmit and also in order to
compare with data that arrive to Tera application.
I would be very grateful for your help,
Arturo Arteaga
Hello Arturo,
- You can check the register for UARTx_D on the Reference manual , not datasheet .
You can also can change another terminal to have a try.
-If still can not work , please share your project to me , I will check the code on my side.
BR
Alice
Hi Alice,
Firstly thanks for your help,
I have managed to send a message to PC, but I want to receive data from PC to microcontroller and to re-send from microcontroller to PC the same data. It´s for testing to inizialite a future new applicationin the company.
I have attached my proyect in this mail. I think “AS1_OnBlockReceived” function should be called when a data is received but this function isn´t called when I send data from PC to microcontroller by writing from a keyboard in Tera application. In this function I use “SendBlock” function (it´s just functional) and also I use “GPIO1_ToggleFieldBits” (this function makes a toggle in a led) in order to check if the function is really called
Why the function isn´t called?? This function is enabled in AS1 component and also it appears as enabled in “AS1.h” file from the project. Also you can see “PE_ISR(AS1_Interrupt)” function in “AS1.c” file.
I have to configure something more?? I can just send but is there a lack to manage the reception data and sending data at the same time.
Thank you again for your effort,
Have a nice day,
Arturo Arteaga
De: Alice_Yang
Enviado el: miércoles, 22 de marzo de 2017 9:49
Para: Arturo Arteaga
Asunto: Re: - Re: SendBlock funtion doesn´t send correct data
<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg> NXP Community
Re: SendBlock funtion doesn´t send correct data
reply from Alice_Yang <https://community.nxp.com/people/Alice_Yang?et=watches.email.thread> in Kinetis Microcontrollers - View the full discussion <https://community.nxp.com/message/889450?commentID=889450&et=watches.email.thread#comment-889450>
Hello Arturo,
As to there is error when build your project on my side , so I create a new project for you.
I refer to the "Typical Usage" of the component, please check the attachment .
Send a character 'e' on terminal on PC, when k20 board receive it , it will send "Hello world" to terminal .
(Sorry for I haven't a good terminal software of English language , so please ignore the words on my terminal )
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------