Hi, Any one know how to direct I/O for printf function? please help me...
Hello, you do not want to use serial0 as I/O. Am I right? If so please have a look at the files GETKEY.C and PUTCHAR.C located in the folder where the libs are installed. Those define the routines _getkey() and putchar() the printf() is based on. HTH, Walter Ochs
Do you need to have multiple destinations for your serial I/O? I faced this same problem and ended up writing my own version of printf - this also allowed me to solve a number of other problems at the same time. If I can help you in this way, please reply and I will post further details.
All you need to do is "steer" the output in putchar: if(serial) SBUF=c; // over-simplified else P1=c; // put character on pins