This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial interrupt problem

Hi all,


I am facing a problem while debugging the code. The following error is comming and it is jumping to disassembly


Error message is


*** 65: access voilation at 0X001B: no 'execute/read' permission


This location is Timer 1 interrupt routine.





My code is as follows


Following is a part of total code.
<pre

void sendserial(char);

void init_run(void);

//void init_stop(void);

//void send_response(void);

void main(void)

{

P1 = 0x00 ; //Initialise P1.0 to P1.3 used as output &

//Initialise P1.4 to P1.7 used as input

SP = 0x50;

SCON = 0x50; //Set Serial IO to receive.And select mode1

TMOD = 0x21; //configure timer for the correct baud rate

TH0 = 0x00;

TL0 = 0xF7;

TH1 = 0xFD; //TH1: reload value for 9600baud @11.059MHz

TL1 = 0xFD; //TH1: reload value for 9600baud @11.059MHz

TCON = 0x00; //Set timer to not running

T2CON= 0x00;

T2MOD= 0x02;

// TI = 0; //clear transmit interrupt flag

// RI = 0; //clear receive interrupt flag

// TR0 = 1; //start timer 0

TR1 = 1; //start timer to Receive

TR2 = 0;

IE = 0xFA;

ET0 = 1; //enable timer 0 interrupt

// ET1 = 1;

EA = 1; //Enable global interrupt

ES = 1; //Enable serial interrupt

PS=1;

DE=0;



while(1)

{

if(run)

{

sendserial('R');

init_run();

}

if(stop)

{

sendserial('S');

//init_stop();

}

if(query)

{

sendserial('Q');

//send_response();

}

}

}



void sendserial(char command)

{

int j;

*(pos_ack+3) = command;

sencnd = 0;

sendchr = 7;

for(j=0; j < 7; j++)

{

*(send_buf+j) = pos_ack[j];

DE = 1;

TI = 0;

}

}



void init_run(void)

{

run=0;

TH2=0x13;

TL2=0x88;

Iref=0xff;

Delay=5000;

TR2=1;

Stat=1;

}



/*void init_stop(void)

{



}



void send_response(void)

{



}

Thanks in advance.

Parents
  • here is the full code, please tell me where am I wrong.

    You're very close to figuring this out yourself. If you give up now, you won't learn anything from this little adventure and you'll probably make the same mistake again.

    You first coment about the error 65 is going in the right direction. Keep looking.

    Jon

Reply
  • here is the full code, please tell me where am I wrong.

    You're very close to figuring this out yourself. If you give up now, you won't learn anything from this little adventure and you'll probably make the same mistake again.

    You first coment about the error 65 is going in the right direction. Keep looking.

    Jon

Children
No data