> > > > > My C program for flashing leds is not working. > > > /* Light the LEDs */ > > > LATD += 1; > > > > > > > Both of your programs use this to 'toggle' the LEDs, but > > I'm not sure it's a good idea due to the usual > > problems with Read/Modify/write on PICs. Just because you > > wrote a 1 or 0 to a port pin doesn't mean that's what will > > be read back when you read the port... > > > > Try it with a shadow register... > > latd_shadow += 1; > > LATD = latd_shadow; > > > > ok, I will try, and let you know > No, it not that. Here is my current program: #include #pragma config WDT = OFF #pragma config OSC = INTIO67 void delay (void) { int i; for (i = 0; i < 10000; i++) ; } void main (void) { /* Make all bits on the Port B (LEDs) output bits. * If bit is cleared, then the bit is an output bit. */ int mylatd; TRISD = 0; LATD = 3; mylatd=3; while (1) { /* Delay so human eye can see change */ delay (); /* Light the LEDs */ mylatd++; LATD = mylatd; } } -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist