Hi,After looking at your schematic this circuit is a decoder for an infrared remote control.
The PIC16F870 is an ancient programmable controller. As you may know these device are blank when new.
Brian has said that these kinds of controller are code protected and as such the code programmed in them cannot be recovered with simple methods.
It seems after 20 years that the original equipment maker may have no idea of where to find the code for this device or how to program one for you.
There are quite a few new Microchip controllers that could be used in your board without any circuit changes. But you would need to create new code from scratch. This also seems to be an impossible task as you would need to know what kinds of signals need to be produced for each button on the remote control transmitter.
Is there any chance of a template or default code I could use? I dont even need all of the inputs to work just a few is enough. I have time, experience is what I lack.
;
; File: 16F870_template.asm
; Target: PIC16F870
; IDE: MPLAB 8.92
; Assembler: MPASM v5.00 using absolute mode
;
; Additional files:
; p16f870.inc
;
; Description:
; This is a template for an assembly language program.
; All this code does in setup the controller for all
; of the GPIO pins to be digital inputs then count
; in one 8-bit RAM memory location.
;
; PIC16F870
; +-----------:_:-----------+
; ICD_VPP -> : 1 MCLRn PGD 28 : <> RB7 ICD_PGD
; RA0 <> : 2 AN0 PGC 27 : <> RB6 ICD_PGC
; RA1 <> : 3 AN1 26 : <> RB5
; RA2 <> : 4 AN2 25 : <> RB4
; RA3 <> : 5 AN3 PGM 24 : <> RB3
; RA4 <> : 6 T0CKI 23 : <> RB2
; RA5 <> : 7 AN4 22 : <> RB1
; GND <> : 8 VSS INT0 21 : <> RB0
; 4MHz XTAL -> : 9 OSC1 VDD 20 : <- 5v0
; 4MHz XTAL <- : 10 OSC2 VSS 19 : <- GND
; RC0 <> : 11 T1OSO RX 18 : <> RC7
; RC1 <> : 12 T1OSI TX 17 : <> RC6
; RC2 <> : 13 CCP1 16 : <> RC5
; RC3 <> : 14 15 : <> RC4
; +-------------------------+
; DIP-28
;
LIST n=0, c=160 ; make .LST file look pretty
LIST r=dec ; use decimal (not HEX) numbers by default
errorlevel -302 ; Suppress the not in bank zero warning
;
; Inculde definitions for device specific Special Function Registers
;
#INCLUDE "p16F870.inc"
;
; Setup all configuration word bits
;
__CONFIG _XT_OSC & _WDTE_OFF & _PWRTE_OFF & _CP_OFF & _BOREN_ON & _LVP_OFF & _CPD_OFF & _WRT_ALL
;
; Reset vector
;
org 0x0000 ; processor reset vector
GOTO START ; go to beginning of program
;
; Interrupt Vector data
;
cblock 0x70
WREG_Save : 1
STATUS_Save : 1
PCLATH_Save : 1
endc
;
; Interrupt Vector code
;
org 0x0004 ; interrupt vector location
movwf WREG_Save
movf STATUS,W
movwf STATUS_Save
movf PCLATH,W
movwf PCLATH_Save
;
; Put interrupt handler here
;
ISR_EXIT:
movf PCLATH_Save,W
movwf PCLATH
movf STATUS_Save,W
movwf STATUS
swapf WREG_Save,F
swapf WREG_Save,W
retfie
;
; Main data
;
cblock 0x20
Count : 1 ; One byte of data
endc
;
; Main code
;
START:
clrf INTCON ; Disable all interrupt sources
banksel PIE1
clrf PIE1
clrf PIE2
movlw 0xFF ;
movwf TRISA ; Make all GPIO pins inputs
movwf TRISB
movwf TRISC
movlw 0x06 ;
movwf ADCON1 ; Make all GPIO pin digital I/O
;
; Application start
;
banksel Count
clrf Count
;
; Application process loop
;
ProcessLoop:
incf Count,F
goto ProcessLoop
end
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?