My foreground tasks are already using both sets of FSR / INDF=20 registers. I would have to save, then restore one of the FSR=20 registers at the entry and exit of this routine. I had done just=20 that before discovering that the TRIS instruction was supported again. This application has 16 digital filters that are updated about every=20 millisecond (1.024ms). I'm shaving clock cycles where I can. The=20 TRIS instruction helps significantly. Jim: have a look at instruction set for the older PIC families such=20 as the 16C54 and 16C71. The TRIS instruction was the standard method=20 of setting the DDR bits in those devices. It allows you to set the=20 DDR bits for any of ports RA, RB, RC no matter what RAM bank you are=20 currently in. Note that it does NOT work for ports RD or RE. As newer PICs came along, the TRIS instruction was=20 deprecated. Although it still worked on most 14-bit PICs, its use=20 was discouraged because, as Microchip said: It might vanish in later=20 versions of similar devices. The TRIS instruction was often removed=20 from the instruction set summary in those devices datasheets, even=20 though it might still work. But it looks as if Microchip is now allowing the TRIS instruction to=20 be used again - all of the newer enhanced 14-bit PICs now show it in=20 the instruction set summary. That's good news for some of us old-timers. Do note that the TRIS instruction is not appropriate in cases where=20 you can't change all of the DDR bits in one fell swoop for some=20 particular reason. It's also not necessarily appropriate in places=20 where you can't use a literal (constant). That is: in code where the=20 DDR bits change dynamically on an individual basis. You are far=20 better off manipulating individual bits within the TRIS registers in=20 RAM bank 1 in those cases. In my case, it's okay for all of the DDR bits for the port to change=20 at the same time. dwayne At 09:19 AM 3/7/2017, Bob Ammerman wrote: >I had a need to very quickly toggle TRIS register bits and also by togglin= g >output bits. > >I just pointed FSR at the TRIS register and referenced INDF to tweak its >bits. > >This let me hit both the register and the TRIS in sequential instructions. > >~ Bob Ammerman >RAm Systems > > > -----Original Message----- > > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behal= f >Of > > alan.b.pearce@stfc.ac.uk > > Sent: Tuesday, March 07, 2017 10:00 AM > > To: piclist@mit.edu > > Subject: RE: [PIC] TRIS Instruction 16F178x family > > > > > Dwayne, > > > > > > The TRIS registers are separate registers in a different bank. > > > The PORT registers are in BANK 0, and the TRIS registers are in BAN= K >1. > > > How can you not have to change banks? If you use BANKSEL or PAGESEL= , > > > you're still changing banks. > > > Am I missing something? I'm just curious because I like assembler, > > > and have been working with PIC microcontrollers since the early 90's= .. > > > > > > Regards, > > > > > > Jim > > > > The magic thing about the TRIS instruction is that it accesses the >appropriate > > Tris register irrespective of which bank you are currently in. That is = the >reason > > Dwayne wants to use the instruction. > > > > > > > > -- > > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >View/change > > your membership options at http://mailman.mit.edu/mailman/listinfo/picl= ist > >-- >http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist --=20 Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA 780-489-3199 voice 780-487-6397 fax 888-489-3199 Toll Free www.trinity-electronics.com Custom Electronics Design and Manufacturing --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .