piclist 2003\02\22\160144a >
Thread: Pin won't turn off properly
www.piclist.com/techref/ubicom/devices.htm?key=sx
flavicon
face BY : David Duffy email (remove spam text)



>Russell:
> > >No (alas) - it's only fair to say that adding NOPs is a "solution" 'in
> this
> > >case'.
> > >ie not in every case.

>David Duffy wrote:
> > I don't think Jinx was saying that it was a solution for ALL cases.

Roman:
>Well, Jinx is a PIC genius, that's not in doubt.
>:o)
>BUT I do have to question the logic behind adding
>nops to a RMW, if you can afford one or more
>instructions timewise why not just movf,w then
>movwf PORT and write to the entire port??
>Or is there some esoteric benefit to clinging to
>a bsf PORT,x when you have cycles to spare??

What I was getting at is that there's nothing wrong with using BCF
and BSF instructions on a port as long as you're aware of R-M-W.
I don't agree that Russell's example case of a transistor is a valid
one - he & I will have to "agree to disagree" on that one. :-)
With a correctly designed circuit, the BCF/BSF instructions are a
valid way to code. I'd rather code it as "BSF PORTA,LED" than use
a shadow register and do:
BSF             SHADOW,LED
MOVF            SHADOW,F
MOVWF   PORTA
The BSF saves two instructions in this case. That may be important
in busy code running at less than blistering speeds. I've written heaps
of code that uses BCF/BSF and has/will always work just fine but I
also have written code that uses shadow registers when required.
David...

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
<5.2.0.9.2.20030223064715.00bcf4b8@audiovisualdevices.com.au>

In reply to: <3E5795D7.2AF9@ezy.net.au>
See also: www.piclist.com/techref/ubicom/devices.htm?key=sx
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Pin won't turn off properly

month overview.

new search...