MPLAB error

Discussion in 'Programmer's Corner' started by knwnuts, Mar 12, 2009.

  1. knwnuts

    Thread Starter New Member

    Mar 4, 2009
    3
    0
    Hi...im using MPLAB IDE(lite) to program pic. But i have this error which i have no idea where to check. Anyone can help?
    The error is as below:
    Error [1347] ; 0. can't find 0x90 words (0x90 withtotal) for psect "text76" in segment "CODE" (largest unused contiguous range 0x31)
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Post your code.
     
  3. knwnuts

    Thread Starter New Member

    Mar 4, 2009
    3
    0
    the code is quite long...and i've put bank1 to the arrays..the errors are lesser now..the errors:
    Executing: "C:\Program Files\HI-TECH Software\PICC\LITE\9.60\bin\picl.exe" -C "C:\Documents and Settings\admin\Desktop\ZD\main.c" --chip=16F627A -P --opt=default -q -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
    Warning [348] C:\Documents and Settings\admin\Desktop\ZD\main.c; 36.23 auto variable "delay_addr" should not be qualified
    Warning [348] C:\Documents and Settings\admin\Desktop\ZD\main.c; 37.23 auto variable "delay_cmd1" should not be qualified
    Warning [348] C:\Documents and Settings\admin\Desktop\ZD\main.c; 38.23 auto variable "delay_cmd2" should not be qualified
    Warning [348] C:\Documents and Settings\admin\Desktop\ZD\main.c; 39.23 auto variable "delay_cmd3" should not be qualified
    Warning [348] C:\Documents and Settings\admin\Desktop\ZD\main.c; 40.23 auto variable "delay_cmd4" should not be qualified
    Executing: "C:\Program Files\HI-TECH Software\PICC\LITE\9.60\bin\picl.exe" -oillum_fw.cof -millum_fw.map --runtime=default,-clear,-init,-keep,-osccal,-download,-ramtest,-resetbits main.obj "C:\Documents and Settings\admin\Desktop\ZD\illum_fw.hex" --chip=16F627A -P --opt=default -q -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
    Error [491] ; . can't find 0x114 words for psect "rbss_0" in segment "BANK0"
    Error [491] ; . can't find 0x14 words for psect "rdata_0" in segment "BANK0"
    Error [593] ; . can't find 0x3F6 words (0x3f6 withtotal) for psect "text10" in segment "CODE"


    not so sure if putting bank1 is a gd idea.

    Code ( (Unknown Language)):
    1. #include <pic.h>
    2. #include "delay_.h"
    3.  
    4. char led_c=2;    
    5. long counter = 0;    
    6. char stepPointer = 0;  
    7. bit flagA;
    8. bit flagB;
    9. bit flagP;
    10. bit flagM;
    11. char a;
    12. char resol = 0xFE;    
    13. int i;
    14. #include "step_table.h"  
    15. #define  button_A RA4
    16. #define  button_B RA1
    17. #define  button_P RA3
    18. #define  button_M RA2
    19. #define  G1_LED1  RB6  
    20. #define  G1_LED2  RB2  
    21. #define  G1_LED3  RB4  
    22. #define  G2_LED1  RB1  
    23. #define  G2_LED2  RB5
    24. #define  transmitted RB7
    25. #include "initialize.h"  
    26. #include "buttonM.h"
    27. #include "buttonP.h"
    28. #include "buttonA.h"
    29. #include "buttonB.h"  
    30.  
    31. void main(void)
    32. {
    33.  bank1 int delay_addr[]= {9000,4500,560,560,560,1690,560,1690,560,560,560,560,560,560,560,560,560,1690,560,1690,2250,560,560,560,1690,560,560,560,1690,560,1690,560,560}; //0x61d6
    34.  bank1 int delay_cmd1[]= {560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,560,1690}; //0x48
    35.  bank1 int delay_cmd2[]= {560,560,1690, 560,1690,560, 560,1690,560, 560,1690,560, 560,1690,560, 560,560,560,  560,560,560, 560,560,560}; //0x78
    36.  bank1 int delay_cmd3[]= {560,560,1690, 560,1690,560, 560,560,1690, 560,1690,560, 560,1690,560, 560,560,560,  560,560,560, 560,560,560}; //0x58
    37.  bank1 int delay_cmd4[]= {560,1690,560, 560,560,1690, 560,1690,560, 560,560,1690, 560,560,1690, 560,560,1690, 560,560,1690, 560,560,1690}; //0xA0
    38.  __CONFIG(0x3E01);
    39.  initialize();
    40.  for (i=0; i<2; i++)
    41.  {
    42.   DelayUs(delay_addr[i]);
    43.  }
    44.  for(i=2; i<18 ;i++)
    45.  {
    46.   G1_LED1=1;
    47.   DelayUs(delay_addr[i*2-1]);
    48.   G1_LED1=0;
    49.   DelayUs(delay_addr[i*2]);
    50.  }
    51.   if (button_A==1)
    52.  {
    53.   for(i=0; i<8 ;i++)
    54.   {
    55.    G1_LED1=1;
    56.    DelayUs(delay_cmd1[i*3]);
    57.    G1_LED1=0;
    58.    DelayUs(delay_cmd1[i*3+1]);
    59.   }
    60.   for(i=0; i<8 ;i++)
    61.   {
    62.    G1_LED1=1;
    63.    DelayUs(delay_cmd1[i*3]);
    64.    G1_LED1=0;
    65.    DelayUs(delay_cmd1[i*3+2]);
    66.   }
    67.  }
    68.  if (button_B==1)
    69.  {
    70.   for(i=0; i<8 ;i++)
    71.   {
    72.    G1_LED1=1;
    73.    DelayUs(delay_cmd2[i*3]);
    74.    G1_LED1=0;
    75.    DelayUs(delay_cmd2[i*3+1]);
    76.   }
    77.   for(i=0; i<8 ;i++)
    78.   {
    79.    G1_LED1=1;
    80.    G1_LED1=0;
    81.    DelayUs(delay_cmd2[i*3+2]);
    82.   }
    83.  }
    84.  if (button_M==1)
    85.  {
    86.   for(i=0; i<8 ;i++)
    87.   {
    88.    G1_LED1=1;
    89.    DelayUs(delay_cmd3[i*3]);
    90.    G1_LED1=0;
    91.    DelayUs(delay_cmd3[i*3+1]);
    92.   }
    93.    DelayUs(delay_cmd2[i*3]);
    94.   for(i=0; i<8 ;i++)
    95.   {
    96.    G1_LED1=1;
    97.    DelayUs(delay_cmd3[i*3]);
    98.    G1_LED1=0;
    99.    DelayUs(delay_cmd3[i*3+2]);
    100.   }
    101.  }
    102.  if (button_P==1)
    103.  {
    104.   for(i=0; i<8 ;i++)
    105.   {
    106.    G1_LED1=1;
    107.    DelayUs(delay_cmd4[i*3]);
    108.    G1_LED1=0;
    109.    DelayUs(delay_cmd4[i*3+1]);
    110.   }
    111.   for(i=0; i<8 ;i++)
    112.   {
    113.    G1_LED1=1;
    114.    DelayUs(delay_cmd4[i*3]);
    115.    G1_LED1=0;
    116.    DelayUs(delay_cmd4[i*3+2]);
    117.   }
    118.  }
    119.  while(1)
    120.  {
    121.   for(counter=0; counter<AUTOOFFTIME; counter++)  
    122.   {
    123.    DelayMs(5);  
    124.    if(AUTOOFF==0) counter=0;
    125.    if (button_A == 0)
    126.    {
    127.     buttonA();  
    128.     counter = 0;
    129.    }
    130.    else if (button_B == 0)
    131.    {
    132.     buttonB();    
    133.     counter = 0;  
    134.    }
    135.  
    136.    else if (button_P == 0)
    137.    {
    138.     buttonP();    
    139.     counter = 0;    
    140.    }
    141.  
    142.    else if (button_M == 0)
    143.    {
    144.     buttonM();    
    145.     counter = 0;  
    146.    }
    147.  
    148.    else
    149.    {
    150.     asm("nop");
    151.    }
    152.   }
    153.  
    154.  a = PORTB;
    155.  PORTB =1;    
    156.  CCP1CON = 0;  
    157.  while (1)          
    158.  {
    159.   DelayMs (5);
    160.   if ((PORTA & 30) != 30)
    161.   {
    162.     DelayMs (10);
    163.     CCP1CON = 0x1F;
    164.     asm("nop");
    165.     PORTB = a;
    166.     asm("nop");
    167.     counter = 0;
    168.     DelayMs (30);
    169.     break;
    170.   }
    171.  }
    172.   }
    173. }
    174. [/i]
     
  4. knwnuts

    Thread Starter New Member

    Mar 4, 2009
    3
    0
    Actually i made another program...but still the same kind of errors..
    Error [1347] ; 0. can't find 0x90 words (0x90 withtotal) for psect "text76" in segment "CODE" (largest unused contiguous range 0x31)
    Error [1347] ; 0. can't find 0x8C words (0x8c withtotal) for psect "text77" in segment "CODE" (largest unused contiguous range 0x31)
    Error [1347] ; 0. can't find 0x6A words (0x6a withtotal) for psect "text75" in segment "CODE" (largest unused contiguous range 0x31)
    Error [1347] ; 0. can't find 0x17 words (0x17 withtotal) for psect "text81" in segment "CODE" (largest unused contiguous range 0x0)


    Code ( (Unknown Language)):
    1.  
    Code ( (Unknown Language)):
    1.  
    2. #include <pic.h>
    3. #include "delay_.h"
    4. #include "ir_.h"
    5.  
    6. char led_c=2;    
    7. long counter= 0;  
    8. char stepPointer = 0;  
    9. bit flagA;
    10. bit flagB;
    11. bit flagP;
    12. bit flagM;
    13. char a;
    14. char resol = 0xFE;  
    15.  
    16. #include "step_table.h"  
    17.  
    18. #define  button_A RA4
    19. #define  button_B RA1
    20. #define  button_P RA3
    21. #define  button_M RA2
    22. #define  G1_LED1  RB6  
    23. #define  G1_LED2  RB2  
    24. #define  G1_LED3  RB4
    25. #define  G2_LED1  RB1
    26. #define  G2_LED2  RB5  
    27. #define  transmitted RB7
    28. #include "initialize.h"  
    29. #include "buttonM.h"
    30. #include "buttonP.h"
    31. #include "buttonA.h"
    32. #include "buttonB.h"  
    33. void main(void)
    34. {
    35.  __CONFIG(0x3E01);
    36.  initialize();  
    37.  while(1)
    38.  {
    39.      
    40.  
    41.   for(counter=0; counter<AUTOOFFTIME; counter++)    //an infinite loop for continuous reading of interrupts.
    42.   {
    43.    DelayMs(5);  
    44.        
    45.    if(AUTOOFF==0) counter=0;
    46.    if (button_A == 0) //if button A press down
    47.    {
    48.     Send_IR_Command(0b0110000111010110,0b01001000);
    49.     buttonA();  
    50.     counter = 0;
    51.    }
    52.    else if (button_B == 0) //if button B press down
    53.    {
    54.     Send_IR_Command(0b0110000111010110,0b01111000);
    55.     buttonB();    
    56.     counter = 0;  
    57.    }
    58.  
    59.    else if (button_P == 0) //if button '+' press down
    60.    {
    61.     Send_IR_Command(0b0110000111010110,0b01011000);
    62.     buttonP();    
    63.     counter = 0;    
    64.    }
    65.  
    66.    else if (button_M == 0) //if button '-' press down
    67.    {
    68.     Send_IR_Command(0b0110000111010110,0b10100000);
    69.     buttonM();    
    70.     counter = 0;  
    71.    }
    72.  
    73.    else
    74.    {
    75.     asm("nop");
    76.    }
    77.   }
    78.   a = PORTB;
    79.  
    80.   PORTB =1;  
    81.   CCP1CON = 0;  
    82.   while (1)    
    83.        
    84.   {
    85.    DelayMs (5);
    86.    if ((PORTA & 30) != 30)
    87.    {
    88.     DelayMs (10);
    89.     CCP1CON = 0x1F;
    90.     asm("nop");
    91.     PORTB = a;
    92.     asm("nop");
    93.     counter = 0;
    94.     DelayMs (30);
    95.     break;
    96.    }
    97.   }
    98.  }
    99. }
    100.  
     
  5. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Usually the error means there is not enough memory location to place some variables. I see that you include other files, which are not posted above. It might be arrays in those other files are too large.
     
  6. hatteet

    New Member

    Mar 23, 2009
    1
    0
    hello everybody......
    how are you??
    i need a necessery help ....
    i need the wiper motor mplab code so that i can control it using the 16f877a pic..
    thank u for helping me...
    i need it in the nearest time plz....
    thank u again


    this is my e-mail for contact me
    hatteet@yahoo.com
     
Loading...