oboztepe
Üye
- Katılım
- 18 May 2009
- Mesajlar
- 2
- Puanları
- 1
- Yaş
- 39
arkadaşlar programın akış şemasını çıkaramadık
bu konuda yardımlarınızı bekliyorum!
Lütfen! en kısa zamanda
PM_USED EQU 1
INCLUDE "16F628.INC"
; Define statements.
#define LCD_DREG PORTB
#define LCD_DBIT 4
#define LCD_EREG PORTB
#define LCD_EBIT 3
#define LCD_RWREG PORTB
#define LCD_RWBIT 2
#define LCD_RSREG PORTB
#define LCD_RSBIT 1
#define LCD_BITS 4
#define LCD_LINES 2
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
T1 EQU RAM_START + 012h
FLAGS EQU RAM_START + 014h
GOP EQU RAM_START + 015h
RM1 EQU RAM_START + 016h
RM2 EQU RAM_START + 017h
RR1 EQU RAM_START + 018h
RR2 EQU RAM_START + 019h
_Float EQU RAM_START + 01Ah
_HAM EQU RAM_START + 01Ch
_ISI EQU RAM_START + 01Eh
_X EQU RAM_START + 020h
_i EQU RAM_START + 022h
_kg EQU RAM_START + 023h
PB01 EQU RAM_START + 024h
_SIGN EQU RAM_START + 025h
_sy EQU RAM_START + 026h
_TEMP EQU RAM_START + 027h
_PORTL EQU PORTB
_PORTH EQU PORTA
_TRISL EQU TRISB
_TRISH EQU TRISA
_HAM_LOWBYTE EQU _HAM
_HAM_HIGHBYTE EQU _HAM + 001h
#define _Comm_Pin _PORTB_0
#define _Busy PB01, 000h
#define _SIGN_BITI _HAM_BIT11
#define _PORTB_0 PORTB, 000h
#define _HAM_BIT11 _HAM + 001h, 003h
#define _PORTA_2 PORTA, 002h
#define _PORTA_1 PORTA, 001h
#define _PORTA_0 PORTA, 000h
#define _PORTA_3 PORTA, 003h
; Constants.
_NEGAT_ISI EQU 00001h
_Deg EQU 000DFh
INCLUDE "SONSON.MAC"
INCLUDE "PBPPIC14.LIB"
MOVE?CB 000h, PORTA
MOVE?CB 000h, PORTB
MOVE?CB 0F0h, TRISB
MOVE?CB 006h, TRISA
MOVE?CB 007h, CMCON
PAUSE?C 0C8h
READ?CB 000h, _sy
READ?CB 001h, _sy
LABEL?L _a
MOVE?CB 000h, _i
LABEL?L L00001
CMPGT?BCL _i, 064h, L00002
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUTD?B _sy
LCDOUT?C 020h
LCDOUT?C 047h
LCDOUT?C 069h
LCDOUT?C 052h
LCDOUT?C 069h
LCDOUT?C 053h
CMPNE?TCL _PORTA_2, 000h, L00003
ADD?BCB _sy, 001h, _sy
LABEL?L L00003
CMPGT?BCL _sy, 000h, L00005
ADD?BCB _sy, 001h, _sy
LABEL?L L00005
CMPLE?BCL _sy, 041h, L00007
SUB?BCB _sy, 001h, _sy
LABEL?L L00007
CMPEQ?BCL _sy, 000h, L00009
MOVE?BB _sy, _sy
LABEL?L L00009
PAUSE?C 064h
CMPEQ?TCL _PORTA_2, 000h, _a
CMPNE?TCL _PORTA_1, 000h, L00011
SUB?BCB _sy, 001h, _sy
LABEL?L L00011
PAUSE?C 064h
CMPEQ?TCL _PORTA_1, 000h, _a
CMPEQ?BCL _i, 032h, _a3
NEXT?BCL _i, 001h, L00001
LABEL?L L00002
GOTO?L _a
LABEL?L _bas
READ?CB 000h, _sy
READ?CB 001h, _sy
LABEL?L _BASLA
GOSUB?L _SENSOROKU
GOTO?L _BASLA
LABEL?L _SENSOROKU
OWPIN?T _Comm_Pin
OWMODE?C 001h
OWOUT?C 0CCh
OWOUT?C 044h
OWEND?
LABEL?L _Bekle
OWPIN?T _Comm_Pin
OWMODE?C 004h
OWIN?T _Busy
OWEND?
CMPEQ?TCL _Busy, 000h, _Bekle
OWPIN?T _Comm_Pin
OWMODE?C 001h
OWOUT?C 0CCh
OWOUT?C 0BEh
OWEND?
OWPIN?T _Comm_Pin
OWMODE?C 002h
OWIN?B _HAM_LOWBYTE
OWIN?B _HAM_HIGHBYTE
OWEND?
GOSUB?L _Hesapla
RETURN?
LABEL?L _Hesapla
MOVE?CB 02Bh, _SIGN
CMPNE?TCL _SIGN_BITI, _NEGAT_ISI, L00013
MOVE?CB 02Dh, _SIGN
SUB?CWW 0FFFFh, _HAM, T1
ADD?WCW T1, 001h, T1
MUL?WCB T1, 00271h, _TEMP
DIV32?CW 00Ah, _ISI
GOTO?L _GEC
LABEL?L L00013
ADD?WCW _HAM, 001h, T1
MUL?CWB 00271h, T1, _TEMP
DIV32?CW 00Ah, _ISI
LABEL?L _GEC
MOD?WCW _ISI, 003E8h, T1
DIV?WCW T1, 064h, _Float
DIV?WCW _ISI, 003E8h, _ISI
CMPLT?WBL _ISI, _sy, L00015
MOVE?CT 000h, _PORTA_0
LABEL?L L00015
CMPGT?WBL _ISI, _sy, L00017
MOVE?CT 001h, _PORTA_0
LABEL?L L00017
CMPLT?WBL _ISI, _sy, L00019
MOVE?CT 001h, _PORTA_3
LABEL?L L00019
CMPGT?WBL _ISI, _sy, L00021
MOVE?CT 000h, _PORTA_3
LABEL?L L00021
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUTD?B _sy
LCDOUT?C 020h
LCDOUT?C 020h
LCDOUT?C 04Dh
LCDOUT?C 041h
LCDOUT?C 058h
LCDOUT?C 0FEh
LCDOUT?C 0C0h
LCDOUT?B _SIGN
LCDOUTCOUNT?C 000h
LCDOUTNUM?W _ISI
LCDOUTDEC?
LCDOUT?C 02Eh
LCDOUTCOUNT?C 001h
LCDOUTNUM?W _Float
LCDOUTDEC?
LCDOUT?C 020h
LCDOUT?C _Deg
LCDOUT?C 043h
LCDOUT?C 020h
RETURN?
LABEL?L _a3
WRITE?CB 000h, _sy
PAUSE?C 064h
WRITE?CB 001h, _sy
PAUSE?C 064h
GOTO?L _bas
END?
END
bu konuda yardımlarınızı bekliyorum!
Lütfen! en kısa zamanda
PM_USED EQU 1
INCLUDE "16F628.INC"
; Define statements.
#define LCD_DREG PORTB
#define LCD_DBIT 4
#define LCD_EREG PORTB
#define LCD_EBIT 3
#define LCD_RWREG PORTB
#define LCD_RWBIT 2
#define LCD_RSREG PORTB
#define LCD_RSBIT 1
#define LCD_BITS 4
#define LCD_LINES 2
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
T1 EQU RAM_START + 012h
FLAGS EQU RAM_START + 014h
GOP EQU RAM_START + 015h
RM1 EQU RAM_START + 016h
RM2 EQU RAM_START + 017h
RR1 EQU RAM_START + 018h
RR2 EQU RAM_START + 019h
_Float EQU RAM_START + 01Ah
_HAM EQU RAM_START + 01Ch
_ISI EQU RAM_START + 01Eh
_X EQU RAM_START + 020h
_i EQU RAM_START + 022h
_kg EQU RAM_START + 023h
PB01 EQU RAM_START + 024h
_SIGN EQU RAM_START + 025h
_sy EQU RAM_START + 026h
_TEMP EQU RAM_START + 027h
_PORTL EQU PORTB
_PORTH EQU PORTA
_TRISL EQU TRISB
_TRISH EQU TRISA
_HAM_LOWBYTE EQU _HAM
_HAM_HIGHBYTE EQU _HAM + 001h
#define _Comm_Pin _PORTB_0
#define _Busy PB01, 000h
#define _SIGN_BITI _HAM_BIT11
#define _PORTB_0 PORTB, 000h
#define _HAM_BIT11 _HAM + 001h, 003h
#define _PORTA_2 PORTA, 002h
#define _PORTA_1 PORTA, 001h
#define _PORTA_0 PORTA, 000h
#define _PORTA_3 PORTA, 003h
; Constants.
_NEGAT_ISI EQU 00001h
_Deg EQU 000DFh
INCLUDE "SONSON.MAC"
INCLUDE "PBPPIC14.LIB"
MOVE?CB 000h, PORTA
MOVE?CB 000h, PORTB
MOVE?CB 0F0h, TRISB
MOVE?CB 006h, TRISA
MOVE?CB 007h, CMCON
PAUSE?C 0C8h
READ?CB 000h, _sy
READ?CB 001h, _sy
LABEL?L _a
MOVE?CB 000h, _i
LABEL?L L00001
CMPGT?BCL _i, 064h, L00002
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUTD?B _sy
LCDOUT?C 020h
LCDOUT?C 047h
LCDOUT?C 069h
LCDOUT?C 052h
LCDOUT?C 069h
LCDOUT?C 053h
CMPNE?TCL _PORTA_2, 000h, L00003
ADD?BCB _sy, 001h, _sy
LABEL?L L00003
CMPGT?BCL _sy, 000h, L00005
ADD?BCB _sy, 001h, _sy
LABEL?L L00005
CMPLE?BCL _sy, 041h, L00007
SUB?BCB _sy, 001h, _sy
LABEL?L L00007
CMPEQ?BCL _sy, 000h, L00009
MOVE?BB _sy, _sy
LABEL?L L00009
PAUSE?C 064h
CMPEQ?TCL _PORTA_2, 000h, _a
CMPNE?TCL _PORTA_1, 000h, L00011
SUB?BCB _sy, 001h, _sy
LABEL?L L00011
PAUSE?C 064h
CMPEQ?TCL _PORTA_1, 000h, _a
CMPEQ?BCL _i, 032h, _a3
NEXT?BCL _i, 001h, L00001
LABEL?L L00002
GOTO?L _a
LABEL?L _bas
READ?CB 000h, _sy
READ?CB 001h, _sy
LABEL?L _BASLA
GOSUB?L _SENSOROKU
GOTO?L _BASLA
LABEL?L _SENSOROKU
OWPIN?T _Comm_Pin
OWMODE?C 001h
OWOUT?C 0CCh
OWOUT?C 044h
OWEND?
LABEL?L _Bekle
OWPIN?T _Comm_Pin
OWMODE?C 004h
OWIN?T _Busy
OWEND?
CMPEQ?TCL _Busy, 000h, _Bekle
OWPIN?T _Comm_Pin
OWMODE?C 001h
OWOUT?C 0CCh
OWOUT?C 0BEh
OWEND?
OWPIN?T _Comm_Pin
OWMODE?C 002h
OWIN?B _HAM_LOWBYTE
OWIN?B _HAM_HIGHBYTE
OWEND?
GOSUB?L _Hesapla
RETURN?
LABEL?L _Hesapla
MOVE?CB 02Bh, _SIGN
CMPNE?TCL _SIGN_BITI, _NEGAT_ISI, L00013
MOVE?CB 02Dh, _SIGN
SUB?CWW 0FFFFh, _HAM, T1
ADD?WCW T1, 001h, T1
MUL?WCB T1, 00271h, _TEMP
DIV32?CW 00Ah, _ISI
GOTO?L _GEC
LABEL?L L00013
ADD?WCW _HAM, 001h, T1
MUL?CWB 00271h, T1, _TEMP
DIV32?CW 00Ah, _ISI
LABEL?L _GEC
MOD?WCW _ISI, 003E8h, T1
DIV?WCW T1, 064h, _Float
DIV?WCW _ISI, 003E8h, _ISI
CMPLT?WBL _ISI, _sy, L00015
MOVE?CT 000h, _PORTA_0
LABEL?L L00015
CMPGT?WBL _ISI, _sy, L00017
MOVE?CT 001h, _PORTA_0
LABEL?L L00017
CMPLT?WBL _ISI, _sy, L00019
MOVE?CT 001h, _PORTA_3
LABEL?L L00019
CMPGT?WBL _ISI, _sy, L00021
MOVE?CT 000h, _PORTA_3
LABEL?L L00021
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUTD?B _sy
LCDOUT?C 020h
LCDOUT?C 020h
LCDOUT?C 04Dh
LCDOUT?C 041h
LCDOUT?C 058h
LCDOUT?C 0FEh
LCDOUT?C 0C0h
LCDOUT?B _SIGN
LCDOUTCOUNT?C 000h
LCDOUTNUM?W _ISI
LCDOUTDEC?
LCDOUT?C 02Eh
LCDOUTCOUNT?C 001h
LCDOUTNUM?W _Float
LCDOUTDEC?
LCDOUT?C 020h
LCDOUT?C _Deg
LCDOUT?C 043h
LCDOUT?C 020h
RETURN?
LABEL?L _a3
WRITE?CB 000h, _sy
PAUSE?C 064h
WRITE?CB 001h, _sy
PAUSE?C 064h
GOTO?L _bas
END?
END