HELP on reading the data sheet/weak pull-ups


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    8

    Default HELP on reading the data sheet/weak pull-ups

    ok i have the data sheet

    http://ww1.microchip.com/downloads/e...Doc/40044F.pdf

    Page 25, REGISTER 4-2: OPTION_REG – OPTION REGISTER (ADDRESS: 81h, 181h)

    ok i understand that bit 7 needs to = 0 to turn these on.

    I have read and read and read

    would someone please teach me how to read this so i know what to type in PBP
    alot of people say "TRISB = %00000000"
    where do you get that out of the data sheet???
    and if so how do you read it, whats with the %, seems to me I'm setting individual values with that line (which is fine by me the more i learn now the better)

    I'm so confused

    Thanks in advance

  2. #2
    Join Date
    Feb 2008
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    ok i found
    OPTION_REG.7=0 ' Enable weak Pull-Ups

    and micro code studio accepted that.

    so why does option_reg not have a # behind them
    and ADCON0 Does ???

    Thanks again in advance
    sorry if I'm a rock

  3. #3
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sbobowski View Post
    ok i found
    OPTION_REG.7=0 ' Enable weak Pull-Ups

    and micro code studio accepted that.

    so why does option_reg not have a # behind them
    and ADCON0 Does ???

    Thanks again in advance
    sorry if I'm a rock
    Not sure what you mean here..... the option register is 8 bits. With the statement OPTION_REG.7=0, bit 7 of the option register (bit 7 RBPU: PORTB Pull-up Enable bit
    1 = PORTB pull-ups are disabled
    0 = PORTB pull-ups are enabled by individual port latch values) enables weak pullups. Also from pg. 38 section 5.2
    Each of the PORTB pins has a weak internal pull-up
    (≈200 μA typical). A single control bit can turn on all the
    pull-ups. This is done by clearing the RBPU
    (OPTION<7>) bit. The weak pull-up is automatically
    turned off when the port pin is configured as an output.
    The pull-ups are disabled on Power-on Reset.
    . Not sure if I'm answering you question or not.
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  4. #4


    Did you find this post helpful? Yes | No

    Default

    The data sheet in your post has no mention of ADCON0. Where did that come from?

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sbobowski View Post
    would someone please teach me how to read this so i know what to type in PBP
    alot of people say "TRISB = %00000000"
    TRIS = TRI STATE REGISTER so TrisA is tri state register of port A each port has 3 states,
    input, output, unimplemented. Youset tris register by the bit so TrisA = %00000001 means bit zero is an input and the other 7 are outputs. You can address them individually just as easily like this TrisA.0 = 1 making PortA.0 an input. Port latches are done the same way,
    example PortA = 0 all outputs low or PortA = %00000000 all portA outputs low, or PortA.1 = 1 ' portA 1 is high
    Quote Originally Posted by sbobowski View Post
    and if so how do you read it, whats with the %, seems to me I'm setting individual values with that line (which is fine by me the more i learn now the better)
    the % tells the compiler you are using binary. You could use decimal or hex just as well, I find binary easier because it gives a direct readout of the setting, ones are inputs zeros are outputs.
    Quote Originally Posted by sbobowski View Post
    I'm so confused

    Thanks in advance
    Welcome to MY world, and the forum
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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