We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
http://www.keil.com/support/docs/814.htm Jon
Isn't specifying the wrong interrupt number in the ISR definition the usual cause of this? eg: void Timer1(void) interrupt 4 instead of: void Timer1(void) interrupt 3
http://www.electro-tech-online.com/viewtopic.php?p=65736#65736 here is the full code, please tell me where am I wrong.
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
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
Thanks John, I think 0X01B is playing a vital role here. Which is a vector location for interrupt 1. Thanks, actually I was thinking in that way but soon gave up. And will not do it again. Thanks. I am trying it again and definately will get a solution.
I think 0X01B is playing a vital role here. Which is a vector location for interrupt 1. Hmmmm. It's certainly an interrupt vector, but it isn't for interrupt 1. Take a look at http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm. Jon
Sorry but I ment the same. Timer 1 interrupt vector location. Thanks anyway. Hoping for this help in future also.
"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." That was my point, really. If you get the interrupt number wrong on the ISR definition but enable the interrupt you thought you'd defined an ISR for, when that interrupt fires the CPU vectors to a location that either has no code or the wrong code. I only mentioned this as I seem to remember this being the solution to similar questions on the forum. I have no personal experience of the error in question, and little experience using the debugger.