I need to play with Nibbles, am i on the right track?


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jun 2016
    Location
    Melbourne, Australia
    Posts
    29


    Did you find this post helpful? Yes | No

    Default Re: I need to play with Nibbles, am i on the right track?

    Hmmm, i'll need to read all that a few times to sink in lol

    Basically, i have 4 variables i'm using, but i'm only using data in the LSB of each variable, so the values only range from $00 to $0F, technically i'm only using the LSB value of 0 to F within the code.

    I'm currently using(wasting) 4 ports, but only using 1/2 of the port to wire to external LEDs. my code and concept works, but now i'm trying to clean it all up by placing all 4 nibbles across only 2 8bit ports, freeing up the other 2 ports for more I/O pins etc.

    At all times, i need to only send info to each 1/2 of a given port WITHOUT corupting or moving bits on the other 1/2 of the port.

    Just looking to find a clean way to achieve this.
    Marty.

  2. #2
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: I need to play with Nibbles, am i on the right track?

    If that is case, then try this
    Create subroutine to set 2 ports like this:
    UpdateLed:
    PORTB= ((HI_nibbleB<<4) & %11110000) | (LO_nibbleB & %00001111)
    PORTC= ((HI_nibbleC<<4) & %11110000) | (LO_nibbleC & %00001111)
    RETURN

    Do what ever in main loop update variables and then CALL UpdateLed, and that is all.

Similar Threads

  1. Play & Record PWM audio?
    By Art in forum General
    Replies: 8
    Last Post: - 12th April 2015, 12:45
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  3. Play Music (MP3, WAV,...) for greeting card
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 10th January 2007, 16:14
  4. MagCard reader (track 2 & 3)
    By odd7 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th November 2006, 14:28
  5. Word to nibbles
    By Gauge Guy in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th September 2005, 05:08

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