The reason your "newest" code fails is the bank selection is wrong
BCF STATUS, RP1 and BCF STATUS, RP0 = bank 1
BCF STATUS, RP1 and BSF STATUS, RP0 = bank 2
Here is the exact code I used
BCF STATUS, RP1 and BCF STATUS, RP0 = bank 1
BCF STATUS, RP1 and BSF STATUS, RP0 = bank 2
Here is the exact code I used
Code:
list p=16F870
include "P16F870.inc"
__config 0xFF3A
c1 equ 20h
c2 equ 21h
c3 equ 22h
dummy equ 28h
org 00h
goto main
main
BANKSEL STATUS
bsf STATUS, C
BANKSEL TRISB
movlw b'00000000'
movwf TRISB
BANKSEL PORTB
movlw b'00000001'
movwf PORTB
loop
rlf PORTB
call _delay_1s
GOTO loop ; loop forever
_delay_1s
movlw 0x2c
movwf c1
movlw 0xE7
movwf c2
movlw 0x0B
movwf c3
_delay_1s_0
decfsz c1, f
goto $+2
decfsz c2, f
goto $+2
decfsz c3, f
goto _delay_1s_0
;3 cycles
goto $+1
nop
;4 cycles (including call)
return
END