Sony IR Remote


Closed Thread
Results 1 to 40 of 41

Thread: Sony IR Remote

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    This is my last variant of code; works fine in ISIS, hope to my car too.
    Code:
    ' 
    '       Varianta cu ASM from www.rentron.com
    '              Thanks to Mr.Bruce !
    '
    '           PIC12F675:                    +--U--+                                         
    '                                    +5V  [     ]  GND                                    
    '                         key 5 |---/--- >[     ]< ---/---| key 1     
    '                         key 4 |---/--- >[     ]< ---/---| key 2                   
    '       pull-up!          key 3 |---/--- >[     ]>--[4K7]-- NPN Transistor, IR LED  
    
    @ DEVICE PIC12F675, intrc_osc, wdt_off, pwrt_on, mclr_off, bod_off
    INCLUDE "MODEDEFS.BAS" 
    DEFINE OSC  4
    
    CMCON=7
    OPTION_REG.7=0
    TRISIO  = %00111011
    WPU=%00111011
    IOCB=%00111011
    ANSEL=0
    
    but1 var gpio.0
    but2 var gpio.1
    LED  var gpio.2
    but3 var gpio.3
    but4 var gpio.4
    but5 var gpio.5
    
    zecime   CON  3      '// = ( 3 * 25uS) = 0.07 mS burst
    zero     CON 12      '// =( 12 * 25us) = 0.30 mS burst
    unu      CON 24      '// = (24 * 25uS) = 0.60 mS burst
    
    delay		var word
    i 		var byte
    cycles	var byte
    acycles     var byte
    
    GIE  var intcon.7 ' global interrupt enable 1=on ; 0=off
    gpie var intcon.3 ' port change interrupt enable 1=0n ; 0=off
    gpif var intcon.0 ' port change interrupt flag bit
    
    GIE=0
    GPIE=1
    
    '=========================================
    
    main:
    
     @ sleep
     pause 100
    
    IF but1=0 then 			; VOLUME UP
    acycles= unu + zero + zecime  		' ~ 970 uS
          delay=970
        	GOSUB IR_REMOTE
    ENDIF 
    
    IF but2=0 then 			; VOLUME DOWN
    acycles= unu + unu + zecime   		' ~ 1270 uS
    	delay= 1270
    	GOSUB IR_REMOTE
    ENDIF 
    
    IF but3=0 then 			; BUTTON UP
    acycles= unu + unu + zero + zecime 		' ~ 1570 uS
          delay = 1570
    	GOSUB IR_REMOTE
    ENDIF 
    
    IF but4=0 then 			; BUTTON DOWN
    acycles= unu + unu + unu + zecime  		' ~ 1870 uS
          delay = 1870
    	GOSUB IR_REMOTE
    ENDIF 
    
    IF but5=0 then 			; MUTE
    acycles= unu + unu + unu + zero + zecime 	' ~ 2170 uS
          delay = 2170  
    	GOSUB IR_REMOTE
    ENDIF 
    
    GPIF=0  'Clear port change interrupt flag
    PAUSE 50
    
    Goto Main
    
    '=========================================
    ir_REMOTE:
    cycles=acycles
    call Pulse
    
    pauseus  delay          
    
    cycles=zero + zecime     			' ~ 670 uS   
    call Pulse
    
    return
    '=========================================
    Pulse:                '// Emits # of 40kHz bursts held in variable Cycles
    ASM                   ;// with auto delay between bursts
       bsf gpio, 2        ;// 1uS, LED=on [need 25uS total
       goto $+1           ;// 3uS (2uS per goto $+1)
       goto $+1           ;// 5uS
       goto $+1           ;// 7uS
       goto $+1           ;// 9uS
       goto $+1           ;// 11uS
       goto $+1           ;// 13uS 
       bcf gpio, 2        ;// 14uS, LED=off
       goto $+1           ;// 16uS
       goto $+1           ;// 18uS
       goto $+1           ;// 20uS
       goto $+1           ;// 22uS
       decfsz _Cycles,F   ;// 23uS
       goto _Pulse        ;// 25us
    ENDASM
     
    RETURN                '// Return to Main
    
    '========================================
    END
    If see obviously mistakes, please tell me. Thank You, all !
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default ...please help !

    " I have not failed. I've just found 10,000 ways that won't work". T.A.Edison
    Code :
    Code:
    '
    '           PIC12F675:                    +--U--+                                         
    '                                    +5V  [     ]  GND                                    
    '                         key 5 |---/--- >[     ]< ---/---| key 1     
    '                         key 4 |---/--- >[     ]< ---/---| key 2                   
    '       pull-up!          key 3 |---/--- >[     ]>--[4K7]-- NPN Transistor, IR LED  
    
    @ DEVICE PIC12F675, intrc_osc, wdt_off, pwrt_on, mclr_off, bod_off
    INCLUDE "MODEDEFS.BAS" 
    DEFINE OSC  4
    
    CMCON=7
    OPTION_REG.7=0
    GPIO = %00000000        ' All outputs = 0 on boot
    TRISIO  = %00111011
    WPU=%00111011
    IOCB=%00111011
    ANSEL=0
    
    
    @ #DEFINE IRTX GPIO  ; Define port to use for IR LED drive
    @ #DEFINE PIN 2      ; Define port pin to use for IR LED
    
    
    
    
    but1 var gpio.0
    but2 var gpio.1
    but5 var gpio.5
    
    vplus   	CON  106      '// = ( 106 * 25uS) = 2650 uS burst
    vminus     	CON  130      '// = ( 130 * 25us) = 3250 uS burst
    vmute      	CON  202      '// = ( 202 * 25uS) = 5050 uS burst
    vpuls       CON   27      '// = (  27 * 25uS) =  675 uS burst
    
    delay		var word
    cycles	var byte
    acycles     var byte
    timeX       var byte
    
    GIE  var intcon.7 ' global interrupt enable 1=on ; 0=off
    gpie var intcon.3 ' port change interrupt enable 1=0n ; 0=off
    gpif var intcon.0 ' port change interrupt flag bit
    
    
    GIE=0
    GPIE=1
    
    '=========================================
    
    main:
    
     @ sleep
     pause 100
    
    IF but1=0 then 			; VOLUME UP
    acycles = vplus   		
          delay = 2580
    while but1=0
        	GOSUB IR_REMOTE
    wend
    ENDIF 
    
    IF but2=0 then 			; VOLUME DOWN
    acycles = vminus 
    	delay = 3200 
    while but2=0
        	GOSUB IR_REMOTE
    wend
    ENDIF 
    
    
    IF but5=0 then 			; MUTE
    acycles = vmute
          delay = 5000  
    while but5=0
        	GOSUB IR_REMOTE
    wend
    ENDIF 
    
    GPIF=0  'Clear port change interrupt flag
    PAUSE 50
    
    Goto Main
    
    '=========================================
    ir_REMOTE:
    cycles=acycles
    call Pulse
    
    pauseus  delay          
    
    cycles=vpuls     			' ~ 670 uS   
    call Pulse
    
    
    PAUSE 500
    return
    
    '=========================================
    Pulse:                '// Emits # of 39kHz bursts held in variable Cycles
    ASM
       bsf IRTX,PIN     ; 1uS, LED=on
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       goto $+1         ; + 2uS = 11uS 
       goto $+1         ; + 2uS = 13uS 
       bcf IRTX,PIN     ; 1uS, LED=off
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       decfsz _Cycles,f ; + 1uS = 10S    
       goto _Pulse      ; + 2uS = 12uS 
    ENDASM
     
    RETURN                '// Return to Main
    
    '=====================================================
    Debounce :
    For timeX= 1 to 50
    Pause 5
    next timeX
    Return
    '========================================
    END
    Of course, zero result ! Even ISIS say it's ok, my RC Blaupuntk don't react ! I have one original RC 10 remote (and receiver, of course) from one friend; works fine. But, if I try to transmit something with my schematic...zero result ! Any advice, please ?!?

  3. #3
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    At this point, it might be a good idea to actually, visually compare the original signal with the one generated by your design. Capture the signals on your PC using the sound card, and open the captured file(s) with Goldwave / Audacity.

    You'd immediately see whether the problem is to do with timing / protocol / logic or amplitude.

    Regards,

    Anand

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Even better if you can afford the Logic from www.saleae.com to analyse digital signals. It saved me many times when trying to copy signals from similar cases.

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Instead to party for my Birthday....

    I spend time with this "killer" code. Now I discover another strange phenomenon : anything I do, can't generate "train" of pulse.
    Instead generating for 4 times this sequence : high 2650 ,pause 2500, high 660, pause 100
    I have just ONE sequence for about 42.25 mS !!!
    WHY ?!?
    Code:
    main:
    
    zecime  CON 106    '// = ( 106 * 25uS) = 2650 uS burst
    unu       CON 24     '// = (24 * 25uS) = 0.60 mS burst
    delay     CON 104
    
    
    i 		var byte
    cycles	var byte
    acycles      var byte
    
    ;============================
    Main:
    IF but1=0 then 			; VOLUME UP
        goto ir_send
    endif
    
    Goto Main
    
    '=========================================
    ir_send:
         	cycles=zecime
            acycles=unu
     for i=1 to 4        
            call Pulse
            pauseus  delay        
            call Pulser
     next i     
    Pauseus 100   
    Goto main        ' or Return, have no result !
    
    Pulse:              ' Generate "Cycles" number of 40kHz pulses
    ASM
       bsf gpio, 2     ; 1uS, LED=on
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       goto $+1         ; + 2uS = 11uS
       goto $+1         ; + 2uS = 13uS   
       bcf gpio, 2     ; 1uS, LED=off
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       decfsz _Cycles,f ; + 1uS = 10S    
       goto _Pulse      ; + 2uS = 12uS
       return           ; Add 2uS for return to caller    
    ENDASM
    
    
    Pulser:              ' Generate "Cycles" number of 40kHz pulses
    ASM
       bsf gpio, 2     ; 1uS, LED=on
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       goto $+1         ; + 2uS = 11uS
       goto $+1         ; + 2uS = 13uS   
       bcf gpio, 2     ; 1uS, LED=off
       goto $+1         ; + 2uS = 3uS
       goto $+1         ; + 2uS = 5uS
       goto $+1         ; + 2uS = 7uS
       goto $+1         ; + 2uS = 9uS
       decfsz _Acycles,f ; + 1uS = 10S    
       goto _Pulser      ; + 2uS = 12uS
       return           ; Add 2uS for return to caller    
    ENDASM
    Thanks again for attention !

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


    Did you find this post helpful? Yes | No

    Default

    On first row: original Blaupunkt remote, volume up command.
    On second row : my remote, volume up command.
    Using same sensor (original Blaupunkt).
    Original-work; my-NO !!! I'm stuck, dissapointed, sad...
    Attached Images Attached Images  

  7. #7
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Could you attach the 2 wav/mp3 files? I'll open them in a sound editor at my end; couldnt quite see the whole pulse train.

    If this forum doesnt permit audio attachments, you could mail them to me at ardhuru_at_gmail.com.

    Also, some remotes send the same frame twice; does your Blaupunkt need that?

    Regards,

    Anand.

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