Scott Pierce wrote: Don't forget PORTA works even though you are not using it. The inputs will float if left as unconnected inputs, so set them as outputs to keep the chip happy. > start movlw 0x00 tris porta ;<<<<< ADDED > tris portb ;set portb to all outputs > movlw 0xff ;set portb high > movwf portb ;set portb to all 0's > clrf counti ;set counti to 0 > clrf countj ;set countj to 0 > clrf count ;set count to 0 > ; > ;============================================================================== > ; > dispcnt movf count,w ;move contents of count into work register > movwf portb ;output contents of count to portb > call pause > incf count,f ;increment count by one, results stored in file reg > goto dispcnt ;start loop over again > ; > ;============================================================================== > ; The counter values were not as you say in your comments. You also had the delay kept in a permanent loop. The code changes appear below. > pause movlw 0x0f ;set counter to 254 movlw 0xFE ;set counter to 254 > movwf counti ;move work register to counti file register > loadj movlw 0x0f ;set countj to 255 movlw 0xFF ;set countj to 255 > movwf countj ;move work register to countj file register > decj decfsz countj,f;decrement countj, if zero skip next instruction > goto decj ;loop decj again until countj = 0 > decfsz counti,f;decrement counti, if zero skip next instruction goto decj ;loop loadj again until counti = 0 > goto loadj ;loop loadj again until counti = 0 > return ;when nested loops are done, return to dispcnt loop -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads