- Fri Feb 08, 2008 8:28 pm
#42509
New simplified circuit...
The 74HC logic has been replaced with a PIC 12F629.
A reverse biased IR LED is used as an IR detector. This requires good alignment with the remote, so a visible LED provides feeback.
The 'DAC' no longer has DC blocking caps or a voltage divider. It is assumed that the sound card is AC coupled and has an input impedance of about 10k.
The PIC code is very simple...
The 74HC logic has been replaced with a PIC 12F629.
A reverse biased IR LED is used as an IR detector. This requires good alignment with the remote, so a visible LED provides feeback.
The 'DAC' no longer has DC blocking caps or a voltage divider. It is assumed that the sound card is AC coupled and has an input impedance of about 10k.
The PIC code is very simple...
Code: Select all
include <P12F629.INC>
#define PGMSIZE 1024
__config _CPD_OFF & _CP_OFF & _BODEN_ON & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
; --- I/O
; 8 Ground
bLeft1 equ 0 ; 7 Left 1
bLeft2 equ 1 ; 6 Left 2
bStatusLED equ 2 ; 5 Status LED
bIRLED equ 3 ; 4 IR LED (used as IR detector)
bRight2 equ 4 ; 3 Right 2
bRight1 equ 5 ; 2 Right 1
; 1 Power
;
;
;
org 0x0000 ; - Start of program memory
; - Initiailize peripherals
;
movlw (1<<CM0) | (1<<CM1) | (1<<CM2) ; Disable comparator
movwf CMCON ;
;
call PGMSIZE-1 ; Get OSCCAL
;
bsf STATUS,RP0 ; Bank 1
;
movwf OSCCAL ^ BANK1 ; Setup OSCCAL
;
#ifdef ANSEL ;
movlw (1<<ADCS0) | (1<<ADCS2) ; Disable ADC, make all pins digital I/O
movwf ANSEL ^ BANK1 ;
#endif ;
;
movlw (1<<bIRLED) ; Setup TRIS
movwf TRISIO ^ BANK1 ;
;
bcf STATUS,RP0 ; Bank 0
;
;
loop ;
movlw (1<<bRight1)|(1<<bLeft1)|(1<<bStatusLED); Neutral output, Status LED off
movwf GPIO ;
;
btfsc GPIO,bIRLED ; Wait for IR on
goto $-1 ;
;
movlw (1<<bLeft1)|(1<<bLeft2) ; Left High, Right Low output, Status LED on
movwf GPIO ;
;
btfss GPIO,bIRLED ; Wait for IR off
goto $-1 ;
;
movlw (1<<bRight1)|(1<<bLeft1)|(1<<bStatusLED); Neutral output, Status LED off
movwf GPIO ;
;
btfsc GPIO,bIRLED ; Wait for IR on
goto $-1 ;
;
movlw (1<<bRight1)|(1<<bRight2) ; Left Low, Right High output, Status LED on
movwf GPIO ;
;
btfss GPIO,bIRLED ; Wait for IR off
goto $-1 ;
;
goto loop ;
;
;
end ;
;