Correct me if i am wrong.
PIC16F84 - RA4/TOCK has dual function as I/O port and as clock input to TMR0.
To make it as input; OPTION_REG=OPTION_REG OR %0010000
( set bit 5 as advise in datasheet )
Correct me if i am wrong.
PIC16F84 - RA4/TOCK has dual function as I/O port and as clock input to TMR0.
To make it as input; OPTION_REG=OPTION_REG OR %0010000
( set bit 5 as advise in datasheet )
If you're using a PIC16F84, then
http://ww1.microchip.com/downloads/e...Doc/30430c.pdf
If you're actually using a PIC16F84A, then
http://ww1.microchip.com/downloads/e...Doc/35007b.pdf
Hi,
You are right. Setting bit5 high in the option registers configures your timer to accept external clock to count. You also need to set the TRISA bit 4 to 1 accordingly to set as input.
It has a schmitt trigger input which takes much of the pain interfacing it to real world.
While using it as output please note that it is open drain. So you get low levels and floating. Use a pull-up for logic outputs.
I have never used a 16F84 and really did not care about the differences of the A version. But Microchip does maintain a backward compatibility. Bits unused or reserved in one family may have functions in the upper one.
It would be helpful to know what is your application to share knowledge.
BTW skimask he did mention about the datasheet. Not everybody is smart enough to comprehend the manual (take me for example). Also there are members of this forum whose native language is not English. Wouldn't it be nice for pro-s like you to actually teach and share knowledge than to give lame pointers. It increases your post count however, if that is a hobby.
Regards
Sougata
Post count - shmost count...who cares...
Looks to me like post #1 has a very good grasp of the english language, as well as PIC 'jargon' and registers and the functions contained therein.
The sheet says exactly what's needed to know, right there, black and white, page 9.
These so called 'lame pointers' will save a LOAD of time in the future...learn to fish...
EDIT: but now that you mention the post count...WOW...that's a lot of typing...
Last edited by skimask; - 16th May 2007 at 17:32.
Sougata, I think that was totally uncalled for. Skimask provided the user with 2 direct references.
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.
Goodwifes! - plural - you mean you have more than one?
I have some dust here too... :-) - for a small fee I'll loan you my housekeeper...
As of 21st of October 2006, yes!
http://www.picbasic.co.uk/forum/showthread.php?t=4889
She 's not dusting yet but hope in a couple of years...
Ioannis
Bookmarks