I am currently evaluating your product to develop codefor the Philips 87LPC764. I have setup the compiler to use the Small memory module and when compiling with an interrupt routine I get the above error. If I comment out the interrupt the problem goes away. Can you please point me in the right direction? BTW this code is just junk and does not do much...I just wittled it down to try and find the problem. Regards, Dale #include <reg764.h> /* define 8051 registers */ #include <stdio.h> /* define I/O functions */ unsigned int interruptcnt; unsigned char second; void ext_int (void) interrupt 1 { } //{ // if (++interruptcnt == 4000) // { /* count to 4000 */ // second++; /* second counter */ // interruptcnt = 0; /* clear int counter */ // } //} void next_int () { if (++interruptcnt == 4000) { /* count to 4000 */ second++; /* second counter */ interruptcnt = 0; /* clear int counter */ } } main() { int x; next_int(); while(1) if(x); while(1) if(x); while(1) if(x); while(1) if(x); while(1) if(x); } Regards Dale
I have setup the compiler to use the Small memory module and when compiling with an interrupt routine I get the above error. If I comment out the interrupt the problem goes away. Can you please point me in the right direction? Hmmm, What's the full error message you receive from the linker. I tried your code here and it compiles and links just fine (even with the interrupt routine un-commented). Keil Support
I am at home now with a slightly different version as follows with the same problem. The full err message for this version is ERROR L121: IMPROPER FIXUP MODULE: 10025.obj (10025) SEGMENT: ABSOLUTE OFFSET: 0003 Target not created /*------------------------------------------------------------------------------ CSAMPLE1.C Copyright 1995-1999 Keil Software, Inc. ------------------------------------------------------------------------------*/ #pragma ROM (SMALL) #include <reg764.h> /* define 8051 registers */ //#include <stdio.h> /* define I/O functions */ //#include <C:\Keil\C51\LIB\Startup.a51> unsigned int interruptcnt; unsigned char second; timer0() interrupt 0 { second++; /* second counter */ } void testeagle() { while(1) { } } main(void) { int last_sec=0; //second=0; TMOD=0x03; TR0=0x0f; ET0=1; EA=1; testeagle(); while(1) { /* while((second-last_sec)<1); P1=1; last_sec=second; while((second-last_sec)<1); P1=0; last_sec=second; while((second-last_sec)<1); P1=1; last_sec=second; */ } }
Just a quick comment, it is unlikely that including an assembler file will ever work. I see that you commented it out but I am concerned to see it there at all. - Mark
Hmmm, It still works OK for me. What ELSE are you doing? Keil Support
I don't know. These are the options that I have set up for the project. Memory model - Small Vars in Data Code Rom Size - Small 2k or less (Though I've tried all 3 options for this with the same error.) Interrupt vectors selected at 0x0000 Code opt: Lvl 8 Favour size A51 Standard macro selected and define SFR selected. L51 locate - Use mem from target selected. That's about it??? Dale
Any other files in your project? Keil Support
No, wait... Remove the following...
#pragma ROM (SMALL)