Anthony Van Herrewege wrote: > it's pretty stupid if you ask me. If MC says don't use the TRIS > instruction, then why do they force you to use them on their > newest PICs? > > Also, why do they give the TRIS register the name TRISGPIO? You > can't write to it or read it. Anthony: It isn't "pretty stupid" if you have some historical context... Microchip doesn't actually say "don't use the TRIS instruction"; what they say is "don't use the TRIS instruction on parts with directly- accessible TRISx registers". If you've only recently started using PICs, you wouldn't know this... But when there were only 12-bit PICs (16C5x), the only way of setting the I/O data direction was with the TRIS instruction, which wrote to an internal register that wasn't accessible through any other firmware instructions. I haven't looked at the PIC10 datasheet, but I assume that it uses the old 12-bit core. By the way... The TRIS instruction is perfectly safe to use on any PIC whose instruction set contains it (and it's really preferable whenever speed is an issue or when you want to avoid bank-switching for some reason). The only caveat is that it only works on ports at addresses 4, 5, and 6 (PORTA, PORTB, and PORTC on most PICs). -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist