We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
my problem is i want to send data to the serial port without using printf, this is because i want to read data of the serial port to use in another application. but using printf takes too long to run as i want my program to run at a speed less than 1mS. any help as soon as possible would be very helpfull??????????
Try putchar and puts. Note that you can modify the implementation of putchar to make your serial I/O buffered and interrupt-driven. - Mike
what i want to do is put a variable "temp" onto the serial port so i can read it from there using labview. its written in C so what code do i use?? putchar(" temp" ??????????????
As Andrew said, see my UART driver, written in C, that writes data to the serial port. All you need to do is "override" putchar() and _getket(). Keil's printf and getchar functions will then use your versions of putchar and _getkey. UART driver at http://www.embeddedfw.com (bottom of page). - Mark
"what i want to do is put a variable "temp" onto the serial port" What is temp - char? int? pointer? string? ... If you find that printf is too cumbersome, you will need to write your own routines to suit your specific requirements; eg, * write a byte from XDATA space in hex; * write an int from DATA space in signed decimal; etc, etc...
Actually, it's a C question. putchar(temp) would actually work if temp was a char. If you want to learn how to send data without using printf but using putchar only, read any book on C. - Mike