Hi
 
I've got a problem I hope someone might help me with. I'm building an application using a 87C52 microcontroller.
 
 In the design I have tied the EA pin low so that all code memory is external. I've done this mostly because I don't have a programmer for the 87C52 but I do have a eprom programmer for a 27C256 device.
 
The problem I'm having is that the following simple program just does not run. I'm wondering if there is some additional software initialization need that I've overlooked. Of course I'm using the sdcc compiler and have been successful in writing code which I have downloaded to a develpoment board running the Paulmon2 software.
 
The code is simply intended to flash a LED which I have connected to an output pin of a 8255 io chip. Symptoms include the address lines are not functioning per the code, the RD pin appears inactive,and PSEN appears ok. I have both a eprom emulator and a eprom programmer tried both with similar results
 
CODE J1.c

#include <8051.h>
#include <paulmon2.h>

xdata at 0xa003 unsigned char abc_cnfg;  /* configure 8255*/
xdata at 0xa000 unsigned char port_a;    /* ouput*/
xdata at 0xa001 unsigned char port_b;    /* input*/
xdata at 0xa002 unsigned char port_c;    /*output*/

xdata at 0x8000 unsigned int n1;
 
 
void delay_ms(unsigned char ms)
{
 ms;
 _asm
        mov     r0, dpl
00001$: mov     r1, #250
00002$: nop
        nop
        djnz    r1, 00002$
        djnz    r0, 00001$
        ret
 _endasm;
}
  

void main(void)
{
       delay_ms(100); 
       abc_cnfg=130;
       port_c=0;
    
       while(1)
       {   
          port_c=128;                     /*turn light on*/
          for(n1=0;n1<=500;n1++)
          delay_ms(1);                    /* copyed paulmon2 delay function*/
          
          port_c=0;                       /*turn led off*/
                for(n1=0;n1<=500;n1++)
          delay_ms(1);
      }

}

*************************************************************************************

The command line for the sdcc compiler is:

sdcc  --code-loc 0x0000  --stack-after-data --xram-loc 0x8000 -I c:\sdcc\share\sdcc\include j1.c

**************************************************************************************

Can any one tell me if I've overlooked something regarding the initialization of the chip. I have looked at the J1.lst and J1.map files and it appears as though the compiler has automatically called  _sdcc-external-startup.

If anyones interested I will be glad to send a schematic of how I connected the devices

Thanks

Jim Peterson