target 89LPC932 from nxp

Gerard Bos
  • Gerard Bos

    Gerard Bos - 2008-11-25

    I'm working on a project that uses a 89LPC932 microprocessor from NXP. When I google to find compilers for this processor SDCC is one of the compilers that can build for this type of processor. But I can't find anywhere in the documentation that this processor is actually supported by SDCC.

    Is there anyone who can help me out? And if so, which compiler flags should I use?

    • Jesus Calvino-Fraga

      If the processor is 8051 compatible, then it is supported by SDCC!  But... it may take a bit of work to compile if a special function register (SFR) include file is not yet available for a particular processor.  Fortunately in your case, there is an include file for the P89LPC932 in the SDCC package: "P89LPC932.h".  Here it is an small example to get you started:

      #include <stdio.h>
      #include <serial_IO.h> // putchar() and getchar() are here...
      #include <P89LPC932.h>

      #define XTAL 7373000L
      #define BAUD 115200L
      #define TIMER1_RELOAD_VALUE (256L-(XTAL)/(32L*BAUD))

      void main (void)
          printf("Hello world!\n");

      To compile just type:

      sdcc test.c

      If everything goes ok file 'test.ihx' is generated.  That is the Intel-hex file you flash into the microcontroller.  You can find more information in the SDCC manual.  Note: I tested the above code in a P89LPC925 microcontroller as I don't have a P89LPC932.


      • Gerard Bos

        Gerard Bos - 2008-11-25

        Tnx! I'm going to try it asap!


Log in to post a comment.