Changing several o/p pins at the same time


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    OK, I get that (though it took a minute or two to work out that | is a bitwise OR). So in PBP how do I set a nibble ? There isn't a variable type for nibbles - just bits, byte and words unless i've missed something. But I suppose it doesn't really matter if I use a whole byte, if the high nibble is all zeros the OR will just keep whatever it found in the Read PORTB and AND operation.

    So is it "better" programming to do it this way rather than just four consecutive single bit operations ?

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


    Did you find this post helpful? Yes | No

    Default

    PBP doesn't have a nibble variable type. But like you say, just use a byte with only the low nibble doing things.

    Doing 4 bit writes to a single port one after the other, is actually doing 4 full port R-M-W's

    If there's no capacitance, it'll be fine.
    But if there is. You may have problems.

    The method above is only 1 R-M-W at a time.
    <br>
    DT

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    No 'nybble' variable types in PBP. You have to break a byte up into smaller pieces then reassemble it.

    As far as 'better' programming...I think the operative phrase here might be that it's 'more reliable' programming.

    (DT - wow! I'm leaving now!)

  4. #4
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Is there really just one of you out there and you are two faces of a single evil genius

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by AndrewC View Post
    Is there really just one of you out there and you are two faces of a single evil genius
    No, I'm the evil, he's the genius....
    Or is he.........

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


    Did you find this post helpful? Yes | No

    Default

    I had "Who's Online" in one window, and my reply in another.

    Boy was I scrambling to beat you.
    <br>
    DT

Similar Threads

  1. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  2. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  3. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  4. Control unlimited servos at the same time
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th September 2006, 14:14
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

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