[PicForth] Re: toggle .. silly question
Samuel Tardieu
sam at rfc1149.net
Thu May 12 12:43:51 CEST 2005
>>>>> "biff" == biff <biff at bitwisetech.com> writes:
biff> Ummm, I can't make the 'toggle' work .. the port in question is
biff> all outputs and picforth seems to compile an xorwf instruction
biff> .. something about a read-modify-write not working in this case?
Sorry for this late answer, your mail got blocked in the queue as you
were not a list subscriber.
Yes, toggle has the same problems as bit-set, bit-clr and bit-toggle
on PIC16F architecture -- it *has* to use a read-modify-write
operation. On some pins needing an external pullup (such as the
(in)famous RA4 IIRC), this often leads to reading the wrong value if
the line hasn't stabilized yet.
Fortunately, Microchip has fixed this in the 18F architecture by
introducing the LATCHx registers in addition to PORTx and TRISx.
Sam
--
Samuel Tardieu -- sam at rfc1149.net -- http://www.rfc1149.net/sam
More information about the PicForth
mailing list