Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/03/06 22:10
Read: times


 
#109135 - what the hell is wrong here?
Responding to: ???'s previous message
this code send the following message while debugging in Keil:

"error 65: access violation at C:0x001D : no 'execute/read' permission"

Here is the code (sorry for the spacing, I don't know how to use the HTML tags):

/*------------------------------------------------
includes
------------------------------------------------*/
#include <stdio.h>
#include <reg52.h>

/*------------------------------------------------
declarations
------------------------------------------------*/
#define XTAL = 11059200

/*------------------------------------------------
declarations
------------------------------------------------*/
void serialini (void);
void serialint (void);

/*------------------------------------------------
The main C function. Program execution starts
here after stack initialization.
------------------------------------------------*/
void main (void) {

serialini(); /*Inicialize serial*/
printf ("Hello World\n");
while(1); /*infinite loop waiting for serial interruption*/
}

/*------------------------------------------------
Setup the serial port for 9600 baud at 11.0592MHz.
------------------------------------------------*/
void serialini (void){
EA = 0; /* disable interruptions */
SCON = 0x50; /* SCON: mode 1 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 0xfd; /* TH1: reload value for 9600 baud @ 11.0592MHz */
TL1 = 0xfd; /* TL1: reload value for 9600 baud @ 11.0592MHz */
IE = 0x98; /* IE: enable interrupts, enable T1 & serial int. */
TR1 = 1; /* TR1: timer 1 run */
TI = 0;
RI = 0;
EA = 1; /* enable interruptions */
}

/*------------------------------------------------
Serial interruption, echos the incoming byte
------------------------------------------------*/
void serialint (void) interrupt 4 using 2 {
/*------------------------------------------------
Received data interrupt.
------------------------------------------------*/
if (RI != 0){
RI = 0;

SBUF = 'R';
}

/*------------------------------------------------
Transmitted data interrupt.
------------------------------------------------*/
if (TI != 0){
TI = 0;

SBUF = 'T';
}
}


List of 13 messages in thread
TopicAuthorDate
c code failure            01/01/70 00:00      
   comments            01/01/70 00:00      
      Thanks Erik            01/01/70 00:00      
      what the hell is wrong here?            01/01/70 00:00      
         Debugging            01/01/70 00:00      
   what about tools ur using            01/01/70 00:00      
      resistor micro ????            01/01/70 00:00      
         that was just to know            01/01/70 00:00      
            areb you getting nothing            01/01/70 00:00      
      Keil / AT89S8252            01/01/70 00:00      
         What is wrong here?            01/01/70 00:00      
            Absolutely!!!            01/01/70 00:00      
               Thanks            01/01/70 00:00      

Back to Subject List