Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Proteus simulation error

Status
Not open for further replies.
hello
I am doing my final year project SCADA. When i run the simulation this error occurs.
pic or eeprom data has invalid address[2000] for this device.

How to remove this error?
 

Attachments

  • Capture.PNG
    Capture.PNG
    18.6 KB · Views: 273

Mosaic

Well-Known Member
The EEPROM is located from 2100h-21FFh

You only need to know this if you are going to initialise the EEPROM in your source code, in which case you need an ORG 2100h before the DE statements.

When accessing the EEPROM in your code, this address is irrelevant, because you only specify an 8 bit offset into the EEPROM.

Also, why are your Crystal caps 1uF? Shouldn't they be in the lower pF range?
 
You need to post the code.... You are accessing eeprom data outside the limit of the device selected
Here's the code which display the values on LCD and sends them through GSM. There might be some error that maybe causing the simulation error. Can you figure it out?
C:
char str1[]="OK";
char AT[]="AT";
char terminator=0x1A;
sbit LCD_RS at RB2_bit;
sbit LCD_EN at RB3_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;

sbit LCD_RS_Direction at TRISB2_bit;
sbit LCD_EN_Direction at TRISB3_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
float v;


char txt[5];
char txt1[5];
void voltage_READ(void)
      {
           float max;
           int i;
           int t[40];
           ADCON0.ADON=1;
           for(i=0; i<=39; i++)
           {
           v= ADC_Read(0);  //Digital value convert
           v =v*(10.0/1023.0);
           v=(v-5.0);
           t[I]=v*110.1909091;
           }

           ADCON0.ADON=0;
           max=t[0];
           for(i=0; i<=39; i++)
           {
           if(max<t[I])
            max=t[I];
           }
           max=max*.707106781;
           intToStr(max, txt);
           Lcd_out(1,9,txt);
           delay_ms(1000);
      }
      void current_READ(void)
      {
           float max;
           int i,current;
           int t[40];
           ADCON0.ADON=1;
           for(i=0; i<=39; i++)
           {
           v= ADC_Read(1);
           v =v*(10.0/1023.0);
           v=(v-5.0);
           t[I]=v*10;
           }

           ADCON0.ADON=0;
           maxi=t[0];
           for(i=0; i<=39; i++)
           {
           if(max<t[I])
            maxi=t[I];
           }
           max=max*.707106781;
           intToStr(max, txt1);
           Lcd_out(2,8,txt1);
           delay_ms(1000);
      }

void main()
{         while(1)
         {

            Lcd_out(1,1, "Voltage:");
            Lcd_out(2,1, "Current:");
            voltage_READ();
            current_READ();
            }

        
          TRISC=0;

        char output[5];
          Lcd_Init();                        // Initialize LCD
          ADCON0.ADCS1=1;
          ADCON0.ADCS1=0;
          ADCON0.ADON=0;
          UART1_init(9600);                  //initialize UART
          UART1_write(AT);
          Delay_ms(100);
          UART1_Read_Text(output, "OK", 10);
          while(strcmp(str1,output)==0);
          UART1_write("AT+CMGF=1");
          Delay_ms(100);
          UART1_Read_Text(output, "OK", 10);
          while(strcmp(str1,output)==0) ;
          UART1_write("AT+CMGS=03027567568");
          Delay_ms(100);
          UART1_write(txt1);
          UART1_write(txt);
          UART1_write(terminator);

}
 
Last edited by a moderator:
The EEPROM is located from 2100h-21FFh

You only need to know this if you are going to initialise the EEPROM in your source code, in which case you need an ORG 2100h before the DE statements.

When accessing the EEPROM in your code, this address is irrelevant, because you only specify an 8 bit offset into the EEPROM.

Also, why are your Crystal caps 1uF? Shouldn't they be in the lower pF range?
How to change the 0ffset?
Does it affect the frequency? Should I change the capacitor ratings to pF?
 

Ian Rogers

User Extraordinaire
Forum Supporter
Most Helpful Member
For simulation, the osc circuit isn't needed...

In mikroC have you got the pic16f877a as the device.... As your code is okay.... If ISIS complains about invalid address it can only be two things...

Either your device is the wrong one or the code is being generated incorrectly... Check your settings in mikroC...
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top