Richard S wrote : > I gave this change a try. The system still counts to 111 then > either resets or rolls back over to 000 in an endless loop. But that is what you see on the LED's right ? Can you make some simple change to you code just to verify that you can lit up the other LEDs at all ? What I'm trying to say is that, maybe the system *do* count as it should, it just don't show on the LEDs. > Good thing is I think you just taught me how to name a > register. Use that name and tranfer data from one register to > another using W as the intermediary. :-)) The reason fpr this change, is that you should generally speaking be carefull with any "read-modify-write" instruction on the PORTx registers. As an example, the INCF instruction must first read whatever the PORTx reg is, increment the value and at last write the incremented value back to the PORTx register. On the other hand, a MOVWF instruction just writes to the PORTx reg (the read is done from the W regsiter). The problem with reading from the PORTx registers (without going into to much detail) is that you can (sometimes) not be sure that what you read, is what you wrote last time. Details in the docs, and it's a very well know "gotcha"... The standard cure is to keep a "shadow" register (portb_tmp in this case), then do any modifications on this register, and at last only *write* to the PORTx register using e.g. MOVWF. What I would do now, is to modify the code a little to verify that all 8 LED's actualy are working and are "settable" from the code. Something like : movlw x'hh' ; All "1" movwf portb : Send to portb loop goto loop ; Endless loop This should lit up all LEDs, I think. Jan-Erik. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.