Embedded code problem in 8051

Discussion in 'Embedded Systems and Microcontrollers' started by vinay arora, Sep 25, 2011.

  1. vinay arora

    Thread Starter New Member

    Jun 3, 2011
    15
    0
    Hiiiiiiii friends i am new to 8051 microcontroller. I have just made a simple code for my practice,but i got an error that is
    (*** error 65: access violation at C:0x0A00 : no 'execute/read' permission)
    program show no error at the time of building but at time of debugging compiler shows this error .
    when i made a modification in the program and remove for loop and in place of for loop apply infinite while its running successfully,so Is the problem in for loop?

    Here is my code

    Code ( (Unknown Language)):
    1.  
    2. [COLOR="Blue"]#include <reg51.h>
    3.   void MSDelay(unsigned int);
    4. sbit Dsensor=P1^1;
    5. sbit Buzzer=P1^7;
    6.  
    7. void main(void)
    8. {
    9. unsigned int c;
    10.  EA=0;
    11. Buzzer=1;
    12. TMOD =0X01 ;
    13. TL0=0X00;
    14. TH0=0X00;
    15. c=0;
    16. for(c=0;c<10;c++)
    17.  {
    18. TR0=1;
    19. while (TF0==0);
    20. TR0=0;
    21. TF0=0;
    22. MSDelay(200);
    23.    TL0=0X00;
    24. TH0=0X00;
    25. Buzzer =~Buzzer ;
    26.  
    27.  }
    28. }
    29.     void MSDelay(unsigned int time)
    30.           {
    31.       unsigned int i,j;
    32.      for (i=0;i<time;i++)
    33.       for (j=0;j<1275;j++);
    34.     }
    35. [/COLOR]
    36.  
     
    Last edited: Sep 25, 2011
Loading...