Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me on mikroc 8.2 build error "Not enough RAM...&qu

Status
Not open for further replies.

aneeshere

Junior Member level 1
Joined
Jun 21, 2010
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,436
mikroc 8.2

Hi,
am doing a program in mikroc for pic 16f877a. When i tried to build the following error is displayed
"Not enough RAM Istr1_timer1leap"

timer1leap is the file name..
Can anyone helpl me
 

Help me on mikroc 8.2 build error "Not enough RAM...&am

Hi,
This is because 16F877A doesn't have enough RAM. You might want to recheck your code, or use a device with larger RAM, like 18F458, which has 1.5kByte RAM vs 368Byte of 16F877A.

Hope this helps.
Tahmid.

Added after 1 minutes:

I think you have used many 32-bit long or floating type variables. Try to use appropriate variable declaration when needed, so that minimum RAM is used.
 

Re: Help me on mikroc 8.2 build error "Not enough RAM..

Tahmid said:
Hi,
This is because 16F877A doesn't have enough RAM. You might want to recheck your code, or use a device with larger RAM, like 18F458, which has 1.5kByte RAM vs 368Byte of 16F877A.

Hope this helps.
Tahmid.

Added after 1 minutes:

I think you have used many 32-bit long or floating type variables. Try to use appropriate variable declaration when needed, so that minimum RAM is used.


I am using PIC16F877A to interface a password system and I wrote this code

Code:
char t;
char temp;
char ks[4];
char pp1[4];
char pp2[4];
char Ta[16]={'A','9','8','7','B','6','5','4','C','3','2','1','D','#','0','*'};
unsigned ec;
char factorypass[4]={'1','2','3','4'};
int flag;
int newflag;
int fcfp=0; // flag correct factory password
int compare(char*,char*);
void input(char*);







void main(){
            // se eeprom add 0x00
            Eeprom_Write(0x00,0);
            // fu eeprom add 0x01
            Eeprom_Write(0x01,0);
            TRISD=0x00;
            Lcd_Config(&PORTD,2,3,0,7,6,5,4);
            LCD_Cmd(LCD_Cursor_Off);
            Keypad_Init(&PORTC);


             while(1){
                      if(Eeprom_Read(0x00)==1){
                                               LCD_Cmd(LCD_Clear);
                                               LCD_Out(1,3,"system error");
                                               LCD_Out(2,3,"contact factory");
                                               delay_ms(20);
                                               break;
                                               }
                      if(Eeprom_Read(0x01)==0){
                                               while(fcfp==0){
                                               LCD_Cmd(LCD_Clear);
                                               LCD_Out(1,3,"enter factory");
                                               LCD_Out(2,3,"password");
                                               delay_ms(3000);
                                               LCD_Cmd(LCD_Clear);
                                               LCD_Chr(2,4,' ');
                                               input(ks);
                                               /*for(temp=0;temp<4;temp++){
                                                                              ec=0;
                                                                              while(ec==0)
                                                                                    ec = keypad_Released();
                                                                              LCD_Chr_Cp('*');
                                                                              t= Ta[ec-1];
                                                                              ks[temp] = t;
                                                                        }*/
                                               /*for(temp=0;temp<4;temp++){
                                                                         if(factorypass[temp]!=ks[temp])
                                                                                                         {flag=1;}
                                                                        }*/
                                               flag = compare(factorypass,ks);
                                               if(flag==1){
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Out(1,3,"enter new");
                                                           LCD_Out(2,3,"password");
                                                           fcfp=1;
                                                           delay_ms(3000);
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Chr(2,4,' ');
                                   inputpp1:                        /*for(temp=0;temp<4;temp++){
                                                                                          ec=0;
                                                                                          while(ec==0)
                                                                                                ec = keypad_Released();
                                                                                          LCD_Chr_Cp('*');
                                                                                          t= Ta[ec-1];
                                                                                          pp1[temp] = t;
                                                                                    }*/
                                                           input(pp1);
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Out(1,1,"enter the same");
                                                           LCD_Out(2,1,"password again");
                                                           delay_ms(3000);
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Chr(2,4,' ');
                                                           /*for(temp=0;temp<4;temp++){
                                                                                          ec=0;
                                                                                          while(ec==0)
                                                                                                ec = keypad_Released();
                                                                                          LCD_Chr_Cp('*');
                                                                                          t= Ta[ec-1];
                                                                                          pp2[temp] = t;
                                                                                    }*/
                                                           input(pp2);
                                                           /*for(temp=0;temp<4;temp++){
                                                                                     if(pp1[temp]!=pp2[temp])
                                                                                     {newflag=1;}
                                                                                    }*/
                                                           newflag = compare(pp1,pp2);
                                                           if(newflag==1){
                                                                          LCD_Cmd(LCD_Clear);
                                                                          LCD_Out(1,1,"doesn't match");
                                                                          LCD_Out(2,1,"enter again");
                                                                          delay_ms(3000);
                                                                          LCD_Cmd(LCD_Clear);
                                                                          LCD_Chr(2,4,' ');
                                                                          goto inputpp1;
                                                                          }
                                                           if(newflag==0){
                                                                          LCD_Cmd(LCD_Clear);
                                                                          LCD_Out(1,1,"you have set");
                                                                          LCD_Out(2,1,"new password");
                                                                          ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////cpppppp
                                                                          //////////////////////////////
                                                                          ///////////////////////////
                                                                          ////////////////////
                                                                          }

                                                           }


                                               if(flag==0){
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Out(1,3,"wrong factory");
                                                           LCD_Out(2,3,"password");
                                                           delay_ms(2000);
                                                           LCD_Cmd(LCD_Clear);
                                                           LCD_Out(1,1,"enter correct");
                                                           LCD_Out(2,1,"factory password");
                                                           }
                                                           }
                                               }
                                               }   /////main while end
                                               
} ///////////main func end

int compare(char* a,char* b){
                             int FF;
                             int i;
                             for(i=0;i<4;i++){
                                                       if(a[i]!=b[i])
                                                       {FF=1;
                                                        break;
                                                       }
                                              }
                             return FF;
                             }
                             
void input(char* c){
                    int j;
                    for(j=0;j<4;j++){
                                              ec=0;
                                              while(ec==0)
                                                          ec = keypad_Released();
                                               LCD_Chr_Cp('*');
                                               t= Ta[ec-1];
                                               c[j] = t;
                                              }
                   }

if I changed the pic16f877a, will I have to change the instructions ??
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top