Wired remote for Pioneer HU


Closed Thread
Results 1 to 23 of 23
  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579

    Default Wired remote for Pioneer HU

    Hi ! I try to build one wired remote for HU Pioneer , using remote control stalk near the steering wheel, from Renault. I wrote the code ; in simulation work fine. But...I don't know how setting ports "b" and what to do when push_button it's press.
    In "original" remote, the command are given by putting resistors "to ground". How can I do this with my PIC ? Thanks in advance !
    Code:
    @ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF 
    
       
       Include "modedefs.bas"   ' Serial Protocol
       Define   OSC 4           ' 4MHz 
       CMCON = 7                ' Disable on-chip comparator, PORTA in digital mode
                  
       '// Define port pins as inputs and outputs ...
       TRISA  = %00000111
       TRISB  = %11111100
    
    portb = 1
    include "c:\pbp\keypad2.pbp" ' see http://www.picbasic.co.uk/forum/showthread.php?t=3250
    
    main:
    gosub keypadscan
    gosub check
    goto main
    
    check:
    select case key 
    case 1     ; volume down
       trisb.2=0    ; ?????
       pause 200    ; 
       trisb.2=1    ' ?????
    Attached Images Attached Images   

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    one thing I would make sure before connecting this to the car... measure the .spurious/floating) voltage on the tip pin when nothing it pluged.. if it's 12 volt you want to change some part of your hardware. Case it's 5 volts (or so), well there's no problem with your current solution

    What you need to do is to clear the PORTB bits (to 0) and set your TRISB bits to 0 when you want to set a resistor to ground, and to 1 when you want to disconnect the resistor from the circuit. The more you clear TRSIB bits, the more resistor you add in parrallel. You should know how to calculate/evaluate resistors in parrallel, so, just etablish some value and work around this. Maybe you don't need more than 3-4 resistor to reproduce the whole value in the table above. If you feel lazy, then use 8 resistor and assign them to a whole 8 bits port. easier, need a bit more I/O... but easier. BTW you already get the idea as per your code.

    8 resistors, 6 button = 14 I/O, a PIC 16F628 will do the trick without any need for a matrix keypad.
    Code:
    Button1 VAR PORTA.0
    Button2 VAR PORTA.1
    
    IF Button1=0 then set your resistor on portb
    If Button2=0 then set your resistor on portb
    .....
    or
    Code:
    Button var PORTA
    Select Case Button
         Case xyz
              Set yourresistor
         Case abc
               Set another resistor
    ....
    How about that?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Thank You verry much for support !
    I use matrix keypad because the Renault remote act like one (see picture) !
    Quote Originally Posted by mister_e View Post
    What you need to do is to clear the PORTB bits (to 0) and set your TRISB bits to 0 when you want to set a resistor to ground, and to 1 when you want to disconnect the resistor from the circuit.
    So, it's enough (?) something like this :
    Code:
    case 1
    portb.2=0
    trisb.2=0
    pause 500 ; i put the resistor on portb.2 to ground for 0.5 sec
    portb.2=1
    trisb.2=1
    The "portb" it's OK to set in header "PORTB=%11111100" ?
    Last edited by fratello; - 28th July 2011 at 18:32.

  4. #4
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Set all pin to low, and then just change tris registers, instead of changing port and tris.
    Also add 5.1V zener between resistor common wire and ground.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Now it's ok ?
    Code:
       '// Define port pins as inputs and outputs ...
       TRISA  = %00000111
       TRISB  = %00000000
    
    
    include "c:\pbp\keypad2.pbp" ' see http://www.picbasic.co.uk/forum/showthread.php?t=3250
    
    main:
    gosub keypadscan
    gosub check
    goto main
    
    check:
    select case key 
    case 1     ; volume down
    portb.2=0
    pause 500 ; i put the resistor on portb.2 to ground for 0.5 sec
    portb.2=1

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Code:
    PORTB=0
    TRISB = 255 ' Disconnect all resistors from the circuit
    ' Some code here
    DoItAgain: SELECT CASE XYZ CASE ABC TRISB.0 = 0 ' Connect PORTB.0 resistor to the circuit CASE DEF TRISB.0 = 0 ' Connect PORTB.0 resistor to the circuit TRISB.1 = 0 ' Connect PORTB.1 resistor to the circuit CASE GHI TRISB.0 = 0 ' Connect PORTB.0 resistor to the circuit TRISB.2 = 0 ' Connect PORTB.2 resistor to the circuit TRISB.3 = 0 ' Connect PORTB.3 resistor to the circuit END SELECT PAUSE 500 TRISB = 255 ' Disconnect all resistors GOTO DoItAgain
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    THANK YOU ALL !
    Code:
    @ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF 
    
       
       Include "modedefs.bas"   ' Serial Protocol
       Define   OSC 4           ' 4MHz 
       CMCON = 7                ' Disable on-chip comparator, PORTA in digital mode
                  
       '// Define port pins as inputs and outputs ...
    TRISA  = %00000111
    PORTB=0
    TRISB = 255 ' Disconnect all resistors from the circuit
    
    
    include "c:\pbp\keypad2.pbp" ' see http://www.picbasic.co.uk/forum/showthread.php?t=3250
    
    main:
    gosub keypadscan
    gosub check
    goto main
    
    
    check:
    select case key 
    case 1     ; volume down
        trisb.2=0
    
    case 2    ; track -
        trisb.3=0
       
    case 3    ; volume up
        trisb.4=0
       
    case 4    ; mute
        trisb.5=0
       
    case 5    ; source
        trisb.6=0
       
    case 6    ; track +
        trisb.7=0
       
    end select
    Pause 500 ' do it for 0.5 sec
    TRISB = 255
    Return
    
    end 'of story !

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Time to celebrate!




    This code is...


    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Scheme, as conceived above, does not work !!! I put opto-couplers at PIC outputs and work fine ...
    What could cause it does not work in this hardware ? Need to manage some (others) PIC registers ? Regards !

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    I'm confused. So, your big thank you a year ago, (and the happy dance by Steve) was for code you couldn't get working? Or you didn't try the code until now? Perhaps more explanation is required, at least for me.
    http://www.scalerobotics.com

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


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Yes, I have not tested this scheme until yesterday ... and how I say, I found that does not work ! Even if my ohm-meter show "right" value of resistances ( at every press of buttons) the HU not react ; with optocouplers all are ok. Strange for me...The hardware it's finished, but remains my astonishment about this. Thanks for reply !

  12. #12
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Welllll Fratello, it seems you've been bitten by a simulator ?
    One hint from Steve's code's comments . . . " MUST USE MPASM " . . . Your configs indicate PB assembler.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  13. #13
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Thanks for reply !
    I do not think I understood very well ...What that means "MUST USE MPASM" ?!
    Trisx.y in PBP it's not like trisx.y in assembler ?

  14. #14
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Read
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    And stop using the simulator, or at least let everyone kow that you are when you post a problem.
    Dave
    Always wear safety glasses while programming.

  15. #15
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Thanks You so much for support ! Are some thinks I dont understand (too ...) ...
    1. I dont use MPASM in code.
    2. My astonishment it's about non-function of this hardware ! If I connect JUST the resistor on jack, the HU react ! If I use same resistor -via optocoupler - the HU react ! But with PIC, dont !
    I increased the time for each tris command, but without results !
    Code:
    case 1     ; volume down    
     trisb.2=0
    Pause 5000 ; I try even with this huge pause !
    trisb.2=1
    ...
    endcase

  16. #16
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    I am not familiar with the HU, but if you post the current hardware schematic (PIC, opto, HU) someone may be able to spot the problem.
    Dave
    Always wear safety glasses while programming.

  17. #17
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    So...with schematic from post #1 - no results !
    With a simple resistor - good results ; with optocouplers - good results too.
    Attached Images Attached Images   
    Last edited by fratello; - 28th May 2012 at 18:57.

  18. #18
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    ...and how an "original" remote work :
    Attached Images Attached Images  

  19. #19
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Hi,
    I haven't studied this thread in detail but if the idea is to "place a resistance" across the plug then I don't think you can run the same code (if that's what you're doing) with the two different hardware designs. When using the circuit with the opto-isolators you drive the PIC-pin high in order to turn on the opto-isolator and connect the associated resistor across the plug - and if I read your posts correct this works fine.

    It's not exactly clear to me how the plug is connected to the circuit in post#1 but it looks to me as if this circuit doesn't work the same way as the one with the opto-isolators. So, if you're trying to run the same code with the two circuits my guess is that's where your problem is.

    /Henrik.

  20. #20
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Thanks for support, Mr.Henrik !
    When I switch to optocouplers, I changed code :
    Code:
    case 1     ; volume down      
    Portb.2=1 
    Pause 100   
    Portb.2=0
    My "sources of inspiration" was here : http://www.panuworld.net/minidisc/fordsony/index.htm & http://www.fiatforum.com/marea/29682...-finished.html
    Last edited by fratello; - 29th May 2012 at 06:47.

  21. #21
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Quote Originally Posted by fratello View Post
    Thanks for reply !
    I do not think I understood very well ...What that means "MUST USE MPASM" ?!
    Trisx.y in PBP it's not like trisx.y in assembler ?
    Must use the MPASM assembler from Microchip, and not the PB assembler supplied with PBP. I am betting the simulator defaults to using MPASM and simply ignores the PB configs altogether. So when you run it, it knows what to do with Steve's keypad code whereas PB does not.Most of Steve and Darrel's code samples require MPASM, and when you upgrade to PBP3 it ONLY uses MPASM, so it is a worthwhile change.
    Last edited by Archangel; - 29th May 2012 at 06:58.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  22. #22
    Join Date
    Apr 2013
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    Hi,

    did any of you build adapter for stalk steering wheel controls on renault (tuner list stereo instalation, mine laguna year 2002) for pioneer? I saw scheme above but i dont know how to wire it in little yellow miniISO 6-pin jack that is connected on steering wheel controls? Any help?

    Thank You in advance.

  23. #23
    Join Date
    Aug 2005
    Posts
    44


    Did you find this post helpful? Yes | No

    Default Re: Wired remote for Pioneer HU

    the reason the original design doesnt work is due to parallel resistors not giving the required voltage at the stereo plug (due to voltage divider effects), by using opto's you are supplying discreet resistances which results in the correct voltages

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