This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hex problem

dear viewers,
when i create hex files it appears to to be incomplete what is the problem please help me
i do these all things
1.project>new micro vision project>save>select device>
file>new
2.write the program
3.options the for target>set the crystal frequency>cod ROM sizes (all) no changes occurs if changes sizes>output >tick the hex
these are performed please guide me to create a complete hex file.
regards
rahul

Parents
  • sir,
    this will be my program in 8051 i cannot edit this due to keil hex problem i given its actual hexfile also

    #include <reg51.h>
    sbit start=P3^3; // Preparing Pin's For Microconroller
    sbit end=P3^4;
    sbit oe=P3^5;
    sbit ale=P3^6;
    sbit clock=P3^2;

    unsigned char sensor=0;

    void delay() //Simple Delay
    { int k,l; for(k=0;k<30;k++) for(l=0;l<80;l++);
    } void initSerial() //Initialize the MCU
    { TMOD=0x22; TH1=0xFD; SCON=0x50; TR1=1; EA=1; ES=1;
    } void usDelay(int a) //Initialize Clock for ADC0808 that work with 10kHz
    { TH0=256-(a/1.085); TR0=1; ET0=1;
    } void timerRoutine() interrupt 1
    { clock=~clock;
    } void sendChar(unsigned char ch) // For sending Data
    { SBUF=ch; while(!TI); TI=0;
    }

    void sendReading(unsigned char val) // Sending reading of ADC (1-Character at atime) & ','
    { sendChar(val); sendChar(',');
    } void latch() // Latch the Address of ADC
    { ale=0; delay(); ale=1;

    }
    void startConv() // Start Convertion
    { delay(); start=0; delay(); start=1;
    } void wait() //Wait the interrupt (end of convertion (EOC))
    { while(end==1);
    } void get() // to get data from ADC
    { delay(); oe=0; delay(); oe=1;
    } void main() // the main Program
    {

    unsigned char reading; P1=0; initSerial(); usDelay(50); while(1) { if(sensor==8) // sensor for 8-channel sensor=0; if(sensor==0) sendChar('N'); //Evry 8-Reading send 'N' Character P1=(P1&0xf8)+sensor; latch(); startConv(); wait(); get(); reading=P2; sendReading(reading); sensor++;

    }
    }

Reply
  • sir,
    this will be my program in 8051 i cannot edit this due to keil hex problem i given its actual hexfile also

    #include <reg51.h>
    sbit start=P3^3; // Preparing Pin's For Microconroller
    sbit end=P3^4;
    sbit oe=P3^5;
    sbit ale=P3^6;
    sbit clock=P3^2;

    unsigned char sensor=0;

    void delay() //Simple Delay
    { int k,l; for(k=0;k<30;k++) for(l=0;l<80;l++);
    } void initSerial() //Initialize the MCU
    { TMOD=0x22; TH1=0xFD; SCON=0x50; TR1=1; EA=1; ES=1;
    } void usDelay(int a) //Initialize Clock for ADC0808 that work with 10kHz
    { TH0=256-(a/1.085); TR0=1; ET0=1;
    } void timerRoutine() interrupt 1
    { clock=~clock;
    } void sendChar(unsigned char ch) // For sending Data
    { SBUF=ch; while(!TI); TI=0;
    }

    void sendReading(unsigned char val) // Sending reading of ADC (1-Character at atime) & ','
    { sendChar(val); sendChar(',');
    } void latch() // Latch the Address of ADC
    { ale=0; delay(); ale=1;

    }
    void startConv() // Start Convertion
    { delay(); start=0; delay(); start=1;
    } void wait() //Wait the interrupt (end of convertion (EOC))
    { while(end==1);
    } void get() // to get data from ADC
    { delay(); oe=0; delay(); oe=1;
    } void main() // the main Program
    {

    unsigned char reading; P1=0; initSerial(); usDelay(50); while(1) { if(sensor==8) // sensor for 8-channel sensor=0; if(sensor==0) sendChar('N'); //Evry 8-Reading send 'N' Character P1=(P1&0xf8)+sensor; latch(); startConv(); wait(); get(); reading=P2; sendReading(reading); sensor++;

    }
    }

Children