Sony IR Remote


Closed Thread
Results 1 to 40 of 41

Thread: Sony IR Remote

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    Albuquerque
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Timing

    I dont think the timing is off becuase I used a portion of the first code to make shure the range of numbers was correct.

    Code:
    start:
    if (pulse < 220) or (pulse > 260) then start
    high GPIO.2
    pause 100
    low GPIO.2
    goto start
    I think this was the code but I used 220 through 260 and the led would flash every time it detected the ACG pulse. So I dont think the values are incorrect. I just dont know how to excecute the program.
    I would really like to use this code below because I understand it, it's simple and I can do it all in software. If anyone can please tell me what is wrong with this code please let me know.
    Code:
    pulse  var Word
    x      var byte
    signal var word
    
    ANSEL = %00000000
    
    Start:
        Pulsin PORTC.3, 0, pulse
        if (pulse < 220) or (pulse > 260) then start
        
    signal = 0
    x = 1
    
    Loop:
        pulsin PORTC.3, 0, pulse
        if (pulse > 90) then ADD_X
        
        READ_IR:
        x = x * 2
        if (x = 255) then start
        
        serout PORTC.2, 2, [#signal]
        
        goto loop
        
    ADD_X:
        signal = signal + x
        goto read_ir
        
    end

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    One Sony decoder chip comin up..

    This should be easy to understand & modify for your PIC type. And you can easily change it to display buttons like channel-up, down, volume-up, down, etc..
    Code:
    DEFINE OSC 4
    IR_PULSE VAR BYTE(12) ' IR data received
    INDEX VAR BYTE        ' Index pointer
    DBYTE VAR BYTE        ' IR data received
     
    Main:
       PULSIN PORTC.3,0,IR_PULSE         '// Read-in start pulse
       IF (IR_PULSE < 200) OR (IR_PULSE = 0) THEN Main
     
    Verify:                              '// Read, Decode, then verify data
       FOR Index = 0 TO 11               '// Setup to read-in 12 pulses
        PULSIN PORTC.3,0,IR_PULSE[Index] '// Read 12 low-going pulses on RC.3
       NEXT Index                        '// Loop x times
     
       DBYTE = $7F                       '// Start with all 1's and find each 0
     
       FOR Index = 0 TO 6                '// Get 7 "data" bits
        IF IR_PULSE[Index] < 100 THEN DBYTE.0[Index]=0 '// Less than 1mS = 0
       NEXT Index
     
       DBYTE = DBYTE + 1                 '// Button code #1 = 0, Button #2 = 1, so add 1
                                         '// for actual button pressed for display
     
       HSEROUT ["Button pressed was ",#DBYTE,13,10]
       GOTO Main
     
       END
    This will print buttons #1 through #9. Buttons 0, channel, volume, etc will output the numeric values corresponding to buttons pressed.

    I know you don't care about the device codes like TV, VCR, etc, but it's easier to keep in-synch if you read these in anyway.
    Last edited by Bruce; - 15th May 2010 at 05:22.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Wow, Mr.Bruce, amazing job !!! I wonder if it's possible to create code (like this) for using with RC-10 infrared remote from Blaupunkt. I read something about remote with buttons here : http://dren.dk/lacetti-blaupunkt.html, but it' s more interesting to build one infrared remote. In the car that will make the difference ... I read all topics on this forum about IR, and Yours web pages too, but my level of knowledges it's (verry) low...so, if it's possible, every help it's wellcome.
    Attached Images Attached Images  

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