Wired remote for Alpine


Closed Thread
Results 1 to 39 of 39

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi,
    Like I said earlier, with this aproach you're going to get variation in the bit to bit timing when going from preamble to data to postamble etc. You should be able to SEE this on the scope. Also verify that you actually GET 536.4us between bits (I think it'll be a bit more due to the FOR-NEXT loop) and adjust the delay to match exactly.

    What I'd try, just to see IF timing is all there is to it is to stitch a complete packet together and send it in one go. Just extend the size of the array and load it up with bits, set BitsToSend accordingly and call SendBits.

    /Henrik.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    You are such a fine gentleman !!! Thanks !
    ...so You say to put the entire command in "one place" ?

    OutBuffer[0] = ....
    to
    OutBuffer[n] = ....
    and
    BitsToSend = n x 8 GOSUB SendBits
    ?!
    I have some doubt about how I understand this :
    "You really shouldn't drive the output line at 5V or 3V or any other voltage for a high output. If you want the output to be high, you do that by turning off the PIC's output driver. This way it doesn't matter what voltage the head unit uses, your hardware will always be compatible. It'll work at 5V, 3.3V, or anything.
    To do that, search the PIC manual for "Open-drain".
    For the 16-bit PIC24F series, you configure the pins as open drain by setting the bits in the ODCx register to '1's BEFORE you configure the pin as an output by writing '0's to the TRISx register."
    It's ok what I wrote in code, ie how I use PortC and TrisC ?

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Exactly, take the complete bitstream and fill the array with that, make sure you have the correct numbers of bits and then call SendBits. Because the actuall commads seem to be of different length the n*8 may not be true, make sure to count the actual number of bits in the packet.

    Regarding the other comment....It totaly depends on the actual hardware you're using but since you indicate that you're using a transistor between the PIC and the actual unit I think you need to DRIVE that transistor base high AND low, not float it by setting TRIS - again, depends on how your hardware is done.

    /Henrik.

  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

    Since I have no results with this code, I made this "PICKit2 IR capture tool" , from here : PIC Kit 2 IR capture tool « Spiralbrain's Blog
    The signals captured with this tool are totally different !!! I build even an IR widget for analyzing the IR signal...My conclusions : my remote, JVC RM-RK252, send a different code than that presented till now in this topic......I post the picture of all my captures, using AND an IR_Widget with IR_Scope (yes, I build this one too !)
    So : this is how the volume_up signal is ! The red part (in pdf) it's the part common for all commands ; the black part is proper command.
    Can I use Mr.Henrik examples for writting the new code ?! I have some questions : 415, 560 and 1400 are values by itselfs ...How can I put them in code ? Using something like this : "Data 560, 1400 ( this in hex ?), 560,1400,560,415,560,415, so on, so on ...." ?
    Thanks in advance for support and I apologize for my ignorance ...
    Attached Images Attached Images   
    Attached Images Attached Images

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Can be done in this way ???:
    Code:
    ;
    ;          testing code for new JVC Remote
    ;                       march, 31
    
    @ DEVICE PIC16F684, HS_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF, PROTECT_ON
    DEFINE OSC 20
    include "ALLDIGITAL.pbp"
                              
    PORTA= 000011
    TRISA= 000011
    
    PORTC= 000000
    TRISC= 111110
                    
    CMCON0 = 000111              'Disable analog comparators.     
    VRCON  = 000000               ' Disable Comparator Voltage Reference
    ANSEL  = 000000               ' Set pin (AN2) to analog input, the rest to digital
    ADCON0 = 000000               ' Set up A/D converter - Right Just., VDD REF., CH 3, ON
    
    Pause 1000
    
    
    i VAR BYTE
    j VAR BYTE
    pulse con 560
    
    main:
    
    if porta.0 = 0 then gosub VolUp
    
    Pause 100 ' do it for 0.1 sec
    
    goto main
    
    
    VolUp :
    TRISC.0 = 1
    pauseus 4000
    TRISC.0 = 0
    pauseus 1900
    TRISC.0 = 1
    pauseus pulse
    TRISC.0 = 0
    pauseus 1400
    TRISC.0 = 1
    pauseus pulse
    TRISC.0 = 0
    pauseus 1400
    TRISC.0 = 1
    pauseus pulse
    
    for i = 0 to 30
              Lookup i,[$BE,$8C,$8C,$2A,$2A,$2A,$2A,$2A,$2A,_
                        $8C,$2A,$2A,$2A,$2A,$2A,$2A,$2A,$2A,_
                        $8C,$2A,$2A,$2A,$8C,$2A,$2A,$2A,$2A,_
                        $2A,$2A,$8C,$8C] ,j 
    TRISC.0 = 0 
    PauseUs j*10
    TRISC.0 = 1 
    PauseUs pulse  
    next i 
    Return
    In Proteus it's ok ; just the "preamble" part so far.
    Any advice will be wellcome !
    Last edited by fratello; - 31st March 2012 at 17:01.

  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

    This code :
    Code:
    i VAR BYTE
    j VAR BYTE
    pulse con 560
    
    main:
    
    if porta.0 = 0 then  gosub volup
    TRISC.0 = 1
    goto main
    
    
    VolUp :
    Gosub Preamble
    FOR I = 0 TO 17
                Lookup i,[$8C,$2A,$2A,$8C,$2A,$2A,$2A,$8C,$2A,$8C,_
                          $2A,$2A,$2A,$2A,$8C,$8C,$8C,$8C ] ,j
    TRISC.0 = 0 
    PauseUs j*10
    TRISC.0 = 1 
    PauseUs pulse  
    next i
    PauseUs 4500 
    RETURN
    
    Preamble :
    TRISC.0 = 1
    Pauseus 4000
    for i = 0 to 30
              Lookup i,[$BE,$8C,$8C,$2A,$2A,$2A,$2A,$2A,$2A,_
                        $8C,$2A,$2A,$2A,$2A,$2A,$2A,$2A,$2A,_
                        $8C,$2A,$2A,$2A,$8C,$2A,$2A,$2A,$2A,$2A,$2A,_
                        $8C,$8C ] , j
    TRISC.0 = 0 
    PauseUs j*10
    TRISC.0 = 1 
    PauseUs pulse  
    next i 
    Return
    give me, in Proteus (!), the code I need ...The next step it's hardware testing !

  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

    I put all the values into one command :
    Code:
    pulse con 567
    
    MAIN :
    if porta.0 = 0 then  
    PORTC.0 = 0
    pauseus 4032
    
    for i = 0 to 48
    lookup i,   [value, value, value, ....], j
    PORTC.0 = 1 
    PauseUs j
    PORTC.0 = 0 
    PauseUs pulse
    next i
    
    PORTC.0 = 0
    PauseUs 4500
    PORTC.0 = 1
    ENDIF
    
    PAUSE 25
    goto main
    ...but testing hardware I have no results , despite the "full similarity" with code captured with IR_Scope !
    Somebody has more experience with IR remote control ? It's the "lenght" of each pulse so critical ?
    I don't understand what I do wrong ...

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