PIC16F877 and Pins Prob

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View


Hi,

I have a problem when I tried to activate 3 PINs simultaneously... :-(
I have this prob too when I only set 2 Pins which are following from a
simple command; the  command will not be executed :-(
Has anyone ever had this ?

Thanks

Chris


Re: PIC16F877 and Pins Prob


If you are trying to do either a BSF or a BCF try inserting a NOP
after each instruction.

Or trying to modify all pins directly via the AND instruction.

Hopefully this helps....


wrote:

Quoted text here. Click to load it


Re: PIC16F877 and Pins Prob



Quoted text here. Click to load it
Do you use opencollector driver pins?
Some pins will pull only low, you have to use a resistor to pull these pins
high.
Some PIC's use a command for port B to activate internal pull-up.

Alexander



Re: PIC16F877 and Pins Prob




Quoted text here. Click to load it
pins

The PORTB pull-ups are for input only.  All PORTB pins are totem-pole
outputs.  The OP probably has them heavily loaded so he/she is
experiencing the read-modify-write perils.  The use of a "shadow
register" would be appropriate here (and elsewhere for that matter :-).

http://www.sxlist.com/techref/readmodwrite.htm


Re: PIC16F877 and Pins Prob



Quoted text here. Click to load it

The RMW problem works on the other pins.
If I set pin 1, pin 1 is always set, the other pins may chage there value.



Re: PIC16F877 and Pins Prob



Quoted text here. Click to load it

TELL US MORE CHRIS

is port set up as an output
have you disabled the the ports other options
the easy way to set a whole port high is with a move

something  like :-

    movlw b'00000011'            ;the 11 being port bits  0 and 1
    movwf    portb                     ; loading port with value   .this
should set 2 pins high

as others have said  you can AND it too, But for we know you could be doing
this in picbasic  or something more exotic.

















Site Timeline