Bob Ammerman wrote: > Here is a neat trick to get a 'push-pull' output from two PORT A > pins: > > 1: define them as analog (ADCON1) > 2: TRIS them as outputs. > > Now, when you BSF either of them the other will automatically be > cleared. > > This would have been useful in a system I built that drove a piezo > transducer directly off two PIC pins. Clever; I don't think I've ever seen that. Of course, if you can't configure the pins as analog inputs (because, for instance, the PIC you're using doesn't HAVE an A/D converter), you can do this: MOVLW 00000001B ;RA0 = 1, RA1 = 0. MOVWF PORTA ; MOVLW 00000011B XORWF PORTA ;Toggle RA0 and RA1. XORWF PORTA ;Toggle the two pins again. XORWF PORTA ;And again... Or, if those two pins are the only ones defined as outputs on that port: MOVLW 00000001B ;RA0 = 1, RA1 = 0. MOVWF PORTA ; COMF PORTA ;Toggle RA0 and RA1. COMF PORTA ;Again. COMF PORTA ;And again... -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - San Diego, California === http://www.geocities.com/SiliconValley/2499 -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.