Home     Contact     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   



The Option_Reg Register

The Option_Reg register is a Readable and Writable register that is used to control some modules of the PIC. This register is only available from bank 1 and bank 3. The bits of the Option_Reg register as as follows:


Bit # 7 6 5 4 3 2 1 0
Access R/W R/W R/W R/W R/W R/W R/W R/W
Initial 1 1 1 1 1 1 1 1
Name -RBPU INTEDG TOCS TOSE PSA PS2 PS1 PS0



The Option_Reg Register bits

Bit <2:0> - PS<2:0>: Prescaller rate selection

    Those bits are Readable and Writable and after a reset they will get the value '1'. They are used to set the Prescaller rate. The values it can get are:



    Bit 3 - PSA: Prescaller Assignment

      This bit is Readable and Writable and after a reset it will get the value 1. This bit is used to assign the prescaller to to the Watchdog timer or the Timer 0 module. The values it can get are:

    • 0: The prescaller is assigned to the Timer 0 module (TMR0)
    • 1: The prescaller is assigned to the Watchdog timer (WDT)


    Bit 4 - TOSE: Timer 0 Source Edge Select

      This bit is Readable and Writable and after a reset it will get the value 1. It is used to select the RA4/TOCKI pin clock edge (High to Low or Low to High) on which the Timer 0 will count. The values it can get are:

    • 0: Increment on Low to High
    • 1: Increment on High to Low


    Bit 5 - T0CS: Timer 0 Clock Source Select

      This bit is Readable and Writable and after a reset it will get the value 1. This bit will define the Timer 0 module clock source. It can be either the RA4/TOCKI pin or the Internal Instruction Cycle Clock (CLKO). The values it can get are:

    • 0: Timer 0 clock source is the Internal instruction cycle clock (CLKO)
    • 1: Timer 0 clock source is the RA4/TOCKI pin


    Bit 6 - INTEDG: RB0/INT pin Interrupt Edge Select

      This bit is Readable and Writable and after a reset it will get the value 1. By altering this bit, you can select the RB0/INT pin pulse edge that the RB0/INT interrupt will occur. The values it can get are:

    • 0: The RB0/INT interrupt will occur on the falling edge of the RB0/INT pin
    • 1: The RB0/INT interrupt will occur on the rising edge of the RB0/INT pin


    Bit 7 - -RBPU: PORTB Pull-up Enable

      This bit is Readable and Writable and after a reset it will get the value 1. The RB ports have an internal programmable pull-up resistor to minimize the use of external pull-up resistors when needed. This bit will enable or disable those resistors. The values it can get are:

    • 0: The RB pull-up resistors are enabled
    • 1: The RB pull-up resistors are disabled











    Previous page ---- Next page



    Go back to the book contents

    Go to the discussion forum of this book





    Bit value TMR0 Rate WDT Rate
    000 1:2 1:1
    001 1:4 1:2
    010 1:8 1:4
    011 1:16 1:8
    100 1:32 1:16
    101 1:64 1:32
    110 1:128 1:64
    111 1:256 1:128
     

    Comments

      Name

      Email (shall not be published)

      Website

    Notify me of new posts via email


    Write your comments below:
    BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this page. But if you have questions please use the forum instead to post it. Thank you.


          

  • At 27 July 2013, 11:51:01 user Kifaru Malale wrote:   [reply @ Kifaru Malale]
    • Thanks a lot guys for the very good posts, it realy added something in my head...........


  • At 12 June 2012, 7:56:32 user Giorgos Lazaridis wrote:   [reply @ Giorgos Lazaridis]
    • @kamran alam basically, i need to re-write this whole tutorial from the beginning, and make also more sophisticated videos. I'm not sure if i have the time to make for another PIC also, but the basic assembly programming can be applied for the 877 as well.
      As for the "student", i do not see how can this happen. I have never tried teaching through internet. You live in India right? I live in Greece. But you can use the forum to ask your questions, and if i can answer be sure that i will:

      http://www.pcbheaven.com/forum/


  • At 12 June 2012, 6:37:31 user kamran alam wrote:   [reply @ kamran alam]
    • hii buddy. i m really impressed from ur work. great job dude!
      i have a request that plz publish pic tutorial of PIC16F877A. I'll hope u'll do so. i m eagerly waiting.......

      i have a question for you.....
      can i be ur student

      thanking you
      with regards
      Kamran Alam
     






    No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise without the prior written permission of the author.

    Read the Disclaimer


    All trademarks used are properties of their respective owners.
    Copyright © 2007-2009 Lazaridis Giorgos.
    All rights reserved.






 HOT in heaven!


  • Disclaimer
  • Book Contents
  • Discussion forum

  • Basics
  • What will you need
  • Choosing the right PIC
  • The MPLAB
  • Getting familiar with the MPLAB environment
  • Creating a new project
  • Open and close projects
  • Creating new files and including them in the project
  • Your very first assembly program
  • Compile a program and transfer to the PIC
  • Section 1: Beginner's theory
  • Memory Organization
  • The Data Memory Organization
  • The Program Memory Organization
  • The instructions
  • General knowledge about instructions
  • Value Loading Instructions
  • Program Flow Instructions
  • Mathematic Instructions
  • Logic Function Instructions
  • Bit Orientated Instructions
  • Byte Orientated Instructions
  • Miscellaneous Instructions
  • The Basic Special Function Registers
  • The Status Register
  • The Option_Reg Register
  • The TRIS and PORT registers
  • Beginner's PIC Tutorials
  • How to use our PIC Tutorials
  • A Pushbutton turning an LED on and off
  • A Simple LED Flasher
  • Interfacing Multiple Switches - The internal Pull-Up resistors
  • An LED Sequencer
  • Interface a Single 7seg Digit
  • Interface Multiple 7seg Digits
  • A 3-digits Decimal Counter
  • A Clever Button
  • Section 2: Intermediate theory
  • Instruction Cycle Duration and Calculated Delays
  • The Timer Modules - Timer0
  • The Timer Modules - Timer1
  • The Timer Modules-Timer2



  • NEW in heaven!



    New Theory: AC electric motor working principle






     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy