Microcontroller with 2 way paging application problem


Closed Thread
Results 1 to 31 of 31

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Would it be smarter if I just transmit two bits back because I only need the address bits on the other side anyway. That would not involve any bit changing just sending two bits. Also, would there be any reason why the microcontroller would not pick up anything on the other side or do it intermittently even though I am sending the same thing repeatedly? Also, if I were to do that how could, could I just reencode the code that was received and then send only the 4/8 bits that are part of the address, something like: serout PORTB.2, n2400, [ $55, $55, $55, $55, $55, $55, $55, $55, $55, $aa , encode.4, encode.5, encode.6, encode.7 ]?
    Last edited by oneohthree; - 18th April 2007 at 18:20.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oneohthree View Post
    Would it be smarter if I just transmit two bits back because I only need the address bits on the other side anyway. That would not involve any bit changing just sending two bits. Also, would there be any reason why the microcontroller would not pick up anything on the other side or do it intermittently even though I am sending the same thing repeatedly? Also, if I were to do that how could, could I just reencode the code that was received and then send only the 4/8 bits that are part of the address?
    Well, what I'm getting at is that you're only receiving X number of possible numbers which means that you're only going to send out X number of possible number. You could replace all that bit changing business with something like:
    If X = 10 then X = 15...
    Yes, it would probably be a bit more complicated than that, but you could 'name' all of your numbers (i.e. const warning=10 const alert=12 tracking=14 and so on) so you could more easily keep track of everything.

  3. #3
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    I changed it so that it will only send the first two bits of the code that I sent in (the address). Did I write the code properly so that it will only take the address bits correctly. For example if my code is 1100, the address bits are 11 which are the third and fourth bit.

    For counter = 3 to 4 'take out address bits, (first two bits)
    f.0[counter]=action.0[counter]
    Next counter

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oneohthree View Post
    I changed it so that it will only send the first two bits of the code that I sent in (the address). Did I write the code properly so that it will only take the address bits correctly. For example if my code is 1100, the address bits are 11 which are the third and fourth bit.

    For counter = 3 to 4 'take out address bits, (first two bits)
    f.0[counter]=action.0[counter]
    Next counter
    No, they are the 2nd and 3rd bit.
    Remember, we start counting from 0, not 1.

  5. #5
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    I figured out that if I connect the two PICs I am having trouble with by a wire it works properly. But, when I use the RF modules it does not work properly and sometimes it reads in the wrong data.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oneohthree View Post
    I figured out that if I connect the two PICs I am having trouble with by a wire it works properly. But, when I use the RF modules it does not work properly and sometimes it reads in the wrong data.
    Which is why I suggested using some sort of checksum or data identifier way back in post #4.

  7. #7
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Can you give me an example of how to use checksum or a data identifier in my program? Also, is it a problem if I have to send it multiple times for the PIC to pick it up by wire?
    Last edited by oneohthree; - 18th April 2007 at 23:19.

Similar Threads

  1. PIC KIT 2 writing problem ?
    By KaanInal in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd January 2010, 12:59
  2. Unusual Interrupts Application Problem
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th May 2009, 11:55
  3. Replies: 7
    Last Post: - 15th December 2008, 05:18
  4. PWM Problem
    By cihhan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th June 2008, 18:43
  5. Replies: 18
    Last Post: - 24th January 2008, 22: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