Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Printf() function for debugging process

Status
Not open for further replies.

ucsam

Advanced Member level 4
Joined
Oct 12, 2010
Messages
119
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
kathmandu,nepal
Activity points
2,058
Hello!
I wanted to use printf() function for debugging my project. I read the description about it but couldn't understand it, can u guys help me use it? i know that it prints the data in the "printf() viewer" btw i am using keil c uvison 4 and 89s52.

p.s - please reply soon, it is for my competition and i am stuck with the coding.
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,490
Have you checked out Keil's User Guide:

Cx51 User's Guide - printf()

A couple of good tutorials:

C Tutorial – printf, Format Specifiers, Format Conversions and Formatted Output

Secrets of “printf”

The Keil compiler sends printf() output to STDOUT, which I believe is UART1. So if you need to define STDOUT as another UART or other peripheral, you need to modify some code and recompile, check Keil's website for details.

Here's a Keil Forum discussion on printf():

UART - printf - keil

These links and docs should get you started in the right direction.
 

ucsam

Advanced Member level 4
Joined
Oct 12, 2010
Messages
119
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
kathmandu,nepal
Activity points
2,058
Thanks for your kind reply.

I have been known that printf() function prints characters in simulation of code. As i am stuck with mine, i want printf function to print the status. I want to know the format on how to use it. If u can, please guide me to a working example of using printf. I want to use printf for simulation and virtually
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top