Pin won't turn off properly
David Duffy email (remove spam text)
> > >No (alas) - it's only fair to say that adding NOPs is a "solution" 'in
> > >case'.
> > >ie not in every case.
>David Duffy wrote:
> > I don't think Jinx was saying that it was a solution for ALL cases.
>Well, Jinx is a PIC genius, that's not in doubt.
>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:
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.
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
In reply to: <3E5795D7.2AF9@ezy.net.au>
See also: www.piclist.com/techref/ubicom/devices.htm?key=sx
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the