Hello ,
I just get my first Kinetis and I'm trying to initiate serial communication with a Real term.
I start a new project with Processor expert and select the UART0 as a serial_LDD components and I set all the parameters ( Pin affectation, baud rate , interrupt disabled for polling and automatic code generation).
Then I generate the code and modify the main code with the components example , here below the code associated :
With this code I cannot get any communication with my real term and the AS2 seems to return a ERR_BSUY.
Could you explain me what I'm doing wrong and How could I get communication running between my real term and the Kinetis micro.
Thanks for your help
Rgds
Philippe
Solved! Go to Solution.
Hi Philippe Calmettes,
As you said, I use the PE make a project.Select the UART0 as a serial_LDD components to communicate with the serial terminal, the baud rate is 9600bps.
The function is when receive"e",then send "Hello world\n", and brink the red led on the KL46 board.
I already test it, and the result is correct!
The attachment is my project, for your reference!
I wish it helps you!
Best regards!
Jing
Hi Philippe Calmettes,
As you said, I use the PE make a project.Select the UART0 as a serial_LDD components to communicate with the serial terminal, the baud rate is 9600bps.
The function is when receive"e",then send "Hello world\n", and brink the red led on the KL46 board.
I already test it, and the result is correct!
The attachment is my project, for your reference!
I wish it helps you!
Best regards!
Jing
Hello Jing,
Thanks for the support.
I have tried your example and it works .
Best Regards
Philippe
Hi Philippe,
You are welcome!
Best regards!
Jing
Hi Jing thank-you for your help - I have also tried your helpful code.
Can I ask you please:
If I send: error = AS1_SendBlock(MySerialPtr, OutData, sizeof(OutData)); /* Send block of characters */
It prints the "Hello world" correctly
If I want to send another Hello World straight after this, I can't just send another AS1_Sendblock...
(It only shows the first one) -- must I wait for completion using AS1_OnBlockSent(LDD_TUserData *UserDataPtr);
I'm not quite sure to use it.
regards
Russell
Hi Russel,
enable interrupts and buffers in the component:
That way you can send a block up to the buffer size.
otherwise check the return code/value of SendBlock(): if not ERR_OK, then you would need to resend it because buffers were full.
Or check the number of characters in the Tx buffer first with GetCharsInTxBuf().
Erich
Thanks Erich
Hi Erich
(I'm finally back after being away) I tried your suggestion to enable the interrupts -- forgive my ignorance, but I can't see the Output buffer size option after selecting enable :
What have I forgotten?
When I enable interrupts and compile, I get this: (no doubt due the incorrect configuration in my uart):
can you advise please? - thanks as always
Russell
Hi Russel,
have you generated code? That AS1_Main is used only if you are in polling mode.
The buffer size should show up. Are you already in Advanced/Expert mode?
Erich
Ok - so I hadn't generated code (somehow thought that building would take care of this at build/compile time)
Now that explains why I got the error but I'm still not seeing the input buffer size: Am I using the wrong uart component:
components window shows:
Hi Philippe Calmettes,
Could you upload your project? I would like to help you to test it!
And I want to know what the real term is ? I think you can communicate with the serial terminal at first.
Best regards!
Jing