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?
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 <serial_IO.h> // putchar() and getchar() are here...
#define XTAL 7373000L
#define BAUD 115200L
#define TIMER1_RELOAD_VALUE (256L-(XTAL)/(32L*BAUD))
void main (void)
To compile just type:
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.
Tnx! I'm going to try it asap!
Log in to post a comment.