Code:
;
; testing code for new JVC Remote
; march, 31
@ DEVICE PIC16F684, HS_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF, PROTECT_ON
DEFINE OSC 20
include "ALLDIGITAL.pbp"
PORTA= 000011
TRISA= 000011
PORTC= 000000
TRISC= 111110
CMCON0 = 000111 'Disable analog comparators.
VRCON = 000000 ' Disable Comparator Voltage Reference
ANSEL = 000000 ' Set pin (AN2) to analog input, the rest to digital
ADCON0 = 000000 ' Set up A/D converter - Right Just., VDD REF., CH 3, ON
Pause 1000
i VAR BYTE
j VAR BYTE
pulse con 560
main:
if porta.0 = 0 then gosub VolUp
Pause 100 ' do it for 0.1 sec
goto main
VolUp :
TRISC.0 = 1
pauseus 4000
TRISC.0 = 0
pauseus 1900
TRISC.0 = 1
pauseus pulse
TRISC.0 = 0
pauseus 1400
TRISC.0 = 1
pauseus pulse
TRISC.0 = 0
pauseus 1400
TRISC.0 = 1
pauseus pulse
for i = 0 to 30
Lookup i,[$BE,$8C,$8C,$2A,$2A,$2A,$2A,$2A,$2A,_
$8C,$2A,$2A,$2A,$2A,$2A,$2A,$2A,$2A,_
$8C,$2A,$2A,$2A,$8C,$2A,$2A,$2A,$2A,_
$2A,$2A,$8C,$8C] ,j
TRISC.0 = 0
PauseUs j*10
TRISC.0 = 1
PauseUs pulse
next i
Return
In Proteus it's ok ; just the "preamble" part so far.
Bookmarks