Al Williams: since elektroda is down...
Archiver
Posts: 46,084
Hi Al,
I'm having some problems with a 16F84A @20Mhz XTAL. I
suspect it's a RMW problem, however I can't 'see' the
solution. I have a pullup with a switch to Gnd on RA2.
I want to sink PORTB when the switch is thrown. On pin
RA2 i can see that i have 5v/0v when the switch is
thrown, however the program just sits in the 'loop'. I
have tried shadowed input, but that didnt help. I hit
a wall...maybe you can help
CLRF STATUS
CLRF PORTB
CLRF PORTA
BSF STATUS, RP0
MOVLW 0xFF
MOVWF TRISB
MOVLW 0x02
MOVWF TRISA
BCF STATUS, RP0
loop
BTFSC PORTA, 2
GOTO loop
loop2
MOVLW 0xFF
MOVWF PORTB
GOTO loop2
Thanks, Radu
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
I'm having some problems with a 16F84A @20Mhz XTAL. I
suspect it's a RMW problem, however I can't 'see' the
solution. I have a pullup with a switch to Gnd on RA2.
I want to sink PORTB when the switch is thrown. On pin
RA2 i can see that i have 5v/0v when the switch is
thrown, however the program just sits in the 'loop'. I
have tried shadowed input, but that didnt help. I hit
a wall...maybe you can help
CLRF STATUS
CLRF PORTB
CLRF PORTA
BSF STATUS, RP0
MOVLW 0xFF
MOVWF TRISB
MOVLW 0x02
MOVWF TRISA
BCF STATUS, RP0
loop
BTFSC PORTA, 2
GOTO loop
loop2
MOVLW 0xFF
MOVWF PORTB
GOTO loop2
Thanks, Radu
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
Comments
> loop2
> MOVLW 0x00
> MOVWF PORTB
> GOTO loop2
>
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
like a PEBKAC error.
***********
> I'm having some problems with a 16F84A @20Mhz XTAL.