RF and PIC basic


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    The datasheet for the PT2262 doesn't provide any description of the communication protocol so, for starters, you will need to capture a few (different) codes and analyze them. This page shows how. http://davehouston.net/learn.htm

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I found another datasheet that does describe the protocol used by this chip. While the specifics for a "1", "0", and "F" differ from Holtek, the overall approach is very similar to the HT640. A bit period depends on the encoder oscillator frequency (set by an external resistor) you still need to capture some codes to determine the bit period. And there are some encoder pins that can be used either in the address or in the data so you'll need to determine that, also. Then you should be able to adapt Bruce's HT640 code to work with the PT2260.

  3. #3
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: RF and PIC basic

    Any ideas (Bruce's code for HT640) if this will work if HT640 is used with other RF modules, like the normal el chipo style?
    I will give it a go to decode PT2262 soon.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default Re: RF and PIC basic

    I tried to decode a UM3750/MM53200/HT12 type encoder with this either as subroutine or as Interrupt Driven Routine:

    Code:
    GET_CODE:
        PULSIN DIN,0,NUMS
        IF NUMS > 8200 and NUMS<12000 then        'Detect Header
            goto get_pulses
        else
            RETURN
        endif
    get_pulses:
          FOR X = 0 TO 11           ' read 12 pulses
            PULSIN DIN,1,NUMS        ' 
            if NUMS>220 then
                if NUMS<300 then
                    code.0[x]=1
                endif
            endif
     
            if NUMS>450 then
                if NUMS<560 then
                    code.0[x]=0
                endif
            endif
            if NUMS=0 then
                loops=0:code=0:flag=0
                RETURN    '   temp=0:
            endif
       next x
       if loops<3 then
        if prev_code=code then
            loops=loops+1
        else
            prev_code=code
            loops=0
        endif
       endif
    return
    But I got a delay in decoding. It just gets one every 4 transmissions. So for a 4 times check of equall transmitted codes, it takes more than 250ms to give a valid. With the Logic Digital Analyser it is confirmed that it takes 1st transmission, then 4th etc.

    The numbers in NUM are PIC and OSC clock dependant.

    If anyone can spot why, please reply.

    Ioannis

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: RF and PIC basic

    What var size is NUM?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default Re: RF and PIC basic

    Word sized.

    It does work but gets one every 4th. Very strange...

    I have not here the Logic. In the afternoon I will post a shot of the pulses to make it more clear.

    The posted routine was tested also as part of Darrels DT-INTs on a fast 16F1827 chip at 32MHz clock.

    Ioannis

  7. #7
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: RF and PIC basic

    Ioannis, not sure what you mean by gets one every 4th. The way I understand your statement is that you get a valid pulse once in 4 transmissions. If that is correct, the code which does that is the loops part. if loops < 3 then ..... When it finds a code 'repeated' 4 times, it transfers to the Prev_code. Is that what you're looking for??

Similar Threads

  1. mrf24j40 RF transciever with pic
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th September 2008, 15:11
  2. RF transmiter reciever using PIC
    By drama in forum mel PIC BASIC
    Replies: 5
    Last Post: - 4th October 2007, 16:26
  3. PIC 12F675 RF use
    By cooksydesign in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd September 2006, 15:06
  4. Generating RF from a PIC
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 26th January 2006, 20:26
  5. LINX RF module and PIC (#2)
    By Michael in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd January 2006, 17:56

Members who have read this thread : 2

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