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.
hello i send here my program in such way so it can not compiled but if i put the last two modul in vise versa ,i mean delay_time befor timer0 interrupt it is compiled please help message error is error 45: undefined symbole (pass-2) thanks for all; hamidi
//------------------------------------------------------------------------------ // Header files //------------------------------------------------------------------------------ #include <AT89x051.H>//header file for 892051 #include <STDIO.H> // Standard I/O header file #include <stdlib.h> //------------------------------------------------------------------------------ // Value Definitions //------------------------------------------------------------------------------ #define TRUE 0x01 // Value representing TRUE #define FALSE 0x00 // Value representing FALSE #define ON 0x01 // Value representing ON #define OFF 0x00 // Value representing OFF #define HIGH 0x01 // Value representing ON #define LOW 0x00 // Value representing OFF //#define DELAY_BLINK 1500 // Value for delay time - blink //------------------------------------------------------------------------------ // I/O Port Defines //------------------------------------------------------------------------------ #define SDATA P3_2 // Serial data #define SCLK P3_3 // Serial clock #define LOCK_DETECT P1_7 #define ALARM_LED P1_6 #define BUS_FAULT_LED P1_5 #define LIVE_LED P1 //------------------------------------ // Procedure: initialize_system // Inputs: none // Outputs: none //------------------------------------------------------------------------------ void initialize_system (void) { TMOD=0x16; TH0=0; TL0=0; ET0=1;//TIMER 0 INTURRUPT ENABLE TR0=1;//START TIMER 0 IT0=0;//EXTERNAL INTURRUPT 0 IS FALLING EDGE EX0=0;//ENABLE EXTERNAL INTURRUPT EA=1; } //////////////////////////////////////////////////////////////////////////////// // Routine: delay_time // Inputs: counter value to stop delaying // Outputs: none // Purpose: To pause execution for pre-determined time //////////////////////////////////////////////////////////////////////////////// void timer0 (void) interrupt 1 { static unsigned char idata var1=0; static unsigned char idata var2=0; if(++var1==255) { var1=0; if(++var2==13) { var2=0; read_from_8046(); } } TF0=0; EA=1; } void delay_time (unsigned int time_end) { unsigned int index; for (index = 0; index < time_end; index++); }
now a TRIPLE posting, IGNORE
Looks like you are using the Assembler to translate a C source. C files are translated with C51, not with A51.