/* Blinky.C - LED Flasher for the Keil LPC900 EPM Emulator/Programmer Module */

#include <REG936.H>			// register definition

void delay (unsigned long cnt)
{
  while (--cnt);
}

void main()
{
  unsigned char i;

  P1M1 |= 0x20;
  P1M2 &= 0xDF;

  P2M1 &= 0xE7;
  P2M2 |= 0x18;

  delay (20000);
  for(;;)
  { for (i = 0x01; i; i <<= 1)
    { 
      P2 = i;				// simulate running LEDs
      delay (20000);
    }
    for (i = 0x80; i; i >>= 1)
    { 
      P2 = i;
      delay (20000);
    }
  }