Stop faffing about (another new word Adam?) and give a straight answer if you're going to give one...
This post has a little ambiguity, if you want to make RA4 a DIGITAL INPUT then all you need to do is set the TRISA Register accordingly...
TRISA.4=1
If you need to use this as a CLOCK INPUT to TMR0 then you need to do a little more...
TRISA.4=1
OPTION_REG.5=1
By setting the INDIVIDUAL BIT in the Register, you leave all the other bits alone. This saves a little worry as to whether you're setting other things correctly or not. Otherwise you run the risk of setting or resetting something you've not paid attention to, which could impact on your program unnescessarilly.
You may also need to set to set Bit 4 of OPTION_REG depending if you want High-to-Low pulse transition to trigger the clock rather than Low-to-High. See Figure 4-1 of the Datasheet (DS30430C Page 16 in case your Datasheet isn't the same as mine) for detail on the OPTION_REG settings.
Done, dusted and saves on wasted bandwidth.
Bookmarks