> All write ops perform a read first. From the '629/675 manual:
>
> "Reading the GPIO register reads the status of the pins,
> whereas writing to it will write to the port latch. All write
> operations are read-modify-write operations. Therefore,
> a write to a port implies that the port pins are read,
> this value is modified, and then written to the port data
> latch."
>
>
> Further along:
>
> "Any instruction that specifies a file register as part of
> the instruction performs a Read-Modify-Write (R-M-W)
> operation. The register is read, the data is modified,
> and the result is stored according to either the instruction,
> or the destination designator d . A read operation
> is performed on a register even if the instruction writes
> to that register... For example, a CLRF GPIO instruction will read
> GPIO,
> clear all the data bits, then write the result back to
> GPIO. THIS EXAMPLE WOULD HAVE THE UNINTENDED RESULT
> THAT THE CONDITION THAT SETS THE GPIF FLAG WOULD BE
> CLEARED."
>
> (my emphasis added)
>
> As noted by others, the IOC function can be used as long as the above
> is
> taken into condsideration. But the R-M-W "glitch" is real and must be
> dealt
> with. Ignoring it (as I did early on) will eventually result in
> software
> that seems flakey and intermittent.
>
> Hope this helps-
> Tom
>
>> Quote from the 12f manual:
>> "If a change on the I/O pin should occur when the read operation is
>> being executed (start of the Q2 cycle), then the GPIF interrupt flag
>> may not get set. "
>>
>> It specifically mentions the Q2 cycle.
>>
>> Quote from the mid-range manual:
>> "Q1: Instruction Decode Cycle or forced No operation
>> Q2: Instruction Read Data Cycle or No operation
>> Q3: Process the Data
>> Q4: Instruction Write Data Cycle or No operation "
>>
>> So to me this looks like the bug is only in the Q2 read cycle, and
>> does not affect the write cycle.
>>
>> I could be doing something terribly evil, but I have several
>> prototypes that do a lot of constant writing to GPIO and still rely on
>> IOC to interupt and have not had any problems.
>>
>> - Ben
>
> --
>
http://www.piclist.com hint: The PICList is archived three different
> ways. See
http://www.piclist.com/#archives for details.
>
>