; PicBasic Pro Compiler 2.43, (c) 1998, 2002 microEngineering Labs, Inc. All Rights Reserved. PM_USED EQU 1 INCLUDE "12F675.INC" RAM_START EQU 00020h RAM_END EQU 0005Fh RAM_BANKS EQU 00001h BANK0_START EQU 00020h BANK0_END EQU 0005Fh EEPROM_START EQU 02100h EEPROM_END EQU 0217Fh R0 EQU RAM_START + 000h R1 EQU RAM_START + 002h R2 EQU RAM_START + 004h R3 EQU RAM_START + 006h R4 EQU RAM_START + 008h R5 EQU RAM_START + 00Ah R6 EQU RAM_START + 00Ch R7 EQU RAM_START + 00Eh R8 EQU RAM_START + 010h T1 EQU RAM_START + 012h T2 EQU RAM_START + 014h FLAGS EQU RAM_START + 016h GOP EQU RAM_START + 017h RM1 EQU RAM_START + 018h RM2 EQU RAM_START + 019h RR1 EQU RAM_START + 01Ah RR2 EQU RAM_START + 01Bh _IRpulse_length EQU RAM_START + 01Ch _Command EQU RAM_START + 036h _Device EQU RAM_START + 037h _sBaud EQU RAM_START + 038h _xx EQU RAM_START + 039h _PORTL EQU GPIO _PORTH EQU GPIO _TRISL EQU TRISIO _TRISH EQU TRISIO #define _GPIO_3 GPIO, 003h #define _GPIO_1 GPIO, 001h #define _Command_BIT0 _Command, 000h #define _Command_BIT1 _Command, 001h #define _Command_BIT2 _Command, 002h #define _Command_BIT3 _Command, 003h #define _Command_BIT4 _Command, 004h #define _Command_BIT5 _Command, 005h #define _Command_BIT6 _Command, 006h #define _Command_BIT7 _Command, 007h #define _Device_BIT0 _Device, 000h #define _Device_BIT1 _Device, 001h #define _Device_BIT2 _Device, 002h #define _Device_BIT3 _Device, 003h #define _GPIO_0 GPIO, 000h INCLUDE "IRRECE~2.MAC" INCLUDE "PBPPIC14.LIB" ASM? DEVICE INTRC_OSC, MCLR_off, PROTECT_OFF, WDT_OFF ENDASM? MOVE?CB 007h, CMCON MOVE?CB 000h, ANSEL MOVE?CB 010h, TRISIO MOVE?CB 000h, GPIO INPUT?T _GPIO_3 PAUSE?C 001F4h MOVE?CB 002h, _sBaud CMPNE?TCL _GPIO_3, 001h, L00001 MOVE?CB 002h, _sBaud LABEL?L L00001 CMPNE?TCL _GPIO_3, 000h, L00003 MOVE?CB 000h, _sBaud LABEL?L L00003 LABEL?L _Getstartbits PULSIN?TCW _GPIO_1, 000h, _IRpulse_length CMPGE?WCL _IRpulse_length, 0C8h, L00005 GOTO?L _Getstartbits LABEL?L L00005 MOVE?CB 001h, _xx LABEL?L L00007 CMPGT?BCL _xx, 00Ch, L00008 PULSIN?TCW _GPIO_1, 000h, T1 AIN?WWB T1, _IRpulse_length, _xx NEXT?BCL _xx, 001h, L00007 LABEL?L L00008 LABEL?L _displaybits CMPGE?WCL _IRpulse_length + 00002h, 064h, L00009 MOVE?CT 000h, _Command_BIT0 GOTO?L L00010 LABEL?L L00009 MOVE?CT 001h, _Command_BIT0 LABEL?L L00010 CMPGE?WCL _IRpulse_length + 00004h, 064h, L00011 MOVE?CT 000h, _Command_BIT1 GOTO?L L00012 LABEL?L L00011 MOVE?CT 001h, _Command_BIT1 LABEL?L L00012 CMPGE?WCL _IRpulse_length + 00006h, 064h, L00013 MOVE?CT 000h, _Command_BIT2 GOTO?L L00014 LABEL?L L00013 MOVE?CT 001h, _Command_BIT2 LABEL?L L00014 CMPGE?WCL _IRpulse_length + 00008h, 064h, L00015 MOVE?CT 000h, _Command_BIT3 GOTO?L L00016 LABEL?L L00015 MOVE?CT 001h, _Command_BIT3 LABEL?L L00016 CMPGE?WCL _IRpulse_length + 0000Ah, 064h, L00017 MOVE?CT 000h, _Command_BIT4 GOTO?L L00018 LABEL?L L00017 MOVE?CT 001h, _Command_BIT4 LABEL?L L00018 CMPGE?WCL _IRpulse_length + 0000Ch, 064h, L00019 MOVE?CT 000h, _Command_BIT5 GOTO?L L00020 LABEL?L L00019 MOVE?CT 001h, _Command_BIT5 LABEL?L L00020 CMPGE?WCL _IRpulse_length + 0000Eh, 064h, L00021 MOVE?CT 000h, _Command_BIT6 GOTO?L L00022 LABEL?L L00021 MOVE?CT 001h, _Command_BIT6 LABEL?L L00022 MOVE?CT 000h, _Command_BIT7 ADD?BCB _Command, 001h, _Command CMPNE?BCL _Command, 00Ah, L00023 MOVE?CB 000h, _Command LABEL?L L00023 CMPGE?WCL _IRpulse_length + 00010h, 064h, L00025 MOVE?CT 000h, _Device_BIT0 GOTO?L L00026 LABEL?L L00025 MOVE?CT 001h, _Device_BIT0 LABEL?L L00026 CMPGE?WCL _IRpulse_length + 00012h, 064h, L00027 MOVE?CT 000h, _Device_BIT1 GOTO?L L00028 LABEL?L L00027 MOVE?CT 001h, _Device_BIT1 LABEL?L L00028 CMPGE?WCL _IRpulse_length + 00014h, 064h, L00029 MOVE?CT 000h, _Device_BIT2 GOTO?L L00030 LABEL?L L00029 MOVE?CT 001h, _Device_BIT2 LABEL?L L00030 CMPGE?WCL _IRpulse_length + 00016h, 064h, L00031 MOVE?CT 000h, _Device_BIT3 GOTO?L L00032 LABEL?L L00031 MOVE?CT 001h, _Device_BIT3 LABEL?L L00032 SERPIN?T _GPIO_0 SERMODE?B _sBaud SEROUT?B _Device SEROUT?B _Command PAUSE?C 064h GOTO?L _Getstartbits END