;
www.endtas.com/robot
; pest repeller source code
; ozkal ozsoy
PM_USED EQU 1
INCLUDE "16F627.INC"
; Define statements.
#define OSC 4
RAM_START EQU 00020h
RAM_END EQU 0014Fh
RAM_BANKS EQU 00003h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00120h
BANK2_END EQU 0014Fh
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
FLAGS EQU RAM_START + 012h
GOP EQU RAM_START + 013h
RM1 EQU RAM_START + 014h
RM2 EQU RAM_START + 015h
RR1 EQU RAM_START + 016h
RR2 EQU RAM_START + 017h
_freq EQU RAM_START + 018h
_sure EQU RAM_START + 01Ah
_dongu EQU RAM_START + 01Ch
_flag EQU RAM_START + 01Dh
_sayac EQU RAM_START + 01Eh
_sayac1 EQU RAM_START + 01Fh
_PORTL EQU PORTB
_PORTH EQU PORTA
_TRISL EQU TRISB
_TRISH EQU TRISA
#define _isikvar _PORTA_2
#define _PORTA_2 PORTA, 002h
#define _PORTA_3 PORTA, 003h
#define _PORTA_0 PORTA, 000h
#define _PORTA_1 PORTA, 001h
; Constants.
_durs EQU 00000h
INCLUDE "FAREKOV.MAC"
INCLUDE "PBPPIC14.LIB"
MOVE?CB 007h, CMCON
MOVE?CB 0FEh, TRISA
MOVE?CB 000h, TRISB
MOVE?CW 007D0h, _sure
MOVE?CB 002h, PORTA
MOVE?CB 000h, PORTB
SOUNDPIN?T _PORTA_3
SOUND?CC 06Eh, 005h
MOVE?CW 07530h, _freq
LABEL?L _dura
LABEL?L _enbas
HIGH?T _PORTA_0
PAUSE?C 00Ah
LOW?T _PORTA_0
MOVE?CW 03E80h, _freq
LABEL?L L00001
CMPGT?WCL _freq, 0D6D8h, L00002
HPWM?CCW 001h, 07Fh, _freq
PAUSE?C 00Ah
NEXT?WCL _freq, 001F4h, L00001
LABEL?L L00002
CMPNE?TCL _PORTA_1, 001h, L00003
GOTO?L _enbas
LABEL?L L00003
MOVE?CW 03E80h, _freq
LABEL?L L00005
CMPGT?WCL _freq, 0D6D8h, L00006
HPWM?CCW 001h, 07Fh, _freq
PAUSE?C 0C8h
NEXT?WCL _freq, 003E8h, L00005
LABEL?L L00006
MOVE?CB 001h, _sayac1
LABEL?L L00007
CMPGT?BCL _sayac1, 0FFh, L00008
MOVE?CB 001h, _sayac
LABEL?L L00009
CMPGT?BCL _sayac, 0FFh, L00010
CMPGT?BBL _sayac, _sayac1, L00011
MOVE?CB 0F0h, PORTB
GOTO?L L00012
LABEL?L L00011
MOVE?CB 00Fh, PORTB
LABEL?L L00012
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00009
LABEL?L L00010
NEXT?BCL _sayac1, 001h, L00007
LABEL?L L00008
PAUSE?C 064h
MOVE?CB 0FFh, _sayac1
LABEL?L L00013
CMPLT?BCL _sayac1, 001h, L00014
MOVE?CB 001h, _sayac
LABEL?L L00015
CMPGT?BCL _sayac, 0FFh, L00016
CMPGT?BBL _sayac, _sayac1, L00017
MOVE?CB 0F0h, PORTB
GOTO?L L00018
LABEL?L L00017
MOVE?CB 00Fh, PORTB
LABEL?L L00018
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00015
LABEL?L L00016
NEXTM?BCL _sayac1, 001h, L00013
LABEL?L L00014
PAUSE?C 064h
MOVE?CB 001h, _sayac1
LABEL?L L00019
CMPGT?BCL _sayac1, 0FFh, L00020
MOVE?CB 001h, _sayac
LABEL?L L00021
CMPGT?BCL _sayac, 0FFh, L00022
CMPGT?BBL _sayac, _sayac1, L00023
MOVE?CB 0F0h, PORTB
GOTO?L L00024
LABEL?L L00023
MOVE?CB 00Fh, PORTB
LABEL?L L00024
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00021
LABEL?L L00022
NEXT?BCL _sayac1, 001h, L00019
LABEL?L L00020
PAUSE?C 064h
MOVE?CB 0FFh, _sayac1
LABEL?L L00025
CMPLT?BCL _sayac1, 001h, L00026
MOVE?CB 001h, _sayac
LABEL?L L00027
CMPGT?BCL _sayac, 0FFh, L00028
CMPGT?BBL _sayac, _sayac1, L00029
MOVE?CB 0F0h, PORTB
GOTO?L L00030
LABEL?L L00029
MOVE?CB 00Fh, PORTB
LABEL?L L00030
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00027
LABEL?L L00028
NEXTM?BCL _sayac1, 001h, L00025
LABEL?L L00026
PAUSE?C 064h
GOTO?L _enbas
END?
END