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

    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 18:01.

  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

    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 !

  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

    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 ...

  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

    Still no good news ... Cycle " for ...next" generate a "big" delay ?

  5. #5
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi fratello;

    I dind't read the hole thread, but are you trying to reproduce a IV remote control??
    If so, i see on your last post that your reproducing the pulses, but you are not using modulation, and you must use modulation when using IV. Probably 36Khz, or 38Khz, or 40Khz.
    Thanks and Regards;
    Gadelhas

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    Hi,
    The actual FOR-NEXT construct will add some additional delay due to the fact that it is a jump isntruction and it has to make the comparison. Add to that the execution time of the LOOKUP instruction you're using. Why don't you just measure it and adjust the pulse constant so it matches the capture of the working remote?

    /Henrik.

  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

    Thanks !
    @Gadelhas : I try to build a wired-remote, not IR remote ; I use IR remote just for reading codes, but I intend to use wired - steering wheel - remote.
    @Henrik : Good ideea !!! I will try tomorrow to read MY signal ...by putting one LED to PIC output (?!)

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Alpine

    I make reverse-engineering ... I put one IR-LED on output (driving by transistor) to see how the code work !
    And... surprise ! It's totally different by Proteus simulation and my whis !!!
    Despite I try to "PauseUs 560" the Pauseus, measured in IR_Scope, it's 202 to 208 us !

    I read this : "PAUSEUS assumes an oscillator frequency of 4MHz ;PAUSEUS 1000 ' Delay for 1 millisecond "
    It's not applicable on my code ?! Why ? I use an 4 MHz crystal , I define "XT_OSC" ... I really don't understand ...

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