Wired remote for Pioneer HU


Closed Thread
Results 1 to 23 of 23

Hybrid View

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

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

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

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

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

  6. #6
    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 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 !

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

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