Searching \ for 'why does the pull up fail with the new code ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=why+does+pull+fail
Search entire site for: 'why does the pull up fail with the new code ?'.

Truncated match.
PICList Thread
'why does the pull up fail with the new code ?'
1997\03\17@011301 by Kerzer Computers

flavicon
face
Using a PIC16C84, I have written some code for my electronic gate. The first
part  goes  like this...


;******************************************************************
;       THIS SECTION SETS UP THE I/O PINS ON PORT A AND B         *
;******************************************************************

       BSF     STATUS,RP0      ;CLEAR RP0 IN STATUS REGISTER
       MOVLW   B'0000000'      ;MOVE BINARY TO W
       MOVWF   PORTA           ;SET A0-A4 AS OUTPUTS
       MOVLW   B'11111111'     ;MOVE BINARY TO W
       MOVWF   PORTB           ;SET B0-B7 AS INPUTS
       MOVLW   B'00000100'
       MOVWF   OPTION_REG      ;ENABLE PORTB PULLUP
       BCF     STATUS,RP0      ;SELECT PAGE 0
       CLRF    PORTA           ;CLEAR PORTA
       CLRF    PORTB           ;CLEAR PORTB

and the second goeslike this...


INIT_TIMER

;       BSF     STATUS,RP0
;       MOVLW   B'00000100'             ;DIVIDE BY 32,ENABLE PULLUP
;       MOVWF   OPTION_REG
       BCF     STATUS,RP0
       MOVLW   B'10100000'
       MOVWF   INTCON
;       MOVLW   .102
;       MOVWF   TMR0

the parts that are remmed out were me trying to find the problem. What
happens is that the pullup does not seem to work with the second code
section added. Using the timer interupt was an addition. In the first part
of the code I specificaly cleared the pullup bit to enable it. I can't  get
it to work together and I don't know why. Please help

Gordon
Gordon  Zerf

Director - KerZer Computers

1997\03\17@054658 by Kerzer Computers

flavicon
face
Using a PIC16C84, I have written some code for my electronic gate. The first
part  goes  like this...


;******************************************************************
;       THIS SECTION SETS UP THE I/O PINS ON PORT A AND B         *
;******************************************************************

       BSF     STATUS,RP0      ;CLEAR RP0 IN STATUS REGISTER
       MOVLW   B'0000000'      ;MOVE BINARY TO W
       MOVWF   PORTA           ;SET A0-A4 AS OUTPUTS
       MOVLW   B'11111111'     ;MOVE BINARY TO W
       MOVWF   PORTB           ;SET B0-B7 AS INPUTS
       MOVLW   B'00000100'
       MOVWF   OPTION_REG      ;ENABLE PORTB PULLUP
       BCF     STATUS,RP0      ;SELECT PAGE 0
       CLRF    PORTA           ;CLEAR PORTA
       CLRF    PORTB           ;CLEAR PORTB

and the second ( added later on  and causing the problem )goes like this...


INIT_TIMER

;       BSF     STATUS,RP0
;       MOVLW   B'00000100'             ;DIVIDE BY 32,ENABLE PULLUP
;       MOVWF   OPTION_REG
       BCF     STATUS,RP0
       MOVLW   B'10100000'
       MOVWF   INTCON
;       MOVLW   .102
;       MOVWF   TMR0

the parts that are remmed out were me trying to find the problem. What
happens is that the pullup does not seem to work with the second code
section added. Using the timer interupt was an addition. In the first part
of the code I specificaly cleared the pullup bit to enable it. I can't  get
it to work together and I don't know why. Please help
Gordon  Zerf

Director - KerZer Computers

1997\03\17@055942 by Andrew Warren

face
flavicon
face
Kerzer Computers <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> [snip]
>
> What happens is that the pullup does not seem to work with the
> second code section added. Using the timer interupt was an
> addition. .... I can't  get it to work together and I don't know
> why. Please help

Gordon:

I suspect that somewhere in your code, you're trying to modify TMR0
while the RP0 bit is set.  When you do that, of course, the TMR0
register isn't affected at all; instead, the OPTION register is
modified.

Search through your code for writes to TMR0 and make sure that the
RP0 bit is clear before each of them.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
===
=== Custodian of the PICLIST Fund -- For more info, see:
=== www.geocities.com/SiliconValley/2499/fund.html

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...