Embedded code problem in 8051

Thread Starter

vinay arora

Joined Jun 3, 2011
15
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

Rich (BB code):
#include <reg51.h>
  void MSDelay(unsigned int);
sbit Dsensor=P1^1;
sbit Buzzer=P1^7;

void main(void)
{
unsigned int c;
 EA=0;
Buzzer=1;
TMOD =0X01 ;
TL0=0X00;
TH0=0X00;
c=0;
for(c=0;c<10;c++)
 {
TR0=1;
while (TF0==0);
TR0=0;
TF0=0;
MSDelay(200);
   TL0=0X00;
TH0=0X00;
Buzzer =~Buzzer	;

 }
}
	void MSDelay(unsigned int time)
          {
      unsigned int i,j;
     for (i=0;i<time;i++)
      for (j=0;j<1275;j++);
    }
 
Last edited:
Top