Portb 16F628A


Closed Thread
Results 1 to 9 of 9

Thread: Portb 16F628A

  1. #1

    Default Portb 16F628A

    This may sound like a really dumb question or I have a bad lot of processors, I doubt that but the question is can I do this:

    myvar var byte
    portb = myvar

    And whatever myvar is, really it is a binary number, the ports pins on portb would change to that state.


    Thanks

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tazntex View Post
    myvar var byte
    portb = myvar
    As long as all pins on PORTB are set to OUTPUTs, which they're not upon RESET...on most, if not all, PICs, as noted in most, if not all, datasheets, in the 'I/O Ports' section, and as long as said pins are not designated for another use (i.e. PortA, analog vs. digital usage).

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    As long as all pins on PORTB are set to OUTPUTs, which they're not upon RESET...on most, if not all, PICs, as noted in most, if not all, datasheets, in the 'I/O Ports' section, and as long as said pins are not designated for another use (i.e. PortA, analog vs. digital usage).
    He means yes . . .
    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.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    skimask,
    you are starting to sound like a lawyer
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question

    The problem with Lawyers is that you never really know what they said.

    See, I thought ski said YES, with "as long as certain conditions were met" added.

    But since it can't work with ONLY the code being shown. Maybe his answer was really NO.
    <br>
    DT

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    It is that little bit of doubt that makes one wonder

    I need to go find something to do...
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    "The problem with Lawyers is that you never really know what they said."
    That statement is so true, with that being said Portb is set as outputs:
    trisa = %00000010
    trisb = %00000000
    PORTA = 0
    PORTB = 0

    The reason why I asked was because in an earlier post using SERIN I can select individual bit
    as in :
    Portb.0 = myvar.0 ' which is working

    but wasn't quite sure about receiving all to my variable and then assigning that data to portb.

    Thanks Everyone

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    A lawyer...Ha! Now that's funny! Lawyers are nothing but overpaid B.S. artists...and should be...ok, nevermind...

    The reason I answered the way I did is because, even though it doesn't seem like, there's a lot of useful FUTURE information in there.
    So, yes, if a port pin was set to output upon RESET, which it's not, so therefore, the answer is NO, because a condition set forth by the datasheet has not been met.
    I rest my case...

  9. #9
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Last edited by mackrackit; - 13th August 2008 at 03:56. Reason: Forgot link :o
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. shifting problem
    By helmut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 31st August 2007, 06:11
  3. Output PIC module
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th September 2005, 20:10
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29
  5. Help wanted..
    By thrix in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 17th February 2004, 23:44

Members who have read this thread : 0

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