RobertD
New Member
Short flasher program with weak PORTB pull up. The pull up doesn't work for me, PORTB stays all 0's. It used to work, now I don't know why it doesn't work anymore. It's the same one I use for my long program, and it works there.
I want to know if your pull up work. My PORTA is working fine, but PORTB doesn't go up like it's supposed to.
(I set the timer to 1 because it's faster to step through.)
(PS: Now the PORTA pin doesn't go up anymore...?!?!?)
I want to know if your pull up work. My PORTA is working fine, but PORTB doesn't go up like it's supposed to.
(I set the timer to 1 because it's faster to step through.)
(PS: Now the PORTA pin doesn't go up anymore...?!?!?)
Code:
LIST p=16F88
include "P16F88.inc"
__config _CONFIG1, _WDT_OFF & _MCLR_ON & _LVP_OFF
TIMER1 EQU 0x20
TIMER2 EQU 0x21
org 0x00 ;start of program
init
banksel OPTION_REG ;bank 1
movlw 0x42 ;8MHz internal osc
movwf OSCCON
clrf ANSEL ;all A pins digital
movlw 0x00 ;all A pins outputs
movwf TRISA
movlw 0xFF ;all B pins inputs
movwf TRISB
movlw 0x00 ;PORTB pull up
movwf OPTION_REG
banksel PORTA ;select bank 0
clrf PORTA
main
bsf PORTA,6
call delay
bcf PORTA,6
call delay
btfss PORTB,4
goto main
;____________________________________
delay
MOVLW D'1'
MOVWF TIMER1
DELAY2
MOVLW D'2'
MOVWF TIMER2
DECFSZ TIMER2,F
GOTO $-1
DECFSZ TIMER1,F
GOTO DELAY2
RETLW 0
end
Last edited: