datagood???


Closed Thread
Results 1 to 6 of 6

Thread: datagood???

Hybrid View

  1. #1

    Default

    Thanks skimask, I would have like to add up the keydata but using serial out wouldn't the packets be allowed only 8bits wide or can I send I Word 16bits wide. In that way if all of the keydata bits 0-7 were = to %11111111 then if I added them together the sum would be 10111111010 right? If I made checksum a word and stored it as %0000010111111010,
    transmitted it after the last keydata, then on the rx I could :
    checksum var word
    if ((Keydata1 + keydata2) + (keydata3 + keydata4) + (keydata5 + keydata6)) = checksum then
    datagood = 1
    else
    datagood = 0
    endif

    would this work? I thought I read somewhere I could only send a byte out not a word, if that is the case couldn't I split the word into two bytes.

    Thanks again

  2. #2
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by tazntex View Post
    checksum var word
    if ((Keydata1 + keydata2) + (keydata3 + keydata4) + (keydata5 + keydata6)) = checksum then
    datagood = 1
    else
    datagood = 0
    endif
    Ok, consider this...
    Assume keydata1...6 are all a value of 100, so therefore the checksum should be 600 right?

    What happens if the data gets scrambled and instead of everything being 100, keydata1=50, keydata2=150, keydata3=99, keydata4=101, keydata5=100, keydata6=100?
    Try it out...

  3. #3

    Default

    If the checksum value was received with its original value, and keydata1-6 are scrambled then the sum would not be equal to the value of checksum, the outcome would be datagood = 0 since keydata1-6 != checksum. That's what one would want to happen.
    I was just wondering if per say 4 keydata's out of 6 were equal then assuming their value is correct, could one say reject the last two scrambled keydata's and run. What I mean is if there were a way to say I sending six keydata's if four of any of the six match consider the data good and run. That would allow for pressing the button on the tx and allowing for multipath rf and reflection problems, and prevent from instead of the output chattering on/off but to remain on until the transmitter output is off.

    By the way am I correct that the maximum size I could make keydata or address to send out or receive throught serial would be byte size, 8bit ,on the 16f628a?

  4. #4
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by tazntex View Post
    If the checksum value was received with its original value, and keydata1-6 are scrambled then the sum would not be equal to the value of checksum, the outcome would be datagood = 0 since keydata1-6 != checksum. That's what one would want to happen.
    I was just wondering if per say 4 keydata's out of 6 were equal then assuming their value is correct, could one say reject the last two scrambled keydata's and run. What I mean is if there were a way to say I sending six keydata's if four of any of the six match consider the data good and run. That would allow for pressing the button on the tx and allowing for multipath rf and reflection problems, and prevent from instead of the output chattering on/off but to remain on until the transmitter output is off.
    Either you're too worried about it or you've had these problems in the past...
    You make it however you want to make it. The more checking you put in, the better it'll be. That's about the size of it.

    By the way am I correct that the maximum size I could make keydata or address to send out or receive throught serial would be byte size, 8bit ,on the 16f628a?
    What does the Figure in the PIC datasheet say?
    And since you're using SERIN and SEROUT, why does it matter?

Similar Threads

  1. Do I need a pause?
    By tazntex in forum Serial
    Replies: 21
    Last Post: - 29th August 2008, 04:32
  2. Oscillator stops when touching with a wire
    By Wilbert Ingels in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 25th April 2008, 08:51

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