Hi all.
Is it possible to "read" the tris register values of a port to determine
what pins have bees set to Inputs and what are outputs , from within your code.I can create a variable to keep track of what the port has been set to , but was wondering if there is not an easier way.
Cheers
Rob
Ttelmah Guest
Posted: Fri Oct 07, 2005 2:07 am
Just declare a byte to point to the TRIS register. So for the 18F chips:
#byte TRISA = 0xF92
Then access this when required.
Remember though, that if you are using 'standard_io', the value will be overridden by the compiler whenever the I/O register is accessed.
Best Wishes
guest Guest
Posted: Fri Oct 07, 2005 4:52 am
Thanks.
Obvious , now you tell me how it's done.
Cheers
Rob
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum