// blink.c #pragma chip PIC16F877 // The Mark III BootLoader requires a GOTO at address 0x0003 rather than 0x0000 #pragma resetVector 0x0003 bit LED @ PORTD.0; //J1 Pin40 = D0 void main( void ) { uns8 Y; // outter loop counter uns8 Z; // inner loop counter PORTD = 0b.0000.0000; TRISD = 0b.1111.1110; while ( 1 ) { // loop forever // Y for ( Y = 0; Y < 255; Y++) { // Z for ( Z = 0; Z < 255; Z++) { nop(); // do nothing } } LED = ! LED; // toggle pin D0 } }