Dear Colleagues, I want to work with printf and putchar but I have not had luck. Anybody can help me what is wrong on the below code. I am trying to prove the two functions printf and putchar wiht the simplest code I imagined, but the uVision still generates errors.
ERROR: *** FATAL ERROR L210: I/O ERROR ON INPUT FILE: EXCEPTION 0021H: PATH OR FILE NOT FOUND FILE: C:\ARCHIVOS DE PROGRAMA\KEIL\C51\LIB\C51FPS.LIB Target not created
//practice code for printf y putchar #include<reg922.h> #include<stdio.h> //************** char putchar (char k){ P0=k; //put the value on Port 0 return k; }
void main(){ int a; float c=3.1416; printf("RESULTS: \n"); for(a=1;a<4;a++){ c+=0.2; printf("value of PI: %f \n",c); } }
Sir, I am using uVision2 which is suposed to support floatings.
Do you know the meaning of the error? What is wrong in my code? I appreciate so much your time
Yes, we very much know the meaning of this error message:
"*** FATAL ERROR L210: I/O ERROR ON INPUT FILE: EXCEPTION 0021H: PATH OR FILE NOT FOUND FILE: C:\ARCHIVOS DE PROGRAMA\KEIL\C51\LIB\C51FPS.LIB"
It means exactly what it says: That the file "C:\ARCHIVOS DE PROGRAMA\KEIL\C51\LIB\C51FPS.LIB" can not be found.
Without the library containing the emulation functions for floating point (the C51 processor do not have any floating point instructions...) it is not possible to link your application.
Do you have such a file on your disk? Is it at the correct location? Are all other Keil tools installed in the C:\ARCHIVOS DE PROGRAMA\KEIL\ directory tree?
Dear Per, Thanks for your help. I do not find it. Do you have it? could you please send me a copy to opiedrahita2003@yahoo.com to test if it is the problem?. Before sending a complain of the seller.
I appreciate so much your time
Omar
A complaint to the seller? You have a valid license bought from a Keil distributor?
If so, just call them. The supplied CD should contain everything you need.
Not in the free evaluation version, it doesn't...
You can use my code to init your program in Keil.
TMOD = 0x21; //Use Timer 2 generate Baud Rate , T2CON Registers. //equation: Baud Rate=Oscillator Frequency/[32*(65536-RCAP2H,RCAP2L)] CP_RL2=0;//Reload C_T2 = 0;//Timer EXEN2= 0; TCLK = 1; RCLK = 1; EXF2 = 0; RCAP2L =0xFD;//Baud Rate=115.200 ( RCAP2H,RCAP2L=0xFFFD) RCAP2H =0xFF; TR2 = 1;//Start timer2. <endcode) Have fun.
And how could that possibly make any difference whatsoever to the compiler finding (or not finding) the floating point libraries?!