Re: toggle .. silly question
Samuel Tardieu <[email protected]> 12 May 2005 12:43:51 +0200
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "biff" == biff <[email protected]> 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 -- [email protected] -- http://www.rfc1149.net/sam