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.
hi i got the following error while trying to link there is no compilation error the source code is
void timer0(void) interrupt 1 { TR0=0;//stop timer if(loadstatus==1 && onehour==0) //if motor is running and one hour has not gone increment the timer { if(count<20) // count++; else { count=0; if(sec<59) sec+=1; else { sec=0; if(min<59) min+=1; else min=0; } } } else { if(counterstate==1) { if(count>0) count--; else { count=19; if(sec>0) sec--; else { sec=59; if(min>0) min--; } } } } TH0=0x4B;//value loaded to timer is for 1/20 sec delay TL0=0xFD; TR0=1;//start timer }
the error generated is
*** ERROR L121: IMPROPER FIXUP MODULE: charge.obj (CHARGE) SEGMENT: ABSOLUTE OFFSET: 000BH
plz help me and give me solution soon
i tried them all. i saw all the links deeper inside to find the solution. there is no any solution.
i changed my code as follows if it could solve the problem, but the problem persists.
void timer0(void) interrupt 1 { tr0(); }
tr0() is a new function which is called when timer 0 interrupt overflows. i put all the commands in the interrupt subroutine in the function tr0() but the problem is same. i am in hurry and i am giving my all the time to solve the problem. but failed each time
Really?
Did you actually read them thoroughly and carefully?
Did you think about how what they said might apply to your situation?
They said:
"This error occurs when an instruction tries do make a memory access that is outside the scope of this instruction (for example MOVX @Ri outside of the PDATA page, or ACALL outside of the 2KB code memory block)."
Have you checked to see if this might apply to your situation?
Did you thoroughly and carefully read the linked pages which give examples?
That is your problem!
This is not trivial stuff! You need to spend time studying the manuals and gaining familiarity with the tools before you will be able to use them effectively!
"is there any other c- compiler for 8051?"
Yes, there are many - but you will always get yourself into the sames kinds of mess if you just try to jump in without proper study/preparation.
"i think it is the problem of keil."
No, it is the problem of insufficient study.