NEC Protocol IR remote control decoder


+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: NEC Protocol IR remote control decoder82 days old

  1. #1
    Junior Member AngryGorilla's Avatar
    Join Date
    Nov 2018
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 9
    Total Downloaded
    569.76 MB

    0 Not allowed!

    Post NEC Protocol IR remote control decoder

    Hello!
    I would like to ask you to translate this arduino NEC decoder code into this basic?
    Code:
      // Arduino NEC Protocol IR remote control decoder
     
     
    // Include LCD library Code
    #include <LiquidCrystal.h>
     
    // LCD module connection (RS, E, D4, D5, D6, D7)
    LiquidCrystal lcd(3, 4, 5, 6, 7, 8);
     
    Char text[5];
    boolean nec_ok = 0;
    Byte  i, nec_state = 0, command, inv_command;
    unsigned int address;
    unsigned long nec_code;
     
    void setup() {
      // Set up the LCD's number of columns and rows
      lcd.begin(16, 2);
      lcd.setCursor(0, 0);
      lcd.Print("Address:0x0000");
      lcd.setCursor(0, 1);
      lcd.Print("Com:0x00 In:0x00");
      // Timer1 module configuration
      TCCR1A = 0;
      TCCR1B = 0;                                    // Disable Timer1 module
      TCNT1  = 0;                                    // Set Timer1 preload value to 0 (reset)
      TIMSK1 = 1;                                    // enable Timer1 overflow interrupt
      attachInterrupt(0, remote_read, CHANGE);       // Enable external interrupt (INT0)
    }
     
    void remote_read() {
    unsigned int timer_value;
      If(nec_state != 0){
        timer_value = TCNT1;                         // Store Timer1 value
        TCNT1 = 0;                                   // Reset Timer1
      }
      switch(nec_state){
       Case 0 :                                      // Start receiving IR data (we're at the beginning of 9ms pulse)
        TCNT1  = 0;                                  // Reset Timer1
        TCCR1B = 2;                                  // Enable Timer1 module with 1/8 prescaler ( 2 ticks every 1 us)
        nec_state = 1;                               // Next state: end of 9ms pulse (start of 4.5ms space)
        i = 0;
        Return;
       Case 1 :                                      // End of 9ms pulse
        If((timer_value > 19000) || (timer_value < 17000)){         // Invalid interval ==> Stop decoding And Reset
          nec_state = 0;                             // Reset decoding process
          TCCR1B = 0;                                // Disable Timer1 module
        }
        Else
          nec_state = 2;                             // Next state: end of 4.5ms space (start of 562s pulse)
        Return;
       Case 2 :                                      // End of 4.5ms space
        If((timer_value > 10000) || (timer_value < 8000)){
          nec_state = 0;                             // Reset decoding process
          TCCR1B = 0;                                // Disable Timer1 module
        }
        Else
          nec_state = 3;                             // Next state: end of 562s pulse (start of 562s or 1687s space)
        Return;
       Case 3 :                                      // End of 562s pulse
        If((timer_value > 1400) || (timer_value < 800)){           // Invalid interval ==> Stop decoding And Reset
          TCCR1B = 0;                                // Disable Timer1 module
          nec_state = 0;                             // Reset decoding process
        }
        Else
          nec_state = 4;                             // Next state: end of 562s or 1687s space
        Return;
       Case 4 :                                      // End of 562s Or 1687s space
        If((timer_value > 3600) || (timer_value < 800)){           // Time interval invalid ==> Stop decoding
          TCCR1B = 0;                                // Disable Timer1 module
          nec_state = 0;                             // Reset decoding process
          Return;
        }
        If( timer_value > 2000)                      // If space width > 1ms (short space)
          bitSet(nec_code, (31 - i));                // Write 1 to bit (31 - i)
        Else                                         // If space width < 1ms (long space)
          bitClear(nec_code, (31 - i));              // Write 0 to bit (31 - i)
        i++;
        If(i > 31){                                  // If all bits are received
          nec_ok = 1;                                // Decoding process OK
          detachInterrupt(0);                        // Disable external interrupt (INT0)
          Return;
        }
        nec_state = 3;                               // Next state: end of 562s pulse (start of 562s or 1687s space)
      }
    }
     
    Isr(TIMER1_OVF_vect) {                           // Timer1 Interrupt service routine (Isr)
      nec_state = 0;                                 // Reset decoding process
      TCCR1B = 0;                                    // Disable Timer1 module
    }
     
    void Loop() {
      If(nec_ok){                                    // If the mcu receives NEC message with successful
        nec_ok = 0;                                  // Reset decoding process
        nec_state = 0;
        TCCR1B = 0;                                  // Disable Timer1 module
        address = nec_code >> 16;
        command = nec_code >> 8;
        inv_command = nec_code;
        sprintf(text, "X", address);
        lcd.setCursor(10, 0);
        lcd.Print(text);                             // Display address in hex format
        sprintf(text, "X", command);
        lcd.setCursor(6, 1);
        lcd.Print(text);                             // Display command in hex format
        sprintf(text, "X", inv_command);
        lcd.setCursor(14, 1);
        lcd.Print(text);                             // Display inverted command in hex format
        attachInterrupt(0, remote_read, CHANGE);     // Enable external interrupt (INT0)
      }
    }

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member AngryGorilla's Avatar
    Join Date
    Nov 2018
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 9
    Total Downloaded
    569.76 MB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    PIC Microcontroller: PIC24EP128MC202

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    147
    Thumbs Up
    Received: 6
    Given: 3
    Total Downloaded
    329.46 MB

    1 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    I've done a small program to handle that protocol. It's using timer1 for the timing. My attempt was on a PIC12F675.
    In the attached file you will find the includes for three common protocol. NEC, SIR and RC5.
    IRcode.zip

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,513
    Thumbs Up
    Received: 318
    Given: 152
    Total Downloaded
    1.99 GB

    2 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    Nice firmware keytapper.

    You are asking something quite time consuming AngryGorilla because of two things:

    1. The Arduino code is far too complex and simply does not need to be. IMO, that is typical of C and C++ code.
    2. The C code is using peripheral timers for an AVR microcontroller, which are very different to set up and operate on the different microcontrollers.
    3. The values received from teh timers will vary with the speed of the microcontroller.

    The NEC Infra-Red protocol is very similar to the Sony SIRC protocol, so the code below should get you going in the right direction to create an NEC decoder, and keytapper's firmware should also help see what is required. The firmware below receives the Sony SIRC Button and Device values using the compiler's PulseIn command, so no peripheral timers are required, which means it can be transported to any PIC or PIC24 or dsPIC33 device:

    Code:
    '
    '   /\\\\\\\\\
    '  /\\\///////\\\
    '  \/\\\     \/\\\                                                 /\\\          /\\\
    '   \/\\\\\\\\\\\/        /\\\\\     /\\\\\\\\\\     /\\\\\\\\   /\\\\\\\\\\\  /\\\\\\\\\\\  /\\\\\\\\\
    '    \/\\\//////\\\      /\\\///\\\  \/\\\//////    /\\\/////\\\ \////\\\////  \////\\\////  \////////\\\
    '     \/\\\    \//\\\    /\\\  \//\\\ \/\\\\\\\\\\  /\\\\\\\\\\\     \/\\\         \/\\\        /\\\\\\\\\\
    '      \/\\\     \//\\\  \//\\\  /\\\  \////////\\\ \//\\///////      \/\\\ /\\     \/\\\ /\\   /\\\/////\\\
    '       \/\\\      \//\\\  \///\\\\\/    /\\\\\\\\\\  \//\\\\\\\\\\    \//\\\\\      \//\\\\\   \//\\\\\\\\/\\
    '        \///        \///     \/////     \//////////    \//////////      \/////        \/////     \////////\//
    '                                  Let's find out together what makes a PIC Tick!
    '
    ' Sony (SIRC) Infrared receiver
    ' Received SIRC information from a Sony InfraRed remote control and displays the results on a serial terminal
    ' Written by Les Johnson for teh Proton PIC BASIC compiler version 3.7.3.6 onwards.
    '
    
        Device = 16F819
        Declare Xtal = 4
    
        Declare Serial_Baud = 9600
        Declare Rsout_Pin = PORTB.6
        Declare Rsout_Mode = True
        Declare Rsout_Pace = 1
    
        Symbol IR_Sensor_Pin = PORTB.0              ' Assign the IR Sensor
    
        Dim IR_bButtonCode As Byte                  ' The Button code
        Dim IR_bDeviceCode As Byte                  ' The Device code
    
    '---------------------------------------------------------------------------------
    ' Receive an SIRC signal from a Sony remote control
    ' Input     : None
    ' Output    : The button value is returned in IR_bButtonCode
    '           : The device value is returned in IR_bDeviceCode
    '           : IR_bDeviceCode will return holding 255 if an invalid wHeader was received
    ' Notes     : None
    '
    Proc Get_SIRC()
        Dim wPulseLen As Word                       ' The bit length
        Dim wHeader   As Word                       ' Header pulse length
        Dim wPacket   As wHeader                    ' 12-bit IR information
        Dim bIndex    As Byte                       ' Loop variable
    
        Input IR_Sensor_Pin                         ' Make the IR sensor pin an input
        IR_bDeviceCode = 255
        IR_bButtonCode = 255
        If IR_Sensor_Pin = 0 Then ExitProc          ' Exit the procedure if we're already inside a Packet
        wHeader = PulseIn IR_Sensor_Pin, Low        ' Measure the Header
        If wHeader < 200 Then ExitProc              ' \ Exit the procedure if incorrect pulse times detected
        If wHeader > 270 Then ExitProc              ' /
        Clear bIndex
        Repeat                                      ' Implement a loop for the 12 bits
            wPulseLen = PulseIn IR_Sensor_Pin, Low
            Clear wPacket.11                        ' Default to a clear bit (zero-bit)
            If wPulseLen >= 90 Then                 ' Should we set the bit?
                Set wPacket.11                      ' Yes. So set the bit for a 1
            EndIf
            wPacket = wPacket >> 1                  ' Shift the bits right 1 place
            Inc bIndex                              ' Increment the loop counter
        Until bIndex = 11                           ' Close the loop after 12 bits
    '
    ' Split the 7-bit Button, and the 5-bit Device code
    '
        IR_bButtonCode = wPacket & 111111          ' Mask the Button code bits
        wPacket = wPacket << 1                        ' Move bit 7 into bit 8
        IR_bDeviceCode = wPacket.Highbyte & 011111 ' Mask the Device code bits
    EndProc
    
    '---------------------------------------------------------------------------------
    ' The main program starts here
    '
    Main:
    
        Do                                                      ' Create an infinite loop
            Get_SIRC()                                          ' Receive an IR signal
            If IR_bDeviceCode <> 255 Then                       ' Was the wHeader valid?
                Rsout "Device Code = ", Dec IR_bDeviceCode, 13,_ ' Yes. So display the result
                      "Button Code = ", Dec IR_bButtonCode, 13, 13
            EndIf
        Loop                                                    ' Do it forever
    The only thing that will need changing for differenet devices is the values returned from the PulseIn command will be different values for different oscillators used to drive the microcontroller. The NEC uses a very similar mechanism, but has more bits and uses different pulse lengths.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    9
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    2.90 GB

    1 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    NEC ir protocol

    Device 16F628A ' ; Config HS_OSC,WDT_OFF,PWRTE_ON,BODEN_OFF,LVP_OFF,CP_OFF
    Config INTRC_OSC_NOCLKOUT,PWRTE_ON,WDT_OFF ,MCLRE_OFF,BODEN_ON,LVP_OFF , PWRTE_ON,CP_ON
    Declare Xtal = 4
    Declare Reminders OFF
    Declare Reminders On
    Declare Pulsin_Maximum 1000 'gelen 0 palsini max 10 ms bekle
    TRISA=010000
    TRISB=000000
    PORTB=0:PORTA=0
    Symbol led=PORTA.2
    Symbol PULS=PORTA.4
    ' Declare LCD_DTPin PORTB.4
    ' Declare LCD_RSPin PORTB.3
    ' Declare LCD_ENPin PORTB.0
    ' Declare LCD_Interface 4
    ' Declare LCD_Lines 2
    ;Symbol INTEDG = OPTION_REG.6 ' External Interrupt Edge selection
    ' Symbol INTF = INTCON.1 'RB0 KESME BARAĞI
    'Symbol INTE = INTCON.4 'RB0 KESME YETKG
    'Symbol GIE = INTCON.7 'GLOBAL INT. YETKI
    ; OPTION_REG=000000 'dahili Pull up direnleri aktif edildi ayrıca pullup direncine gerek yok.
    ;INTCON=010000 'Kesmeler aktif ve RB0/INT kesmesi aktif
    Dim Leader As Word ' 900 9mS puls
    Dim BtnVal[32] As Word ' 32 pulse tut
    Dim DByte1 As Byte ' adres byte
    Dim DByte2 As Byte ' inverse of address byte
    Dim puls3 As Byte ' komut byte
    Dim DByte4 As Byte ' ters command byte
    Dim i As Byte ' loop counter
    Dim x As Byte
    Dim n As Byte
    Dim m As Bit
    Dim TEMP As Byte
    Dim TUSSAY As Byte
    Dim SAY As Byte
    Dim SAYI As Byte
    Dim HANE1 As Byte
    Dim HANE2 As Byte
    Dim HANE3 As Word
    Dim YENI As Bit
    Dim IKINCI As Bit
    Dim TUSTOP As Word
    Dim READKEY As Byte
    Dim KEY As Word
    Dim portAdeger As Byte
    Dim portBdeger As Byte
    Dim HANE As Byte
    Dim PinNumber As Byte
    Dim pin As Byte
    Dim Var1 As Byte
    Dim SIRA As Byte
    Dim z As Byte
    PORTA=0:PORTB=0
    led=0
    x=0
    Clear
    DelayMS 1000
    HANE=0

    Main:

    SAY=say+1
    led=1
    If SAY>=230 And TUSTOP<=9 And YENI=1 Then
    GoSub TS
    EndIf
    PulseIn PULS,0,Leader ' wait ~9mS low-pulse
    If Leader < 850 Then GoTo Main ; 850 4mhz, 4400 20mhz
    For i = 0 To 31 ' 32 pulse
    PulseIn PULS,1,BtnVal[i] ' high- pulse measure
    If BtnVal[i]<40 Or BtnVal[i] > 415 Then
    ; break
    led=0
    DelayMS 5
    GoTo Main
    EndIf
    Next i
    For i = 0 To 7
    If BtnVal[i] > 150 Then ;350
    SetBit READKEY,i-16;puls3,i-16 ' ......DByte3.0[i-16]=1
    Else
    ClearBit READKEY,i-16;puls3,i-16 '........DByte3.0[i-16]=0
    EndIf
    DelayMS 1
    Next i
    For i = 16 To 23
    led=0
    If BtnVal[i] > 150 Then
    SetBit READKEY,i-16;puls3,i-16 ' ......DByte3.0[i-16]=1
    Else
    ClearBit READKEY,i-16;puls3,i-16 '........DByte3.0[i-16]=0
    EndIf
    DelayMS 10
    led=1
    Next i

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    147
    Thumbs Up
    Received: 6
    Given: 3
    Total Downloaded
    329.46 MB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    The firmware below receives the Sony SIRC Button and Device values using the compiler's PulseIn command, so no peripheral timers are required, which means it can be transported to any PIC or PIC24 or dsPIC33 device:
    8<-----8<-----8<-----8<-----8<-----
    @ Les
    I'm aware of your implementation, but I was rather attracted to use a timer. Since Timer0 doesn't fit with only its 8bit counting, I preferred to use timer1.
    It's clear that your design will keep free the timers and it spans for many MCU, but that it may be disrupted from other interrupts which may be used in a program. So it's just a pondering to what one wants to go for.
    BTW, the code is similar for SIR and NEC, just they use a different timing and bit frame.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Junior Member AngryGorilla's Avatar
    Join Date
    Nov 2018
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 9
    Total Downloaded
    569.76 MB

    0 Not allowed!

    Lightbulb Re: NEC Protocol IR remote control decoder

    Finaly My NEC protocol IR remote control decoder

    Basic code: IR.bas
    Code:
    '****************************************************************
    '*  Name    : NEC protocol IR remote control decoder            *
    '*  Author  : AngryGorilla                                      *
    '*  Notice  : Copyright (c) 2020 PDS 3.7.3.6//1.0.6.7           *
    '*          : All Rights Reserved                               *
    '*  Date    : 2020. 01. 18.                                     *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    
        Device = 24EP128MC202
        Declare Xtal = 140.03
                
        Declare HSCL_Pin = PORTB.8                        ' SCL connected to this pin
        Declare HSDA_Pin = PORTB.9                        ' SDA connected to this pin
        Declare Hbus_Bitrate = 1000                       ' I2C bus bitrate (in KHz)
    
        Include "Hbus.inc"                                ' Load the Hbusin, Hbusout replacement routines into the program
        Include "ADin.inc"                                ' Load the ADin replacement routines into the program (optional)
        Include "Timer1_24.inc"                           ' Load the Timer1 PIC24 replacement routines into the program (optional)
        Include "ssd1306.inc"                             ' Load SSD1306 I2C Driver
        
        PLL_Setup(76, 2, 2, $0300)                        ' Configure the Oscillator to operate the device at 140.03MHz
        
    'Define Inpt ports    
        TRISA.0 = 1
        TRISA.1 = 1
        ANSELA.0 = 1
        ANSELA.1 = 1
        TRISB.7 = 1
        
    'Define Output ports
        TRISB.14 = 0
        TRISB.15 = 0
        TRISB.5 = 0
        TRISB.8 = 0
        TRISB.9 = 0
        
        Symbol IR_Sensor PORTB.7
        Symbol H_TO_L = 0
        Symbol L_TO_H = 1
        Symbol TRUE = 1
        Symbol FALSE = 0
            
    'Config IMR1 Interrupt (1us)
        Symbol T1IE IEC0bits_T1IE 
        Symbol T1IF IFS0bits_T1IF
        T1CON = 0x8000                                  ' Prescaler 1:1
        PR1 = 70                                        ' Period Register 1
        IPC0 = IPC0 | 0x1000                            ' Priority 13
        TMR1 = 0                                        ' Reset Timer1 value
        T1IE = FALSE                                    ' Disable Timer1 interrupt  
    
    'Config INT0 Interrupt
        Symbol GIE = INTCON2bits_GIE                    ' Global Interrupt Enable bit / 1 = Interrupts and associated IE bits are enabled / 0 = Interrupts are disabled, but traps are still enabled
        Symbol DISB = INTCON2bits_DISI                  ' DISI Instruction Status bit / 1 = DISI instruction is active / 0 = DISI instruction is not active
        Symbol SWTRAP = INTCON2bits_SWTRAP              ' Software Trap Status bit
        Symbol INT0EP = INTCON2bits_INT0EP              ' External Interrupt 0 Edge Detect Polarity Select bit / 1 = Interrupt on negative edge / 0 = Interrupt on positive edge
        Symbol INT0IF = IFS0bits_INT0IF                 ' External Interrupt 0 Flag 
        Symbol INT0IE = IEC0bits_INT0IE                 ' External Interrupt 0 Enable - Disable / 1 = Interrupt Enable / 0 = Interrupt Disable
        IPC0 = IPC0 | 0x0001                            ' Priority 1
        DISB = FALSE                                    ' Disi instruction is not active
        SWTRAP = FALSE                                  ' Software Trap STATUS Bit
        
        Dim b As Byte = 0 
        Dim nec_ok As Bit = 0
        Dim nec_state As Byte = 0
        Dim nec_code As Dword = 0
        Dim command As Word = 0
        Dim address As Word = 0
        Dim last_command As Word = 0
        Dim last_address As Word = 0
        Dim time As Word = 0
        Dim TMR1CNT As Word = 0
        Dim hold_button As Byte = 0
        Dim EXT_INT_CHECK As Bit = 0
        
        Dim volume As Byte = 12
        Dim channel As Byte = 20
        Dim CH_VOL As Bit = 0
        Dim x As Byte = 0
    
    GoTo start
    
    Isr INT0Interrupt
        EXT_INT_CHECK = TRUE
        If nec_state = 1 Or nec_state = 2 Or nec_state = 3 Or nec_state = 4 Then
            time = TMR1CNT                               ' Store TMR1CNT value
            TMR1 = 0                                     ' Reset Timer1 value
            TMR1CNT = 0                                  ' Reset TMR1CNT value
            Clear INT0IF                                 ' Clear INT0 interrupt flag bit
        EndIf
    
        Select nec_state
            Case 0                                       ' Start receiving IR data (we're at the beginning of 9ms pulse)
                b = 0                                    ' Reset Bit Counter Value
                TMR1 = 0                                 ' Reset Timer1 value
                TMR1CNT = 0                              ' Reset TMR1CNT value
                T1IE = TRUE                              ' Enable Timer1 Interrupt 
                nec_state = 1                            ' Next state: end of 9ms pulse (start of 4.5ms space)
                INT0EP = H_TO_L                          ' Toggle external interrupt edge
                Clear INT0IF                             ' Clear INT0 interrupt flag bit
            Case 1                                       ' End of 9ms pulse                                   
                If time > 9500 Or time < 8500 Then       ' Invalid interval ==> stop decoding and reset
                    nec_state = 0                        ' Reset decoding process
                    T1IE = FALSE                         ' Stop Timer1 module
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                    Clear INT0IF                         ' Clear INT0 interrupt flag bit
                Else
                    nec_state = 2                        ' Next state: end of 4.5ms space (start of 562s pulse)
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                EndIf 
            Case 2                                       ' End of 4.5ms space                     
                If time > 5000 Or time < 4000 Then       ' Invalid interval ==> stop decoding and reset
                    Inc hold_button                      ' Repeat counter
                    nec_state = 0                        ' Reset decoding process
                    T1IE = FALSE                         ' Stop Timer1 module
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                    Clear INT0IF                         ' Clear INT0 interrupt flag bit       
                Else
                    nec_state = 3                        ' Next state: end of 562s pulse (start of 562s or 1687s space)
                    INT0EP = H_TO_L                      ' Toggle external interrupt edge
                EndIf
            Case 3                                       ' End of 562s pulse
                If time > 700 Or time < 400 Then         ' Invalid interval ==> stop decoding and reset
                    nec_state = 0                        ' Reset decoding process
                    T1IE = FALSE                         ' Stop Timer1 module
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                    Clear INT0IF                         ' Clear INT0 interrupt flag bit
                Else
                    nec_state = 4                        ' Next state: end of 562s or 1687s space
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                EndIf
            Case 4                                       ' End of 562s Or 1687s space                                 
                If time > 1800 Or time < 400 Then        ' Invalid interval ==> stop decoding and reset
                    nec_state = 0                        ' Reset decoding process
                    T1IE = FALSE                         ' Stop Timer1 module
                    INT0EP = L_TO_H                      ' Toggle external interrupt edge
                    Clear INT0IF                         ' Clear INT0 interrupt flag bit
                EndIf
                If time > 1000 Then                      ' If space width > 1ms (short space)
                    SetBit nec_code, b                   ' Write 1 to bit (0 - 32)
                Else                                     ' If space width < 1ms (long space)
                    ClearBit nec_code, b                 ' Write 0 to bit (0 - 32)
                EndIf
                Inc b                                    ' Loop 32 bits are received 
                If b > 31 Then                           ' If all bits are received
                    hold_button = 0                      ' Reset repeat counter
                    nec_ok = 1                           ' Decoding process OK
                    INT0IE = FALSE                       ' Disable the external interrupt
                    T1IE = FALSE                         ' Disable Timer1 module
                EndIf
                nec_state = 3                            ' Next state: end of 562s pulse (start of 562s or 1687s space)
                INT0EP = H_TO_L                          ' Toggle external interrupt edge
        EndSelect
       
    EndIsr
    
    Isr T1Interrupt                                      ' Timer1 Interrupt (used For time out)
        EXT_INT_CHECK = TRUE                             ' Inerrupt flag check
        Inc TMR1CNT                                      ' TMR1CNT counter (one step 1us)
        Clear T1IF                                       ' Clear Timer1 interrupt flag bit
    EndIsr
    
    start:    
        OLED_Init()
        
        Text = "NEC Protocol IR Decoder"
        PrintText(0,0)
        Text = "Address : 0x0000"
        PrintText(2,0)
        Text = "Command : 0x0000"
        PrintText(4,0)
        Text = "Button :  ----"
        PrintText(6,0)
    
        GIE = TRUE                                       ' Enable global interrupts
        INT0EP = L_TO_H                                  ' Toggle external interrupt edge
        Clear INT0IF                                     ' Clear INT0 interrupt flag bit
        Clear T1IF                                       ' Clear Timer1 interrupt flag bit
        INT0IE = TRUE                                    ' Enable external interrupt
    
    main:
        
        If nec_ok = 1 Then                               ' If the mcu successfully receives NEC protocol message
            nec_ok = 0;                                  ' Reset decoding process
            nec_state = 0;
            
            address.HighByte = nec_code.Byte0
            address.LowByte = nec_code.Byte1        
            command.HighByte = nec_code.Byte2
            command.LowByte = nec_code.Byte3
            
            StrN Text = Str$(Hex4 address)
            PrintText(2,64)
            
            StrN Text = Str$(Hex4 command)
            PrintText(4,64)
            
            last_address = address                        ' Store last decoded remote
            last_command = command                        ' Store last decoded remote key
            
            INT0EP = L_TO_H                               ' Toggle external interrupt edge
            Clear INT0IF                                  ' Clear INT0 interrupt flag bit
            INT0IE = TRUE                                 ' Enable external Interrupt      
        Else
            EXT_INT_CHECK = FALSE
        EndIf
        
        buttons()
    
    GoTo main
    
    Proc buttons()
      If address = $01FD Then
            CH_VOL = 0    
            Select command
                Case $CA35
                    CH_VOL = 1
                    up_channel()
                Case $D22D
                    CH_VOL = 1
                    down_channel()
                Case $C13E
                    CH_VOL = 1
                    up_volume()
                Case $9966
                    CH_VOL = 1
                    down_volume()
                Case $DC23
                    Text="POWER OFF             "
                Case $9C63
                    Text="MUTE                  "
                Case $926D
                    Text="1                     "                
                Case $936C
                    Text="2                     "                
                Case $CC33
                    Text="3                     "                
                Case $8E71
                    Text="4                     "                
                Case $8F70
                    Text="5                     "                
                Case $C837
                    Text="6                     "                
                Case $8A75
                    Text="7                     "                
                Case $8B74
                    Text="8                     "                
                Case $C43B
                    Text="9                     "                
                Case $8778
                    Text="0                     "                
                Case $D926
                    Text="TV/RADIO              "                
                Case $827D
                    Text="<-PR                  "                
                Case $CE31
                    Text="OK / LIST             "
                Case $956A
                    Text="MENU                  "                
                Case $C53A
                    Text="EXIT                  "                
                Case $D629
                    Text="EPG                   "                
                Case $D02F
                    Text="INFO                  "                 
                Case $9669
                    Text="FIND                  "                
                Case $C33C
                    Text="TXT                   "                
                Case $DD22
                    Text="PAGE +                "                
                Case $8C73
                    Text="PAGE -                "                
                Case $C738
                    Text="PAUSE                 "                
                Case $C23D
                    Text="V-FORMAT              "                
                Case $847B
                    Text="L/R                   "                
                Case $CD32                     
                    Text="SLEEP                 "                
                Case $8877
                    Text="FAV                   "                
                Case $9A65
                    Text="ZOOM                  "                
                Case $DA25
                    Text="#                     "                
                Case $807F
                    Text="RECORD                "
                Case $D827
                    Text="PLAY                  "                
                Case $D42B
                    Text="STOP                  "                
                Case $D12E
                    Text="SHIFT                 "                
                Case $C639
                    Text="FAST <<               "                
                Case $D52A                    
                    Text="FAST >>               "                
                Case $8679
                    Text="SLOW <                "                
                Case $906F
                    Text="SLOW >                "                                          
                Case Else    
                    Text="                      "
                EndSelect
             address = 0
             If CH_VOL = 0 Then PrintText(6,48)
        EndIf
    
        If hold_button > 2 And last_address = $01FD Then
            If last_command = $CA35 Then up_channel()
            If last_command = $D22D Then down_channel()
            If last_command = $C13E Then up_volume()
            If last_command = $9966 Then down_volume()
            hold_button = 2
        EndIf
    EndProc    
    
    Proc up_channel()
        x = 100
        Inc channel
        Text="PR +        "
        PrintText(6,48)
        If channel < 10 Then Text = "   " : PrintText(6,100) : x = 112
        If channel > 9 And channel < 100 Then Text = "  " : PrintText(6,100) : x = 106 
        StrN Text = Str$(Dec channel)
        PrintText(6,x)    
    EndProc
    
    Proc down_channel()
        x = 100
        Dec channel
        Text="PR -        "
        PrintText(6,48)
        If channel < 10 Then Text = "   " : PrintText(6,100) : x = 112
        If channel > 9 And channel < 100 Then Text = "  " : PrintText(6,100) : x = 106 
        StrN Text = Str$(Dec channel)
        PrintText(6,x) 
    EndProc
    
    Proc up_volume()
        x = 100
        Inc volume : If volume > 100 Then volume = 100
        Text="VOLUME +"
        PrintText(6,48)
        If volume < 10 Then Text = "   " : PrintText(6,100) : x = 112
        If volume > 9 And volume < 100 Then Text = "  " : PrintText(6,100) : x = 106 
        StrN Text = Str$(Dec volume)
        PrintText(6,x)  
    EndProc
    
    Proc down_volume()
        x = 100
        Dec volume : If volume = 255 Then volume = 0
        Text="VOLUME -" 
        PrintText(6,48)
        If volume < 10 Then Text = "   " : PrintText(6,100) : x = 112
        If volume > 9 And volume < 100 Then Text = "  " : PrintText(6,100) : x = 106  
         
        StrN Text = Str$(Dec volume)
        PrintText(6,x)  
    EndProc
    
    End
    '-------------------------------------------------------------------------------------------------------------
    ' Configure for internal 7.37MHz oscillator with PLL
    ' OSC pins are general purpose I/O
    '
        Config FGS = GWRP_OFF
        Config FOSCSEL = FNOSC_FRCPLL, IESO_ON
        Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSECME
        Config FWDT = WDTPOST_PS256, WINDIS_OFF, PLLKEN_ON, FWDTEN_OFF
        Config FPOR = ALTI2C1_ON, ALTI2C2_OFF
        Config FICD = ICS_PGD1, JTAGEN_OFF
    SSD1306 Include code: ssd1306.inc
    Code:
    $ifndef _SSD1306_INC_
    $define _SSD1306_INC_
    
    Symbol SSD1306 $78
    
    Dim OLED_X As Byte=0
    Dim OLED_Y As Byte=0
    Dim OLED_X_ As Byte=0
    Dim OLED_Y_ As Byte=0
    
    Dim Text As String * 25
    Dim Pages As Byte 
    Dim Column As Byte
    Dim Width As Byte
    Dim Height As Byte
    Dim Min As Byte
    Dim Max As Byte
    
    Dim i As Byte
    Dim a As Byte
    Dim j As Word
    Dim k As Byte
    Dim l As Word
    Dim m[5] As Byte
    
    Dim XSeg As Byte
    Dim YPage As Byte
    Dim Index As Byte=0
    
    Dim CharByte[25] As Byte
    Dim Character As Word
    
    Dim Length As Byte
    Dim Empty As Byte=0
    
    Include "Font_proton_hun.inc"
    
    ;===================================================================== 
    ;===================================================================== 
    Proc Position(P1 As Byte, P2 As Byte)
            HBusOut SSD1306, [$80, $20, $80, $00]
            HBusOut SSD1306, [$80, $21, $80, P2, $80, 127]
            HBusOut SSD1306, [$80, $22, $80, P1, $80, 7]
    EndProc
    ;=====================================================================
    ;==================================================================== 
    Proc OLED_CLS() 
            For OLED_Y=0 To 7
            Position(OLED_Y, 0) 
            HBusOut $78,[$40,$00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00,_
                             $00,$00,$00,$00,$00,$00,$00,$00]
            Next
    EndProc
    ;==================================================================== 
    ;====================================================================
    
    Proc OLED_Init()
            DelayMS 400
            HBStart
            HBusOut SSD1306, [$80, $FD, $80, $12] ; -Unlock all command
            HBusOut SSD1306, [$80, $AE]           ; -Display Off
            HBusOut SSD1306, [$80, $D5, $80, $F0] ; -Display Clock $A0 ($70 default)
            HBusOut SSD1306, [$80, $A8, $80, $3F] ; -Multiplex Ratio $3F
            HBusOut SSD1306, [$80, $D3, $80, $00] ; -Display Offset 
            HBusOut SSD1306, [$80, $40]           ; -Display Start Line
            HBusOut SSD1306, [$80, $8D, $80, $14] ; -[2] charge pump setting (p62): 0x014 Enable, 0x010 Disable, SSD1306 only, should be removed For SH1106 */
            HBusOut SSD1306, [$80, $20, $80, $00] ; -Memory Addressing Mode
            HBusOut SSD1306, [$80, $A1]           ; -Segment Remap              $A1 $A0
            HBusOut SSD1306, [$80, $C8]           ; -COM Output Scan Direction  $C8 $C0 
            HBusOut SSD1306, [$80, $DA, $80, $12] ; -Common_HW_Config 
            HBusOut SSD1306, [$80, $81, $80, $CF] ; -Contrast_Control 7F Default
            HBusOut SSD1306, [$80, $D9, $80, $F1] ; -Pre_charge_Period $82 $D3 ($22 default)
            HBusOut SSD1306, [$80, $DB, $80, $40] ; -VCOMH_Level $00 $34 $40 $3C 
            HBusOut SSD1306, [$80, $A4]           ; -Entire_Display
            HBusOut SSD1306, [$80, $A6]           ; -Non_Inverted_Display $A6, Inverted $A7
            HBusOut SSD1306, [$80, $2E]           ; -Deactivate Scroll
            DelayMS 40
            HBusOut SSD1306, [$80, $AF]           ; -Display On
            OLED_CLS()
            HBStop
    EndProc
    ;==================================================================== 
    ;====================================================================
    Proc PrintText(Pages As Byte, Column As Byte)  ; P1 = Y ( 0 to 7 ) and  P2 = X ( 0 to 127 ) and P3 = BMP Label          
            Empty=0
            Index = 0
            Length = Len Text
            
            Width = 6
            Height = 8 / 8
            Min = 32
            Max = 255
            
            XSeg = Column
            YPage = Pages
            j = Text[0] - Min
            If j=193 Then j=96  '
            If j=201 Then j=97  '
            If j=205 Then j=98  '
            If j=211 Then j=99  '
            If j=213 Then j=100  'ő
            If j=214 Then j=101  '
            If j=218 Then j=102  '
            If j=219 Then j=103  'ű
            If j=220 Then j=104  '
            l = j * (Width * Height)
            
            HBStart
            Position(Pages,Column)         
            For a = 0 To Length -1
                For k = 0 To Width -1         
                    For i = 0 To Height -1
                            HBusOut SSD1306, [$80, $21, $80, XSeg, $80, 127] 
                            HBusOut SSD1306, [$80, $22, $80, YPage, $80, 7]
                            CharByte[i] = CRead font_proton_hun + i + l + k
                            HBusOut $78,[$40,CharByte[i]]
                        Inc YPage
                            If k>1 Then
                             If CharByte[i] = 0 Then Inc Empty
                            EndIf
                        Next
                Inc XSeg
                If XSeg = 128 Then Empty=0: HBStop : Return
                YPage = Pages 
                Next
            Inc Index
            XSeg=XSeg-(empty-1)
            Empty=0
            j = Text[Index] - Min
            If j=193 Then j=96  '
            If j=201 Then j=97  '
            If j=205 Then j=98  '
            If j=211 Then j=99  '
            If j=213 Then j=100  'ő
            If j=214 Then j=101  '
            If j=218 Then j=102  '
            If j=219 Then j=103  'ű
            If j=220 Then j=104  '
            l = j * (Width * Height)
            Next 
            HBStop 
    EndProc
        
    $endif  ' _SSD1306_INC_
    Font Include code : Font_proton_hun.inc
    Code:
    ;Font Proton Default.
    ;Size 6x8
    font_proton_hun:-
    CData $00,$00,$00,$00,$00,$00,_      '32 -   - 20        
          $00,$00,$4F,$00,$00,$00,_      '33 - ! - 21
          $00,$07,$00,$07,$00,$00,_      '34 - " - 22
          $14,$7F,$14,$7F,$14,$00,_      '35 - # - 23
          $24,$2A,$7F,$2A,$12,$00,_      '36 - $ - 24
          $23,$13,$08,$64,$62,$00,_      '37 - % - 25
          $36,$49,$55,$22,$50,$00,_      '38 - & - 26
          $00,$05,$03,$00,$00,$00,_      '39 - ' - 27
          $1C,$22,$41,$00,$00,$00,_      '40 - ( - 28
          $00,$00,$41,$22,$1C,$00,_      '41 - ) - 29
          $14,$08,$3E,$08,$14,$00,_      '42 - * - 2A
          $08,$08,$3E,$08,$08,$00,_      '43 - + - 2B
          $00,$50,$30,$00,$00,$00,_      '44 - , - 2C
          $08,$08,$08,$08,$08,$00,_      '45 - - - 2D
          $00,$60,$60,$00,$00,$00,_      '46 - . - 2E
          $20,$10,$08,$04,$02,$00,_      '47 - / - 2F
          $3E,$51,$49,$45,$3E,$00,_      '48 - 0 - 30
          $00,$42,$7F,$40,$00,$00,_      '49 - 1 - 31
          $42,$61,$51,$49,$46,$00,_      '50 - 2 - 32
          $21,$41,$45,$4B,$31,$00,_      '51 - 3 - 33
          $18,$14,$12,$7F,$10,$00,_      '52 - 4 - 34
          $27,$45,$45,$45,$39,$00,_      '53 - 5 - 35
          $3C,$4A,$49,$49,$30,$00,_      '54 - 6 - 36
          $01,$71,$09,$05,$03,$00,_      '55 - 7 - 37
          $36,$49,$49,$49,$36,$00,_      '56 - 8 - 38
          $06,$49,$49,$49,$3E,$00,_      '57 - 9 - 39
          $00,$36,$36,$00,$00,$00,_      '58 - : - 3A
          $00,$56,$36,$00,$00,$00,_      '59 - ; - 3B
          $08,$14,$22,$41,$00,$00,_      '60 - < - 3C
          $14,$14,$14,$14,$14,$00,_      '61 - = - 3D
          $00,$41,$22,$14,$08,$00,_      '62 - > - 3E
          $02,$01,$51,$09,$06,$00,_      '63 - ? - 3F
          $32,$49,$79,$41,$3E,$00,_      '64 - @ - 40
          $7E,$11,$11,$11,$7E,$00,_      '65 - A - 41
          $7F,$49,$49,$49,$36,$00,_      '66 - B - 42
          $3E,$41,$41,$41,$22,$00,_      '67 - C - 43
          $7F,$41,$41,$22,$1C,$00,_      '68 - D - 44
          $7F,$49,$49,$49,$41,$00,_      '69 - E - 45
          $7F,$09,$09,$09,$01,$00,_      '70 - F - 46
          $3E,$41,$49,$49,$7A,$00,_      '71 - G - 47
          $7F,$08,$08,$08,$7F,$00,_      '72 - H - 48
          $41,$7F,$41,$00,$00,$00,_      '73 - I - 49
          $20,$40,$41,$3F,$01,$00,_      '74 - J - 4A
          $7F,$08,$14,$22,$41,$00,_      '75 - K - 4B
          $7F,$40,$40,$40,$40,$00,_      '76 - L - 4C
          $7F,$02,$0C,$02,$7F,$00,_      '77 - M - 4D
          $7F,$04,$08,$10,$7F,$00,_      '78 - N - 4E
          $3E,$41,$41,$41,$3E,$00,_      '79 - O - 4F
          $7F,$09,$09,$09,$06,$00,_      '80 - P - 50
          $3E,$41,$51,$21,$5E,$00,_      '81 - Q - 51
          $7F,$09,$19,$29,$46,$00,_      '82 - R - 52
          $46,$49,$49,$49,$31,$00,_      '83 - S - 53
          $01,$01,$7F,$01,$01,$00,_      '84 - T - 54
          $3F,$40,$40,$40,$3F,$00,_      '85 - U - 55
          $1F,$20,$40,$20,$1F,$00,_      '86 - V - 56
          $3F,$40,$38,$40,$3F,$00,_      '87 - W - 57
          $63,$14,$08,$14,$63,$00,_      '88 - X - 58
          $07,$08,$70,$08,$07,$00,_      '89 - Y - 59
          $61,$51,$49,$45,$43,$00,_      '90 - Z - 5A
          $7F,$41,$41,$00,$00,$00,_      '91 - [ - 5B
          $02,$04,$08,$10,$20,$00,_      '92 - \ - 5C
          $00,$00,$41,$41,$7F,$00,_      '93 - ] - 5D
          $04,$02,$01,$02,$04,$00,_      '94 - ^ - 5E
          $40,$40,$40,$40,$40,$00,_      '95 - _ - 5F
          $00,$01,$02,$04,$00,$00,_      '96 - ` - 60
          $20,$54,$54,$54,$78,$00,_      '97 - a - 61
          $7F,$48,$44,$44,$38,$00,_      '98 - b - 62
          $38,$44,$44,$44,$20,$00,_      '99 - c - 63
          $38,$44,$44,$48,$7F,$00,_      '100  d - 64
          $38,$54,$54,$54,$18,$00,_      '101  e - 65
          $08,$7E,$09,$01,$02,$00,_      '102  f - 66
          $0C,$52,$52,$52,$3E,$00,_      '103  g - 67
          $7F,$08,$04,$04,$78,$00,_      '104  h - 68
          $44,$7D,$40,$00,$00,$00,_      '105  i - 69
          $00,$20,$40,$44,$3D,$00,_      '106  j - 6A
          $7F,$10,$28,$44,$00,$00,_      '107  k - 6B
          $00,$41,$7F,$40,$00,$00,_      '108  l - 6C
          $7C,$04,$18,$04,$78,$00,_      '109  m - 6D
          $7C,$08,$04,$04,$78,$00,_      '110  n - 6E
          $38,$44,$44,$44,$38,$00,_      '111  o - 6F
          $7C,$14,$14,$14,$08,$00,_      '112  p - 70
          $08,$14,$14,$18,$7C,$00,_      '113  q - 71
          $7C,$08,$04,$04,$08,$00,_      '114  r - 72
          $48,$54,$54,$54,$20,$00,_      '115  s - 73
          $04,$3F,$44,$40,$20,$00,_      '116  t - 74
          $3C,$40,$40,$20,$7C,$00,_      '117  u - 75
          $1C,$20,$40,$20,$1C,$00,_      '118  v - 76
          $3C,$40,$30,$40,$3C,$00,_      '119  w - 77
          $44,$28,$10,$28,$44,$00,_      '120  x - 78
          $0C,$50,$50,$50,$3C,$00,_      '121  y - 79
          $44,$64,$54,$4C,$44,$00,_      '122  z - 7A
          $08,$36,$41,$00,$00,$00,_      '123  { - 7B
          $00,$00,$7F,$00,$00,$00,_      '124  | - 7C
          $00,$00,$41,$36,$08,$00,_      '125  } - 7D
          $00,$08,$04,$08,$04,$00,_      '126  ~ - 7E
          $3E,$2A,$36,$2A,$3E,$00,_      '127   - 7F
          $20,$54,$56,$55,$78,$00,_      '225   - E1 -128
          $38,$54,$56,$55,$18,$00,_      '233   - E9 -129
          $00,$48,$7A,$41,$00,$00,_      '237   - ED -130
          $30,$48,$4A,$49,$30,$00,_      '243   - F3 -131
          $30,$4A,$49,$4A,$31,$00,_      '245  ő - F5 -132
          $38,$45,$44,$45,$38,$00,_      '246   - F6 -133
          $3C,$40,$42,$21,$7C,$00,_      '250   - FA -134
          $38,$42,$41,$22,$79,$00,_      '251  ű - FB -135
          $3C,$41,$40,$21,$7C,$00        '252   - FC -136

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    Junior Member AngryGorilla's Avatar
    Join Date
    Nov 2018
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 9
    Total Downloaded
    569.76 MB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder


  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,858
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    1 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    Nicely done AG.
    John

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,513
    Thumbs Up
    Received: 318
    Given: 152
    Total Downloaded
    1.99 GB

    1 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    A beautiful piece of code AngryGorilla that makes me proud to have created the compilers. :-)

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #11
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    1 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    If I may say that we are also proud of you Les!

    The compiler is a fantastic piece of work of which you should indeed be very proud.

    AngryGorilla's code is well structured, indented to show levels, well commented and easily understood. The two go well together.

    Charlie

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #12
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,513
    Thumbs Up
    Received: 318
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    Many thanks for your lovely words Charlie.

    When we move back down to North Norfolk, hopefully within the year, it would be great to meet up with you and some of the other forum friends down in that area. I know John is going to come and see me, which I am looking forward too, so other friends from the forum are more than welcome.

    We hate it up here in the North East, even though it is where I was born and raised, but we miss the the Norfolk region so much because we lived they for 15 years. Also... I came up here for phycological support from my family and kids after my injury, but we haven't seen or heard from any of the family in about a year :-( Probably because I have nothing to give them now. So me and Rachel are in a house alone 99% of the time, in a reqion we don't like, in a house we don't like. So it is time to move back to where we loved.

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #13
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    I'll forward to seeing you Les. When you get a bit further South I'll take you round the National Museum of Computing at Bletchley Park. There is plenty there to tickle your old memories of how things used to be.

    Which John are you going to meet? If it's John Drew then perhaps we should organise a cricket match?

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #14
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,858
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    I wish it was Charlie.
    16000km is a long way but it would be worth it. The UK versus Oz, I can see Les racing down the pitch to deliver a fast ball while Charlie wicket keeps, the UK users crouched ready to receive a likely 4. At the booth the Aussie/NZ team check out the English beer and oggle the lovely ladies of the UK.
    Sounds great, now if I could talk the Board of Management into it! She who must be obeyed doesn't like flying.
    John

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  29. #15
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,396
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: NEC Protocol IR remote control decoder

    Now that's a nice picture you paint John. If Fanie could provide the aerial drone video photography (complete with rapid fire machine guns) then it would be quite a match. Sorry for drifting this thread away from NEC IR Protocol!

  30. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. IR Remote Control
    By teo in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 10th May 2014, 21:04
  2. Remote Control Mute
    By mikedownunder in forum Proton Plus Compiler v3
    Replies: 12
    Last Post: 20th March 2012, 14:58
  3. Creative IR Remote Control
    By babu biri in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 28th February 2009, 06:07
  4. Airconditioning Remote Control
    By dolci in forum Proton Plus Compiler v3
    Replies: 16
    Last Post: 12th December 2005, 15:00
  5. [SOLVED !] Sky Digibox Remote and Open Keyboard Decoder
    By Stephen in forum Proton-IR
    Replies: 3
    Last Post: 30th March 2004, 19:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts