use printf for mc51jm128

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

use printf for mc51jm128

996 Views
MWMinor
Contributor V

I want to use the printf function to send characters through the UART connections on PTE0_TXD1.

 

At the moment I cant use the printf() function to print a simple string to the console. So I think I must be doing something very wrong.

 

I am using Processor Expert and Codewarrior10.6

 

Can anyone help me please..?

 

Thanks

 

Ken

Labels (1)
0 Kudos
6 Replies

795 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

hi

in addition, I ever made printf demo code on 51JM128 demo board with CW10.1 and CW6.3 separately. see attached. hope this helps.


Have a great day,
Jennie Zhang

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

0 Kudos

795 Views
MWMinor
Contributor V

Hi Jennie

Many thanks for your suggestion, but I couldn't find an attachment. Could you please send them...?

Thanks

Ken

0 Kudos

795 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Ken.

I have uploaded them to this thread, can't you see them?

pastedImage_0.png

if it's invisible on your side, please send me your email address, I can send them to via email.


Have a great day,
Jennie Zhang

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

0 Kudos

795 Views
MWMinor
Contributor V

Hi Jenny

Thanks, I have seen them. It looks like they are set to drive the TXD1 & RXD1 channel. What changes do I need to me to use the TXD2 & RXD2 pins...?

Thanks for your support

Ken

0 Kudos

795 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

the feature of SCI1 and SCI2 are the same.

please refer MCF51JM128 reference manual

http://www.nxp.com/files/32bit/doc/ref_manual/MCF51JM128RM.pdf

chapter 12 to revise your code.


Have a great day,
Jennie Zhang

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

0 Kudos

795 Views
BlackNight
NXP Employee
NXP Employee

Hi Ken,

in Embedded Systems and the microcontrolle world, you really should not use printf(): it is simply not a good thing, see https://mcuoneclipse.com/2013/04/19/why-i-dont-like-printf/ .

But it is really up to you if you know the consequences. If you insist using it, here are a few articles which should help you:

https://mcuoneclipse.com/2013/02/07/tutorial-printf-with-and-without-processor-expert/

https://mcuoneclipse.com/2013/04/17/printf-with-the-frdm-kl25z-board-and-without-processor-expert/

https://mcuoneclipse.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/

I hope this helps,

Erich

0 Kudos