Wired remote for Pioneer HU


Closed Thread
Results 1 to 23 of 23

Hybrid View

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

    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
    582


    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
    755


    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
    582


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

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


    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 !

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

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


    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 ?

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

  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

    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.

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

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