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

    Default Wired remote for Alpine

    Hello !
    Since I have good results with "wired remote for Pioneer HU" (see : http://www.picbasic.co.uk/forum/showthread.php?t=15229 ) one friend ask me to build something similar for his Alpine ...
    I found a good topic here : http://www.mp3car.com/input-devices/...ol-pinout.html , where it's described the "protocol".
    I intend to use the same hardware : PIC 16F628A and remote control stalk near the steering wheel, from Renault.
    But...I need help to put in PBP this :
    Code:
    Vol Up    110101111101101110101011110110111101011011010101
    Vol Dn    110101111101101110101011011011011111011011010101
    Mute    110101111101101110101011101011011110111011010101
    Pst up    110101111101101110101011101010111110111101010101
    Pst dn    110101111101101110101011010101011111111101010101
    Source    110101111101101110101011101101111101101101010101
    Trk up    110101111101101110101011101110111101101011010101
    Trk dn    110101111101101110101011010111011111101011010101
    Power    110101111101101110101011011101111110101101010101
    Ent/Play    110101111101101110101011010101111111110101010101
    Band/prog    110101111101101110101011011010111111011101010101
    
    
    Note that the same series of 1's and 0's is at the start and end of each command, so here are the unique parts of each:
    
    
    (Start)    110101111101101110101011
    
    Vol Up    11011011110101101
    Vol Dn    01101101111101101
    Mute    10101101111011101
    Pst up    10101011111011110
    Pst dn    01010101111111110
    Source    10110111110110110
    Trk up    10111011110110101
    Trk dn    01011101111110101
    Power    01110111111010110
    Ent/Play    01010111111111010
    Band/prog    01101011111101110
    
    (End)    1010101
    So if "0" is low for 1000 us, and "1" is high for 500 us AND low for 500 us, how can I write the code ?!
    Something like this (pseudo-code):
    Code:
    ;(Start)    110101111101101110101011
     ; Vol Up    11011011110101101
    
    check: select case key  case 1     ; volume down 
    portb.7 = high
    pauseus 500
    portb.7 = low
    pauseus 500  ' this is first "1"
    portb.7 = high
    pauseus 500
    port.7 = low
    pauseus 500 ' this is second "1"
    ... so on, so on ?!?
    I need "a clue" ! Thanks in advance !!!
    Last edited by fratello; - 31st January 2012 at 15:22.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi,

    Here's an idea:
    Code:
    '****************************************************************
    '*  Name    : Fratello_Alpine.PBP                               *
    '*  Author  : Henrik Olsson                                     *
    '*  Notice  :                                                   *
    '*          :                                                   *
    '*  Date    : 2012-01-31                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    
    ' CONFIGs and hardware setup, ADCON, CMCON, TRIS whatever not shown here.
    
    '------------------------------------------------------------------------
    StartH CON %11010111        ' High 8 bits of start frame
    StartM CON %11011011        ' Middle 8 nits of start frame
    StartL CON %10101011        ' Low 8 bits of start frame
    '------------------------------------------------------------------------
    VolUpH CON %11011011        ' High 8 bits of command
    VolUpM CON %11010110        ' Middle 8 nits of command
    VolUpL CON %11010101        ' Low bit of command + 7bits END of frame
    '------------------------------------------------------------------------
    VolDnH CON %01101101        ' High 8 bits of command
    VolDnM CON %11110110        ' Middle 8 nits of command
    VolDnL CON %11010101        ' Low bit of command + 7bits END of frame 
    '------------------------------------------------------------------------
    ByteArray VAR BYTE[6]       ' 6 bytes = 48bits
    BitCount  VAR BYTE          ' Index variable for above array
    i         VAR BYTE          ' General purpose
    '------------------------------------------------------------------------
    ' Initialise the first three bytes of the array, these are static.
    ByteArray[0] = StartH 
    ByteArray[1] = StartM
    ByteArray[2] = StartL
        
    Pause 1000
    HSEROUT["Program start",13]
    
    
    Main:
        For i = 0 to 20
            GOSUB VolumeUp
            Pause 300
        NEXT
        
        FOR i = 0 TO 20
            GOSUB VolumeDn
            Pause 300
        NEXT
        
        Goto Main
        
    END
    '------------------------------------------------------------------------
    
    '------------------------------------------------------------------------
    ' Subroutines follows:
    '------------------------------------------------------------------------    
    VolumeUp:
        ' Set non static part of array to current command.
        ByteArray[3] = VolUpH
        ByteArray[4] = VolUpM
        ByteArray[5] = VolUpL
        GOSUB SendIt
    RETURN
    '------------------------------------------------------------------------
    VolumeDn:
        ByteArray[3] = VolDnH
        ByteArray[4] = VolDnM
        ByteArray[5] = VolDnL
        GOSUB SendIt
    RETURN
    '------------------------------------------------------------------------   
    SendIt:
        FOR BitCount = 0 to 47
            If ByteArray.0[BitCount] = 1 THEN
                GOSUB One
            ELSE
                GOSUB Zero
            ENDIF
        NEXT
    RETURN
    '------------------------------------------------------------------------
    One:
        PORTB.7 = 1
        PAUSEUS 500
        PORTB.7 = 0
        PAUSEUS 500
    RETURN
    '------------------------------------------------------------------------
    Zero:
        PortB.7 = 0
        PAUSEUS 1000
    RETURN
    /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 !!! What fast and GREAT answer !!!
    Thank YOU so much ! I will try this and post feed-back !

  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

    One little queries : In "SendIt:" which is the command to send (to portb.7) the data from ByteArray[n] (n=3;4;5) ? I miss something ? Thanks !

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi,
    Not sure I understand what you mean....
    Send it iterates thru the bytearray bit by bit. For each bit it GOSUBS either One or Zero based on if the bit is 1 or 0. It's in the routines One and Zero that the actual port is written.

    With that said, the code is untested so I may have missed something.

  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

    I understand...Thanks !
    Next step : need confirmation if works correct (just VolumeUp & VolumeDn at this moment) !
    In attach : code and Proteus simulation.
    Attached Images Attached Images  
    Attached Files Attached Files

  7. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    It looks to me like the :

    StartH CON %11010111 ' High 8 bits of start frame

    is getting read out backwards, as it is incrementing from bit 0 to 47. I think you need to change some things so it gets read out forward.
    http://www.scalerobotics.com

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Yeah, didn't think that one thru all the way - apparently. But you're smart enought to move things around so the bits come in the right order.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    I reverse ... something, and the results are Ok (in Proteus) ! Hope to testing soon if work ! Thank You all ! I will post the results !
    Code:
    ;StartH CON %11010111        ' High 8 bits of start frame
    StartH CON %11101011
    StartM CON %11011011        ' Middle 8 nits of start frame
    ;StartL CON %10101011        ' Low 8 bits of start frame
    StartL CON %11010101
    '------------------------------------------------------------------------
    VolUpH CON %11011011        ' High 8 bits of command
    ;VolUpM CON %11010110        ' Middle 8 nits of command
    VolUpM CON %01101011
    ;VolUpL CON %11010101        ' Low bit of command + 7bits END of frame
    VolUpL CON %10101011

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Mr.Henrik Olsson : THANK YOU ! With some minors modification (reversing order ; changes in KeyPad2.pbp ; adding input/output timming), the code work PERFECT !!!

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


    Did you find this post helpful? Yes | No

    Default Re: Ready for a new challenge ?! Just a joke, of course !

    I have all information about code for JVC remote : http://www.avforums.com/forums/car-e...l#post16560076
    The code is ... SO BIG ....
    This is how commands look :
    Code:
    11111111000000000000000011111111
    01110111011101110101010111<C>0111
    11111111111111111111111111111111
    01110111011101110101010111<C>0111
    11111111111111111111111111111111
    01110111011101110101010111<C>0111
    11111111111111111111111111111111
    where the <C>s should be replaced by:
    Code:
    0x04 Vol+                     01010111101010101
    0x05 Vol-                     01111010111101010101       
    0x08 Source                   01010101111010101 
    0x0D Sound                    01111010111101111010101    
    0x0E Mute                     01011110111101111010101     
    0x12 Skip fwd or Right        01011110101011110101   
    0x13 Skip back or left        01111011110101011110101 
    0x14 Skip fwd hold or Up      01010111101011110101  
    0x15 Skip back hold or down   01111010111101011110101
    How #*&^%$#@"_)_ can write this in PBP ? I can figure out...Any help will be wellcome ! Thanks !
    Last edited by fratello; - 9th March 2012 at 08:31.

  12. #12
    Join Date
    Feb 2013
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi! I am from Turkey. Taken in the forum I read that you are running on the remote control for Alpine.What did you use microcontrollers. I worked very hard, but did not succeed. Can you give pbp code for alpine? My adress is [email protected] Thanks.
    Quote Originally Posted by fratello View Post
    Mr.Henrik Olsson : THANK YOU ! With some minors modification (reversing order ; changes in KeyPad2.pbp ; adding input/output timming), the code work PERFECT !!!

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