Searching \ for 'Op code Help' 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=code+help
Search entire site for: 'Op code Help'.

Truncated match.
PICList Thread
'Op code Help'
1997\03\27@164838 by Miller, Steve

flavicon
face
Hi Folks,

I am working on some code that uses PortB interrupt on  change feature.
I know that
bit test are dangerous because of the read-modify-write sequence.  A few
weeks ago, I remember seeing a list of instructions that did not use
read-modify-write.  Now I cannot locate the list in the data books.
 Target device is 16C621.

Question 1:  Can anyone point we to the list?

Question 2:   Does the plain vanilla move instruction do a
read-modify-write?


Question 3:  What about   movf  portB,w ; retrieve a copy of PortB to W
    movwf  temp  ; save the copy in temp
    btfss  temp,7  ; test if Bit 7 of Port B is set
 Will this keep PortB from getting screwed up?


Thanks for your help.

---- Steve

1997\03\27@170323 by Andrew Warren

face
flavicon
face
Miller, Steve <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:


> I am working on some code that uses PortB interrupt on  change
> feature. I know that bit test are dangerous because of the
> read-modify-write sequence.
> ....
> What about:
>
>    movf  portB,w ; retrieve a copy of PortB to W
>    movwf  temp  ; save the copy in temp
>    btfss  temp,7  ; test if Bit 7 of Port B is set
>
> Will this keep PortB from getting screwed up?

Steve:

No, it won't... The problem isn't with modifying or writing the port;
it's with READING the port.  Any instruction that reads port B (which
means "any instruction that accesses port B", since every "write"
instruction does a read first) can potentially make you miss
change-on-portb interrupts.

Sorry.

-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...