Ra4/tock


Closed Thread
Results 1 to 12 of 12

Thread: Ra4/tock

  1. #1
    Join Date
    Jun 2006
    Posts
    40

    Default Ra4/tock

    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 )

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mychangl View Post
    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

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default You need the TRIS bits too

    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

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sougata View Post
    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.
    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.

  5. #5
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Sougata, I think that was totally uncalled for. Skimask provided the user with 2 direct references.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    Sougata, I think that was totally uncalled for.
    I don't know if it was totally uncalled for...
    after all, now I've got a new hobby...

  7. #7
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default No offense

    Hi,

    The query of the post seems to be like asking for a confirmation by mychangl. He mentioned the datasheet. That does mean he is having the datasheet and gone through it.
    To make it as input; OPTION_REG=OPTION_REG OR %0010000
    ( set bit 5 as advise in datasheet )
    Do you still think T.Jackson that two datasheet direct references are all what he wants.

    So if that was totally uncalled for then I appologise to skimask and all the forum members and promise to provide similar direct references. I receive microchip technical library cd-rom which is almost like a rip of their site. So got a lot of references to app-notes and datasheet.

    Its not about letting skimask down or offending him. Skimask is not a novice. So expectations are higher. This forum has helped me a lot in learning PIC by active support, code snippets, suggestions, warnings, and so on from the forum members. Datasheets can always be found on the microchip website and now it even offers an offline selection tool. Microchip has a 24/7 email support system. A much bigger forum with members from the Microchip FAE and product development managers too.

    I hope this forum is different with members like MisterE, DT, Melanie to name a few who seldom asks for something themselve but put in time and effort to solve other's problem.

    I hope I have made my intentions clear.
    Regards

    Sougata

  8. #8
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Well, giving someone a reference to a data sheet is sometimes a lot more help than a lot of other people are willing to give. I don't see any negative intentions in his current posts.

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mychangl View Post
    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 )
    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.

  10. #10
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    ....
    Done, dusted....
    Goodwifes!

    (I have some dust here too... :-) )

  11. #11
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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...

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Goodwifes! - plural - you mean you have more than one?
    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

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts