;********************************************************************** ; * ; Filename: sirc10fv10rem.asm * ; Date: 06-02-2010 * ; File Version: * ; * ; Author: Pete Griffiths * ; Company: Picprojects * ; * ;********************************************************************** ; Copyright 2010 Pete Griffiths ; ; This program is free software: you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation, either version 3 of ; the License, or any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program. If not, see http://www.gnu.org/licenses/ ; ;********************************************************************** ; * ; Files Required: P10F200.INC * ; * ;********************************************************************** ; * ; Notes: * ; Web release: 12 bit SIRC mini IR Transmitter * ; see http://picprojects.org.uk/projects for full details * ; * ; See PIC10F20x datasheet: * ; http://ww1.microchip.com/downloads/en/DeviceDoc/41239D.pdf * ; * ;********************************************************************** ifdef __10F200 list p=10F200 ; list directive to define processor #include ; processor specific variable definitions endif ifdef __10F202 list p=10F202 ; list directive to define processor #include ; processor specific variable definitions endif __CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF ;******************************************************************************************* ; USER CONFIGURABLE SWITCH SIRC CODES ; These are the SIRC device/command codes that are transmitted ; Transmission comprises 7 bit command and 5 bit device code ; C.device.id equ .1 ; SIRC Device ID [0-31] ; SIRC Command code [0-127] ; to disable a switch set value to .255 C.cmd.S1 equ .8 ; command sent on Switch 1 C.cmd.S2 equ .1 ; command sent on Switch 2 C.cmd.S3 equ .0 ; command sent on Switch 3 ; ; Defaults above are for Sony TV remote. ; See http://www.sbprojects.com/knowledge/ir/sirc.htm for additional codes and SIRC FAQ. ;******************************************************************************************* ; CONSTANT for number of bits to transmit - don't change Ccmd.bit.length equ 7 ; SIRC command bit length Cdev.bit.length equ 5 ; SIRC device bit length ;***** VARIABLE DEFINITIONS ; GPR starts at 0x0C for 10F202 / 10F206 ; GPR starts at 0x10 for 10F200 / 10F204 cblock 0x10 device.code ; IR device code to send command.code ; IR command code to send shift.temp ; ir data temp shift register counter ; count ir data bits shifted shift.count ; count bits shifted endc ;***** NAME GPIO PORT BITS S1 equ 1 ; GPIO 1 S2 equ 0 ; GPIO 0 S3 equ 3 ; GPIO 3 irled equ 2 ; GPIO 2 ;===================================================================================== ; ; Program code starts here ; ;===================================================================================== ORG 0x000 ; processor reset vector ; Code in this section initialises the PIC ; start movwf OSCCAL ; update register with factory cal value clrwdt ; options 1:256 prescaler to Tmr0, T0CS = Int Osc, Enable weak pull-ups ; Enable wake-on-change ; NB: This movlw instruction will clear the specifed bits in the option register movlw ~(1<