Changing bits in a byte for multiple output


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default

    You're making this WAYYYY too hard.
    If you've got all of the keys on portB, then just send the whole portB value, all 8 bits, all the keys, all at once, and keep sending them. Even if you don't have all of the buttons on PortB, get all of the buttons states and put them into the bits of a single byte variable and send that.
    Get that working so it's infallible, or at least as infallible as you can tolerate it.
    Then do all of the hard work at the receiver end figuring out which lights to light or whatever.
    I'm thinking you won't get anywhere until that happens...

  2. #2

    Default

    Thanks Skimask, your right I have made this difficult but the reason I was not sending out the whole PORTB is that I am trying to use a simple manchester encoding. My 0 is a 01 an a 1 being 10.
    Thanks

  3. #3
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by tazntex View Post
    Thanks Skimask, your right I have made this difficult but the reason I was not sending out the whole PORTB is that I am trying to use a simple manchester encoding. My 0 is a 01 an a 1 being 10.
    Thanks
    I don't think I would worry about encoding anything at the moment. You're sending short packets. As long as you've got preamble and a sync'ing character, you should be good to send the raw port data, in short bursts anyways.
    i.e. SEROUT datapin , mode , whatever , $55,$AA,$FE,raw_portb_data (assuming portb.7 isn't actually used)
    Just keep resending it as long as a key is pressed and code the receiver to look for the same thing that you're sending.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. byte compression
    By Norbert in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th June 2007, 18:04
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

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