12F508 OPTION Register


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185

    Default 12F508 OPTION Register

    Has anyone successfully written to OPTION register in 12F508?

    This register is not recognized and has no address !
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: 12F508 OPTION Register

    Hi,
    Looks like you need to resort to a bit of assembly to get to it.
    The OPTION register is a 8-bit wide, write-only register, which contains various control bits to configure the Timer0/WDT prescaler and Timer0.
    By executing the OPTION instruction, the contents of the W register will be transferred to the OPTION register.
    A Reset sets the OPTION<7:0> bits.
    Now, I truly suck at assembly but if I were to try anything it would probably be something like:
    Code:
    ASM
    MOVLW 128   ; Put 128 in W (enable weel pullup).
    OPTION         ; Move content of W to OPTION
    ENDASM
    /Henrik.

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: 12F508 OPTION Register

    Thanks Henrik,

    I made a simple flip flop code; and even it did not work. So, I can not test whether your suggestion actually works or not.

    There must be something specific with the programming of this chip.

    Even though I get no error when programming, I can't get it work.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Nov 2005
    Location
    Cambridge UK
    Posts
    45


    Did you find this post helpful? Yes | No

    Default Re: 12F508 OPTION Register

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    Looks like you need to resort to a bit of assembly to get to it.
    Now, I truly suck at assembly but if I were to try anything it would probably be something like:
    Code:
    ASM
    MOVLW 128   ; Put 128 in W (enable weel pullup).
    OPTION         ; Move content of W to OPTION
    ENDASM
    /Henrik.
    Thanks Henrick, that assembly code helped me out with the 12f508. You have to TAB in once then write the code to remove errors.
    GPIO.2 and 3 work fine now. Cheers Nick

  5. #5
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: 12F508 OPTION Register

    Is this the same kind of process that might be used to get the TOCKI on Portc.5 to be used as a gpio? Any ideas?
    The datasheet says:
    On power-up, TOCKI functionality is enabled in the OPTION register and must be disabled to allow RC5 to be used as general purpose I/O.
    However, noplace does it state how to do that.

  6. #6
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: 12F508 OPTION Register

    p.s.
    That's on the 16f505 chip, not the 508

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: 16F505 OPTION Register

    The OPTION register is accessed the same as any other 16F. PBP translates it to an assembly OPTION command on 12-bit cores.

    To use RC5 as an output pin, use ...
    Code:
    OPTION_REG.5 = 0
    DT

  8. #8
    Join Date
    Oct 2006
    Location
    Edmonton AB Canada
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: 16F505 OPTION Register

    Thanks Darrell, worked like a charm. Options are not so clear in the documentation.

Similar Threads

  1. Auto Save option in editor
    By longpole001 in forum PBP Wish List
    Replies: 6
    Last Post: - 5th July 2012, 23:15
  2. Adding a Favorites Option to the Forum
    By rsocor01 in forum Forum Requests
    Replies: 9
    Last Post: - 18th July 2010, 17:09
  3. So many option but little understanding
    By PickyBiker in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 23rd April 2010, 09:45
  4. Forum use option
    By F1CHF in forum Forum Requests
    Replies: 6
    Last Post: - 12th August 2006, 12:35
  5. 12F508 question...
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd August 2005, 09:32

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