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
  • Isn't specifying the wrong interrupt number in the ISR definition the usual cause of this?

    Nope. Not the Error 65 from the debugger.

    When the debugger lolads your program, it automatically creates a MAP for all the segments in the program.

    When you write an interrupt service routine, the compiler creates a segment for the vector and a segment for the function code.

    The only reason you'll get an Error 65 is if you enable an interrupt for which there is no defined vector, if you access memory which is not declared (by a variable), or if your program runs amuck and jumps to a location in memory where no program code is located.

    Now, if your program uses a buffer (or some external program) that is not declared as a program object (using XBYTE or something like that) you will receive this error and you'll need to use the MAP command to tell the debugger that access to the memory is OK.

    Jon

Reply
  • Isn't specifying the wrong interrupt number in the ISR definition the usual cause of this?

    Nope. Not the Error 65 from the debugger.

    When the debugger lolads your program, it automatically creates a MAP for all the segments in the program.

    When you write an interrupt service routine, the compiler creates a segment for the vector and a segment for the function code.

    The only reason you'll get an Error 65 is if you enable an interrupt for which there is no defined vector, if you access memory which is not declared (by a variable), or if your program runs amuck and jumps to a location in memory where no program code is located.

    Now, if your program uses a buffer (or some external program) that is not declared as a program object (using XBYTE or something like that) you will receive this error and you'll need to use the MAP command to tell the debugger that access to the memory is OK.

    Jon

Children