Wired remote for Alpine


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    In front of each <Command> it's this : 00000000000000001111111101110111011101110101010111 <C>
    How can be writting, more "elegant" this :
    Code:
    timp con 536
    ...
    portb.x = 0
    pauseus 8584 ; 16 x 536,5 us
    portb.x = 0
    pauseus 4292 ;   8 x 536,5 us
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus 1610 ;   3 x 536,5 us
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus 1610
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus 1610
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus 1610
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus timp
    portb.x = 0
    pauseus 1610

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi,
    As last time this is completely untested. This builds and sends the command in steps which means that there will be some delay between the "preamble", "command" and "postamble". I don't know how tight the timing has to be so doing it this way may or may not work.
    Code:
    '****************************************************************
    '*  Name    : Fratello_JVC.pbp                                  *
    '*  Author  : Henrik Olsson                                     *
    '*  Notice  :                                                   *
    '*          :                                                   *
    '*  Date    : 2012-03-12                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    i VAR BYTE
    j VAR BYTE
    OutBuffer VAR BYTE[8]
    BitsToSend VAR BYTE
    
    
    Main:
        For j = 0 to 10
            GOSUB VolUp
            Pause 1000
        NEXT
    
        FOR j = 0 to 10
            GOSUB VolDn
            PAUSE 1000
        NEXT
    GOTO Main
    
    
    SendPreamble:
    ' 00000000  00000000  11111111  01110111 01110111 01010101  11
    ' Each individual byte reversed:
        OutBuffer[0] = %00000000
        OutBuffer[1] = %00000000
        OutBuffer[2] = %11111111
        OutBuffer[3] = %11101110
        OutBuffer[4] = %11101110
        OutBuffer[5] = %10101010
        OutBuffer[6] = %00000011
    
        BitsToSend = 50
        
        GOSUB SendBits
    RETURN
    
    '-----------------------------------------------------------------------
    SendPostAmble:
    ' 01111111 11111111 11111111 11111111 11110111 01110111 01110101 010111
        OutBuffer[0] = %11111110
        OutBuffer[1] = %11111111
        OutBuffer[2] = %11111111
        OutBuffer[3] = %11111111
        OutBuffer[4] = %11101111
        OutBuffer[5] = %11101110
        OutBuffer[6] = %10101110
        OutBuffer[7] = %00111010
        
        BitsToSend = 54
        
        GOSUB SendBits
    RETURN
    '-----------------------------------------------------------------------
    '-----------------------------------------------------------------------
    VolUp:
        GOSUB SendPreAmble
        ' 01010111 10101010 1
        ' Each individual byte reversed
        OutBuffer[0] = %11101010
        OutBuffer[1] = %01010101
        OutBuffer[2] = %00000001
        
        BitsToSend = 17
        
        GOSUB SendBits
        GOSUB SendPostAmble
    RETURN
    '-----------------------------------------------------------------------
    '-----------------------------------------------------------------------
    VolDn:
        GOSUB SendPreAmble
        ' 01111010 11110101 0101
        ' Each individual byte reversed
        OutBuffer[0] = %01011110
        OutBuffer[1] = %10101111
        OutBuffer[2] = %00001010
        
        BitsToSend = 20
        GOSUB SendBits
        GOSUB SendPostAmble
    RETURN
    '-----------------------------------------------------------------------
    '-----------------------------------------------------------------------
    SendBits:
        BitsToSend = BitsToSend - 1
        For i = 0 to BitsToSend 
            PortB.0 = OutBuffer.0[i]
            PauseUs 536
        NEXT
    RETURN
    '-----------------------------------------------------------------------
    Again, not tested so take it for what it is.

    /Henrik.

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    WOW ! Amazing ! Thank YOU so much !!!
    I discover, every time when someone, like YOU, post such a great example of code, how far I am from understanding this great art of programming !!!
    I made the tests and post the results. Best regards !

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    I made some changes ....
    Code:
    VolUp:
        GOSUB SendPreAmble
        ' 01010111 10101010 1
        ' Each individual byte reversed
        OutBuffer[0] = %11101010
        OutBuffer[1] = %01010101  ; modified
        OutBuffer[2] = %00000001
        
        BitsToSend = 17
        
        GOSUB SendBits
        GOSUB SendPostAmble
        
        OutBuffer[0] = %11101010
        OutBuffer[1] = %01010101  ; modified
        OutBuffer[2] = %00000001
        
            BitsToSend = 17
        
        GOSUB SendBits
        GOSUB SendPostAmble
        
        OutBuffer[0] = %11101010
        OutBuffer[1] = %01010101  ; modified
        OutBuffer[2] = %00000001
        
            BitsToSend = 17
        
        GOSUB SendBits
        GOSUB SendFinalAmble    
    RETURN
    and added this :
    Code:
    SendFinalAmble:
    ' 01111111 11111111 11111111 11111111 11111111 11111111 11111111 111111
        OutBuffer[0] = %11111110
        OutBuffer[1] = %11111111
        OutBuffer[2] = %11111111
        OutBuffer[3] = %11111111
        OutBuffer[4] = %11111111
        OutBuffer[5] = %11111111
        OutBuffer[6] = %11111111
        OutBuffer[7] = %11111111
        
        BitsToSend = 54
        
        GOSUB SendBits
    RETURN
    ...and in Proteus look fine !

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Are you sure you actually have to send the command three times? Personally I have NO knowlage about these things but I would've guessed (if this is captured from a remote for example) that it just kept repeating the command and postamble untill the button was released and then issued the 'FinalAmble'. So perhaps Preamble, Command, FinalAmble is all you actually need? Oh well, like I said, I have no idea really - just guessing, you'll figure it out.

    /Henrik.

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    My informations are from one user of AVFORUMS.COM.
    "Every time you send the device and command codes, you should repeat the device and command codes three times, but pause between them for about 20ms." I think it's true...

  7. #7
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Still beta-testing ...
    I wonder...It's one way to obtain EXACTLY 536.5 us ?!?

Members who have read this thread : 1

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