IR decode problem "hitachi TV remote"


Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    May 2005
    Posts
    70

    Default IR decode problem "hitachi TV remote"

    I have to try decode IR hitachi TV format but not work pls advise

    We used pulsin for measure pulse with.
    1. we measure head pulse and next pluse bit and keep it .
    2. bring pulse bit to decode "0" or "1"
    3. Prind data tp pc

    Problem :
    The decode pulse with not consitance not show all same time after we push in the same key on remote.

    Hitachi =32 bit ,see attached picture
    head +8800 -2200
    Bit "0" +550 -1650
    Bit "1" +550 -550




    Here is my code:

    'PIC 16F877

    DEFINE LOADER_USED 1
    DEFINE OSC 4

    DEFINE HSER_RCSTA 90h
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 12 ' 19200 Bauds

    Header Var Word ' Header pulse length
    Packet Var Word ' 16-bit IR information
    Packet1 Var Word ' 16-bit IR information
    P_Val Var Byte[32] ' Record pluse width
    IR_But Var Byte ' The BUTTON code returned
    IR_Dev Var Byte ' The DEVICE code returned
    Sony_LP Var Byte ' Temporary loop variable
    Green_LED Var Portb.3 ' Assign the red LED to this pin

    TRISA = 0
    LOW Green_LED

    START:

    GOSUB IRIN
    IF IR_But =255 THEN start 'HIGH Green_LED

    For Sony_Lp=0 to 23 ' Do 12-bits
    Pulsin PortB.0,0,P_Val[SONY_LP] ' Receive the IR bit pulse
    HSEROUT ["B ",DEC P_VAL[SONY_LP],13,10]
    NEXT
    HSEROUT ["Bottom ",DEC IR_But,13,10]
    HSEROUT ["Comand ",DEC IR_Dev,13,10]

    Packet =0
    Packet1 =1
    intcon.1=0
    GOTO START

    IRIN:
    IR_Dev=255:IR_But=255
    Pulsin PortB.0,0,Header ' Measure the header length.
    'HSEROUT ["H ",DEC Header,13,10]
    If Header < 792 then Return ' Verify a good header
    If Header > 968 then Return ' If not valid then exit

    For Sony_Lp=0 to 23 ' Do command 8-bits
    Pulsin PortB.0,1,P_Val[SONY_LP] ' Receive the IR bit pulse "0"

    NEXT

    For Sony_Lp=0 to 7 ' Do device 8-bits
    If P_Val[SONY_LP] >= 120 then ' If it's >= 120 then we've received a 1
    Packet.0[Sony_Lp] = 1 ' So set the appropriate bit of PACKET
    Else
    Packet.0[Sony_Lp] = 0
    Endif
    NEXT

    For Sony_Lp=17 to 24 ' Do 12-bits
    If P_Val[SONY_LP] >= 120 then ' If it's >= 120 then we've received a 1
    Packet1.0[Sony_Lp] = 1 ' So set the appropriate bit of PACKET1
    Else
    Packet1.0[Sony_Lp] = 0
    Endif
    NEXT

    ' Split the 7-bit BUTTON code, and the 5-bit DEVICE code

    'IR_But=Packet & %01111111 ' Mask the 7 BUTTON bits
    IR_But=Packet
    'IR_Dev=(Packet >>7) & %00011111 ' Move down and mask, the 5 DEVICE bits
    IR_dEV=Packet1

    Return
    Attached Images Attached Images  
    Last edited by chai98a; - 11th March 2006 at 20:25.

Similar Threads

  1. Ir problem sending data
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th December 2009, 05:27
  2. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 08:44
  3. PIC10F200 Automated IR Light Switch
    By Bruce in forum Code Examples
    Replies: 7
    Last Post: - 3rd May 2007, 11:40
  4. How to decode IR Hitachi remate (TV) pls help
    By chai98a in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th March 2006, 11:55
  5. Problem with comparing IR signal to Binary
    By zazery in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd April 2004, 03:38

Members who have read this thread : 0

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