Is it possible to interpret non-standard serial data with PicBasic (sample attached)


Closed Thread
Results 1 to 40 of 61

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,099

    Default Is it possible to interpret non-standard serial data with PicBasic (sample attached)

    I have some remotely managed studio strobe, it has keyboard, and when pressing numerical keys, the following sequences being transmitted on single wire, as shown on the picture. What protocol is this, and can I somehow interpret it, using picbasic pro?



    Width of wide pulse is 1.9msec, and width of narrow pulse is 642usec.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    It looks like some kind of binary coding judging by the number entered and the output stream. Why not ask the manufacture for the protocol?
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    hi dave,

    it reminds me of a sort of binary encoding...
    0= no missing pulse 0000
    1= 1 missing pulse in the "ones" position 0001
    2= 1 missing pulse in the "twos" position 0010
    3= ones missing and twos missing 0011
    4= 1 missing pulse in the fours position 0100
    5= ones and fours missing 1001

    it would help to see all the way up to 9
    do you also need to decode other letter/function key/enter/backspace etc. etc. characters??

    I don't recognize the protocol off hand but then I am no protocol expert.

    perhaps some sort of digital logic analyzer that has a good interpreter behind it would help.
    something like this... https://www.saleae.com
    I have never used the saleae but I know it comes highly regarded for it's price.

    good luck
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    Yes is goes up that way, I can record it up to 9, but you are correct, it looks like plain BCD code, but the rendering of "0" and "1" with pulses, looks weird for me. I have saelae logic analyzer, but it can't detect these pulses at all, I've used scope to record them.

    In fact, I want very simple thing - say, set variable ENABLE=0, when "zero" is transmitted, and ENABLE=1, when any other digit is being sent. I'm not looking for character decoding or whatsoever.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    I was suggested, that this is PPM (Pulse Position Modulation), used in some IR/RF remotes and telemetric control equipment. Datasheet of Holtek HT6222 shows quite similar, but not exact diagram of signal.

  6. #6
    Join Date
    Sep 2009
    Posts
    748


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    If you need only ENABLE use count to count pulses.
    Try something like this:

    Code:
    COUNT Pin, Period, Var
    If Var<xxx then
        enable=1
    else 
        enable=0
    endif

  7. #7
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    But pulses are of different width in series, will it work?

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    2,466


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    well the dsp module is interesting but for this project perhaps its easier to do it the old way


    Code:
    '****************************************************************
    '*  Name    : MODULATOR.BAS                                     *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 5/29/2016                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                        *
    '*          : 16F1825                                           *
    '****************************************************************
      #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_ON  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_ON & _LVP_OFF            
    #ENDCONFIG
     
    OSCCON=$70
    DEFINE OSC 32
    
    
    
    '                       PIC 16F1825
    
    
    
    TRISA     = %001111	   ' Make some pins Input 
    trisc     = %001111  ;Make some pins Input   
    ANSELA=0     
    ANSELC=0
    
    
    
    X VAR byte
    darta   VAR byte[4] 
    
    
        clear
        
        modout var latc.4
        darta.0[14]=1 
        darta.0[15]=1 
    
       
        modout =1
        lata.5=0    ;cro triger
    Main_Loop:
        lata.5=1
        modout=0
        pauseus 9900
        modout =1
        pauseus 1880
        for x = 0 to 30 
            modout =0
            if  darta.0[x]  then    
                pauseus 2000
            else
                pauseus 780 
            endif
            modout =1
            pauseus  635 
        next
        modout =1
        lata.5=0
        PAUSE 200 
    
    goto Main_Loop
    end
    Warning I'm not a teacher

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,466


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    this works better the first one did no work for sequential 1's

    Code:
    '****************************************************************
    '*  Name    : MODULATOR.BAS                                     *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 5/29/2016                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                        *
    '*          : 16F1825                                           *
    '****************************************************************
      #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_ON  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_ON & _LVP_OFF            
    #ENDCONFIG
     
    OSCCON=$70 
    DEFINE OSC 32
     
    '                       PIC 16F1825
     
    TRISA     = %111111    ' Make all pins Input 
    trisc     = %101111  ;Make all pins Input   
    ANSELA=0     
    ANSELC=0
    MDSRC=    %00000000
    MDCARH   =%11000100
    MDCARL   =%00000000
    X VAR byte
    darta   VAR byte[4] 
    TIMER1     VAR WORD EXT
    clear
    modout var latc.4
    darta.0[14]=1 
    darta.0[15]=1  
    hpwm 1,128,1600
    MDCON.0 = 0
    modout =0
    Main_Loop:
    modout=1
    pauseus 8000
    modout =0
    while tmr2 :wend
    MDCON=    %11010001
    for x = 0 to 31
    while tmr2 :wend
      
    if  darta.0[x]  then
    MDCON.0 = 0
    while tmr2 :wend
    pauseus 6
    while tmr2 :wend
    pauseus 6
    MDCON.0 = 1
    while tmr2 :wend
    pauseus 6
    else
    MDCON.0 = 1
    endif
    next  
    modout=1
    MDCON=    0
    pauseus 600
    modout = 0
    PAUSE 200 
    goto Main_Loop
    end
    Warning I'm not a teacher

  10. #10
    Join Date
    May 2013
    Location
    australia
    Posts
    2,466


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    the output
    Attached Images Attached Images  
    Warning I'm not a teacher

  11. #11
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    Wow! Such an input.

    Here are signal details. Actual signal is high and goes low, on my last picture, I've inverted it just for ease of viewing and analyzing.

    On the picture below, I've specified all timings as required.
    Name:  logi-cal.jpg
Views: 1485
Size:  33.6 KB

  12. #12
    Join Date
    May 2013
    Location
    australia
    Posts
    2,466


    Did you find this post helpful? Yes | No

    Post Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    Name:  Untitled.jpg
Views: 554
Size:  50.3 KB
    as close as I can get . it has a glitch after the last bit sent

    Code:
    '****************************************************************
    '*  Name    : MODULATOR.BAS                                     *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2016 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 5/29/2016                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                        *
    '*          : 16F1825                                           *
    '****************************************************************
      #CONFIG
                 __config        _CONFIG1,    _FOSC_INTOSC & _CP_OFF & _WDTE_ON  &  _PWRTE_ON  &  _MCLRE_ON  & _CLKOUTEN_OFF
                  __config      _CONFIG2, _PLLEN_OFF & _LVP_OFF            
    #ENDCONFIG
     
    OSCCON=$70 
    DEFINE OSC 8
     
    '                       PIC 16F1825
     
    TRISA     = %011111    ' 
    trisc     = %001111  ; 
    ANSELA=0     
    ANSELC=0
    MDSRC=    %00000000
    MDCARH   =%01000100
    MDCARL   =%00000000
    X VAR byte
    darta   VAR byte[4] 
    TIMER1     VAR WORD EXT
    clear
    modout var latc.4
    darta.0[14]=1 
    darta.0[15]=1  
    t2con=6
    pr2=158
    CCPR1L =318>>2
    ccp1con=12
    MDCON.0 = 0
    modout =1
    Main_Loop:
    lata.5=1 ; cro trigger
    while !pir1.1 :wend
    modout=0
    pauseus 9900
    modout =1
    pir1.1=0
    while !pir1.1 :wend
    pir1.1=0
    while !pir1.1 :wend
    MDCON=    %11000001
    pir1.1=0
    while !pir1.1 :wend
    for x = 0 to 31  
    if  darta.0[x]  then
    MDCON.0 = 0
    pir1.1=0
    while !pir1.1 :wend
    pir1.1=0
    while !pir1.1 :wend
    MDCON.0 = 1
    pir1.1=0
    while !pir1.1 :wend
    else
    MDCON.0 = 1
    pir1.1=0
    while !pir1.1  :wend
    endif
    next 
    modout = 1
    MDCON = 0
    
    lata.5=0
    PAUSE 200 
    goto Main_Loop
    end
    Warning I'm not a teacher

  13. #13
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    Thanks!

    I guess, your code can run on 16F1829 ?

  14. #14
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    Did you try code I posted a month ago, or looked at it to determine it won’t work?
    It’s used in an IR remote receiver for a game controller (so has to be reliable)
    to interpret exactly the same pulse coded signal, with the timings being the only difference.

  15. #15
    Join Date
    Feb 2013
    Posts
    1,099


    Did you find this post helpful? Yes | No

    Default Re: Is it possible to interpret non-standard serial data with PicBasic (sample attach

    No, I haven't used it, because protocol is different from IR protocol.

Similar Threads

  1. Is there an ICSP pinout standard???
    By OldMarty in forum General
    Replies: 12
    Last Post: - 21st September 2016, 12:29
  2. Interpret to Picbasic Code ¿?!!
    By Denner in forum PBP3
    Replies: 3
    Last Post: - 9th June 2015, 18:00
  3. sample code for AT45DB642D in Picbasic Pro
    By itsssyam in forum General
    Replies: 0
    Last Post: - 10th March 2010, 06:01
  4. Max/232 Bootloader problems - Schematic attached...
    By rossfree in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 4th May 2007, 15:54
  5. Replies: 0
    Last Post: - 30th November 2004, 02:18

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