In an effort to try to debug the program that I am having trouble with, I have stripped it down to the very basic essentials. It is now a program that should toggle some bits on and off depending on the value of bit RA4. If RA4 is high, RD7 and RD6 should toggle from high to low. If RA4 is low, then RD5 should toggle from high to low. (I know I typed RD5 in twice, but that should not make any difference.) The program works fine in the simulator (and I also know that the actual delay is a lot less than 1 millisecond...I just wanted to simplify the simulation). But, when I go to the actual board, everything just sits at zero!! The clock signals look fine, and the supply voltages are fine. I've tried several chips, so it is not a bad chip. I've tried turning on and off the power up timer, and I've turned off the watchdog timer. I've also turned off the brownout timer. Usually, I have the master clear tied directly to the power supply, but I've also tried tying it to 5 volts after the power supply is up and running. Nothing seems to matter. The really strange thing is that the simulation works fine, and I get no errors or warnings when I compile. I'm obviously doing something VERY wrong, but I don't know what it is. Ed /* This is the suspect c file */ #include #include void DelayMs(unsigned int cnt) { unsigned i; i=6; while(i!=0) i--; while(cnt!=0) cnt--; } void Initialize_Ports() { TRISB=0x00; // set port b as outputs TRISD=0x00 ; // set port d as output TRISA=0x3F ; // set port a as inputs TRISC=0x00 ; // set port c as output PORTD=0x00 ; // initialize port D to zero PORTC=0x00 ; // initialize port C to zero } main() { Initialize_Ports(); RD3=1; RD2=1; RC6=1; DelayMs(2) ; RD4=1; RD2=0; RC7=1; while(1) // loop forever { RC6=1; DelayMs(2) ; if (RA4 = 1) { RD7=1; RD6=1; DelayMs(1); RD7=0; RD6=0; } else { RD5=1; RD5=1; DelayMs(1); RD5=0; RD5=0; } } } -- 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