This is a multi-part message in MIME format. ------=_NextPart_000_01F9_01C12A67.7E303090 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi all, well after getting my programmer to work I loaded the example hex file that flashes an LED on port RB1 and wow! the LED flashes ! ;-) I have written a bunch of code in Hi TECH C integrated with Microchips MPLAB. To start of with I wrote my own version of the flashing LED program (attached) which flashes an LED on pin RB0. I compiled the code and loaded the hex file. However this time no flashing LED :-( Can anyone help me with this? Is there a bug in the code? I have gone over it and can't see any obvious mistakes. Is there anything special I have to do in MPLAB or HI TECH cmd line switches to get code that will run? Thanks for you help regards James Fitzsimons ------=_NextPart_000_01F9_01C12A67.7E303090 Content-Type: application/octet-stream; name="blinker.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="blinker.c" /********************************************************************** * * Filename: blinker.c *=20 * Description: The embedded systems equivalent of "Hello, World". * * Notes: The constants in this file are specific to PIC 16F84=20 * hardware. * * Written by James Fitzsimons for PIC hardware * 19/7/01 * **********************************************************************/ #include __CONFIG(UNPROTECT); // Cofiguration fuses XT|WDT off|PWT off|code = protect off //#include "led.h" #define CYCLES_PER_MS 500 /* Number of decrement-and-test cycles. */ /********************************************************************** * * Function: delay() * * Description: Busy-wait for the requested number of milliseconds. * * Notes: The number of decrement-and-test cycles per millisecond * was determined through trial and error. This value is * dependent upon the processor type and speed. * * Returns: None defined. * **********************************************************************/ void=20 delay(unsigned int nMilliseconds) { unsigned long nCycles =3D nMilliseconds * CYCLES_PER_MS; while (nCycles--); } /* delay() */ /********************************************************************** * * Function: main() * * Description: Blink the green LED once a second. *=20 * Notes: This outer loop is hardware-independent. However,=20 * it depends on two hardware-dependent functions. * * Returns: This routine contains an infinite loop. * **********************************************************************/ void main(void) { TRISB0 =3D 0; // Set pin 0 of PORTB to output while (1) { RB0 =3D 1; //toggleLed(); /* Change the state of the LED. = */ delay(500); /* Pause for 500 milliseconds. */ RB0 =3D 0; delay(500); /* Pause for 500 milliseconds. */ =20 } } /* main() */ ------=_NextPart_000_01F9_01C12A67.7E303090-- -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics