Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Regard whitespace Rev 5 → Rev 6

/programy/ASM/1st_program/INPOUT32.DPR
0,0 → 1,38
{Source code for inpout32.dll.
Enables 32-bit Visual Basic programs to do direct port I/O
(Inp and Out) under Windows 95.
To be compiled with Borland's Delphi 2.0.}
library inpout32;
uses SysUtils;
procedure Out32(PortAddress:smallint;Value:smallint);stdcall;export;
var
ByteValue:Byte;
begin
ByteValue:=Byte(Value);
asm
push dx
mov dx,PortAddress
mov al, ByteValue
out dx,al
pop dx
end;
end;
 
function Inp32(PortAddress:smallint):smallint;stdcall;export;
var
ByteValue:byte;
begin
asm
push dx
mov dx, PortAddress
in al,dx
mov ByteValue,al
pop dx
end;
Inp32:=smallint(ByteValue) and $00FF;
end;
Exports
Inp32,
Out32;
begin
end.
/programy/ASM/1st_program/INPOUT32.TXT
0,0 → 1,72
Documentation for inpout32.zip
Inpout32.zip contains a DLL that enables direct reading and writing to I/O ports in 32-bit Visual-Basic programs running under Windows 95.
 
by Jan Axelson
Lakeview Research
Email: jaxelson@lvr.com
WWW: http://www.lvr.com
 
Important information and cautions:
 
1. Use this DLL at your own risk. Writing directly to hardware ports can result in system crashes, loss of data, and even permanent damage. Inpout32 was developed to allow access to parallel ports and other ports on custom hardware, but you can use it to attempt to access any hardware that is mapped as an I/O port. You've been warned!
2. Use this DLL only with 32-bit programs. 16-bit programs require a 16-bit DLL (inpout16.dll).
3. Windows 95 allows direct port reads and writes unless a VxD has control of the port and blocks access. Under Windows NT, direct port access is not allowed, and you must use a kernel-mode device driver.
4. For the latest parallel-port programming and interfacing information and tools, visit Parallel Port Central at:
http://www.lvr.com
 
***
Inpout32.zip contains the following files:
 
inpout32.txt
This file
 
inpout32.dll
A DLL that enables the use of Inp and Out routines in 32-bit Visual Basic 4 and Visual Basic 5 programs.
inpout32.bas
Visual-Basic declarations for Inp and Out
 
inpout32.vbp
Visual Basic 4 test project for inpout32. The project will also load into and run under Visual Basic 5.
 
inpout32.frm
Startup form for the test project
inpout32.dpr
Source code for inpout32.dll. The DLL was compiled with Borland's Delphi 2.0 Object Pascal compiler.
 
***
 
How to run the test program (inpout32.vbp):
1. Copy inpout32.dll to one of these locations: your default Windows directory (usually \Windows), your Windows system directory (usually \Windows\system), or your application's working directory. In the VB programming environment, the working directory is the default VB directory.
2. Open the project inpout32.vbp.
3. In the Form_Load subroutine, set PortAddress equal to the port address you want to test.
3. Clicking the command button causes the program to do the following: write a value to the port, read the port, and display the result. The value increments with each click, resetting to 0 at 255.
 
***
 
How to use inpout32 in your programs:
 
1. Copy inpout32.dll to your default Windows directory (or other directory as described above).
 
2. Add inpout32.bas to your Visual-Basic project (File menu, Add File).
 
3. Use this syntax to write to a port:
Out PortAddress, ValueToWrite
 
Example:
Out &h378, &h55
 
Use this syntax to read a port:
ValueRead = Inp(PortAddress)
 
Example:
ValueRead = Inp(&h378)
(The syntax is identical to QuickBasic's Inp and Out).
/programy/ASM/1st_program/INPOUT32.VBP
0,0 → 1,30
Type=Exe
Form=inpout32.frm
Module=inpout; Inpout32.bas
IconForm="inpout32"
Startup="inpout32"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="doma"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
/programy/ASM/1st_program/INPOUT32.vbw
0,0 → 1,2
inpout32 = 25, -2, 354, 453, Z, -2, -9, 554, 447, C
inpout = 66, 66, 317, 328, C
/programy/ASM/1st_program/Inpout32.bas
0,0 → 1,29
Attribute VB_Name = "inpout"
 
'Inp and Out declarations for direct port I/O
'in 32-bit Visual Basic 4 programs.
 
Public Declare Function Input32 Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Output Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Sub out(ByVal Value As Integer)
Output &H3BC, Value
End Sub
Function inp() As Integer
inp = Input32(&H3BD)
End Function
 
Function inp11() As Boolean
inp11 = ((inp And &H80) = 0)
End Function
Function inp10() As Boolean
inp10 = Not ((inp And &H40) = 0)
End Function
Function inp12() As Boolean
inp12 = Not ((inp And &H20) = 0)
End Function
Function inp13() As Boolean
inp13 = Not ((inp And &H10) = 0)
End Function
 
/programy/ASM/1st_program/inpout32.frm
0,0 → 1,323
VERSION 5.00
Begin VB.Form inpout32
Caption = "Form1"
ClientHeight = 4710
ClientLeft = 915
ClientTop = 1410
ClientWidth = 4770
LinkTopic = "Form1"
PaletteMode = 1 'UseZOrder
ScaleHeight = 4710
ScaleWidth = 4770
Begin VB.CheckBox Check2
Caption = "Check2"
Height = 375
Left = 2640
Style = 1 'Graphical
TabIndex = 22
Top = 2880
Width = 135
End
Begin VB.CheckBox Check1
Caption = "Check1"
Height = 375
Left = 2520
Style = 1 'Graphical
TabIndex = 21
Top = 2880
Width = 135
End
Begin VB.CommandButton Command11
Caption = "Command11"
Height = 195
Left = 4320
TabIndex = 20
Top = 2280
Width = 135
End
Begin VB.CommandButton Command10
Caption = "Command10"
Height = 195
Left = 4080
TabIndex = 19
Top = 2280
Width = 135
End
Begin VB.CommandButton Command9
Caption = "Command9"
Height = 195
Left = 3840
TabIndex = 18
Top = 2280
Width = 135
End
Begin VB.CommandButton Command8
Caption = "Command8"
Height = 195
Left = 3600
TabIndex = 17
Top = 2280
Width = 135
End
Begin VB.CommandButton Command7
Caption = "Command7"
Height = 195
Left = 3240
TabIndex = 16
Top = 2280
Width = 135
End
Begin VB.CommandButton Command6
Caption = "Command6"
Height = 195
Left = 3000
TabIndex = 15
Top = 2280
Width = 135
End
Begin VB.CommandButton Command5
Caption = "Command5"
Height = 195
Left = 2760
TabIndex = 14
Top = 2280
Width = 135
End
Begin VB.CommandButton Command4
Caption = "Command4"
Height = 195
Left = 2520
TabIndex = 13
Top = 2280
Width = 135
End
Begin VB.Timer Timer3
Left = 3120
Top = 3960
End
Begin VB.TextBox Text13
Height = 285
Left = 3240
TabIndex = 8
Text = "Text5"
Top = 1680
Width = 495
End
Begin VB.TextBox Text12
Height = 285
Left = 3240
TabIndex = 7
Text = "Text4"
Top = 1200
Width = 495
End
Begin VB.TextBox Text10
Height = 285
Left = 3240
TabIndex = 6
Text = "Text3"
Top = 240
Width = 495
End
Begin VB.TextBox Text11
Height = 285
Left = 3240
TabIndex = 5
Text = "Text2"
Top = 720
Width = 495
End
Begin VB.CommandButton Command3
Caption = "Command3"
Height = 615
Left = 240
TabIndex = 4
Top = 3840
Width = 2055
End
Begin VB.Timer Timer2
Left = 1680
Top = 120
End
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 615
Left = 240
TabIndex = 3
Top = 2760
Width = 2055
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 615
Left = 240
TabIndex = 2
Top = 1680
Width = 2055
End
Begin VB.Timer Timer1
Left = 2400
Top = 3960
End
Begin VB.TextBox Text1
Height = 372
Left = 960
TabIndex = 1
Text = "Text1"
Top = 120
Width = 615
End
Begin VB.CommandButton cmdWriteToPort
Caption = "Write to Port"
Height = 732
Left = 240
TabIndex = 0
Top = 720
Width = 1932
End
Begin VB.Label Label13
Caption = "13"
Height = 375
Left = 3840
TabIndex = 12
Top = 1680
Width = 375
End
Begin VB.Label Label3
Caption = "12"
Height = 375
Left = 3840
TabIndex = 11
Top = 1200
Width = 375
End
Begin VB.Label Label2
Caption = "10"
Height = 375
Left = 3840
TabIndex = 10
Top = 240
Width = 375
End
Begin VB.Label Label1
Caption = "11"
Height = 255
Left = 3840
TabIndex = 9
Top = 720
Width = 255
End
End
Attribute VB_Name = "inpout32"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Value As Integer
Dim PortAddress As Integer
Dim stav As Boolean
Dim promena As Byte
Private Sub cmdWriteToPort_Click()
'Write to a port.
out Value
'Read back and display the result.
Value = Value + 1
If Value = 255 Then Value = 0
End Sub
 
Private Sub Command1_Click()
out 1
Timer1.Enabled = True
End Sub
 
Private Sub Command10_Click()
out &H40
End Sub
 
Private Sub Command11_Click()
out &H80
End Sub
 
Private Sub Command2_Click()
out &HFF
Timer1.Enabled = True
End Sub
 
Private Sub Command3_Click()
out 3
Timer1.Enabled = True
End Sub
 
Private Sub Command4_Click()
out &H1
End Sub
 
Private Sub Command5_Click()
out &H2
End Sub
 
Private Sub Command6_Click()
out &H4
End Sub
 
Private Sub Command7_Click()
out &H8
End Sub
 
Private Sub Command8_Click()
out &H10
End Sub
 
Private Sub Command9_Click()
out &H20
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer2.Interval = 10
Timer3.Interval = 100
End Sub
Private Sub Check1_Click()
If Check1.Value = 1 Then
promena = promena Or &H1
Else
promena = promena And &HFE
End If
out promena
End Sub
 
Private Sub Check2_Click()
If Check2.Value = 1 Then
promena = promena Or &H2
Else
promena = promena And &HFD
End If
out promena
End Sub
 
Private Sub Timer1_Timer()
out 0
Timer1.Enabled = False
End Sub
 
Private Sub Timer2_Timer()
'toto se provede kazdych 10ms
Text1.Text = inp
Text10.Text = inp10
Text11.Text = inp11
Text12.Text = inp12
Text13.Text = inp13
If Not inp10 Then
Command2_Click
End If
End Sub
 
'Private Sub Timer3_Timer()
'If stav Then
'out 1
'stav = False
'Else
'out 0
'stav = True
'End If
'End Sub
/programy/ASM/1st_program/mssccprj.scc
0,0 → 1,5
SCC = This is a Source Code Control file
 
[INPOUT32.VBP]
SCC_Aux_Path = "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\COMMON\VSS"
SCC_Project_Name = "$/programy/ASM/1st_program", RRBAAAAA
/programy/ASM/1st_program/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/3Fmotor/BUDIC.$$$
0,0 → 1,241
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
zap:
movf CT2, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
return
;----------------------------------------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
; movlw 50 ; Otacky
; movwf CT2
; movlw 45 ; Pocet kroku zrychleni
; movwf CT1
;rozj2:
; decf CT2, f
 
 
movlw 250 ; Pocet otacek jednoho kroku zrychleni
movwf CT3
movlw 150
movwf CT4
 
movlw 200
movwf CT5
 
movlw 250
movwf CT5
 
rozj: ; Rozjezd
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 5
; call zap
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 4
 
bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
Delay 4
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
decfsz CT3, f
goto rozj
 
; decfsz CT1, f
; goto rozj2
; goto rozj
 
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
decfsz CT4, f
goto rychle
 
rychle2:
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
decfsz CT5, f
goto rychle2
 
rychle3:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
; decfsz CT3, f
goto rychle3
 
;rychle4:
; bsf PORTA, 0
; bcf PORTA, 1 ;100
; bcf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; bcf PORTA, 0 ;010
; bsf PORTA, 1
; bcf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; bcf PORTA, 0 ;001
; bcf PORTA, 1
; bsf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; goto rychle4
 
;______________________________________________________________
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
CT3
CT4
CT5
CT6
endc
 
end
/programy/ASM/3Fmotor/BUDIC.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor/BUDIC.ERR
--- 3Fmotor/BUDIC.HEX (nonexistent)
+++ 3Fmotor/BUDIC.HEX (revision 6)
@@ -0,0 +1,26 @@
+:020000001B28BB
+:080008001B2863308C000C2062
+:100010008D0B052800000800000000000000000013
+:100020000000000000008C0B0C28000008000F08E6
+:100030008D000520080083160030810000308B0001
+:100040008316003085004330860081178312030138
+:1000500085008600FA30900096309100C8309200FA
+:10006000FA30920005148510051105308D00052029
+:1000700005148514051105308D0005200510851423
+:10008000051104308D000520051085140515043078
+:100090008D00052005108510051503308D00052005
+:1000A00005148510051503308D000520900B3228AE
+:1000B00005148510051102308D00052000308500E3
+:1000C00003308D00052005108514051102308D00C8
+:1000D00005200030850003308D00052005108510B7
+:1000E000051502308D0005200030850003308D009D
+:1000F0000520910B582805148510051101308D003D
+:1001000005200030850003308D0005200510851482
+:10011000051101308D0005200030850003308D0071
+:10012000052005108510051501308D0005200030D3
+:10013000850003308D000520920B7B280514851067
+:10014000051101308D0005200030850002308D0042
+:10015000052005108514051101308D0005200030A3
+:10016000850002308D000520051085100515013031
+:100170008D0005200030850002308D0005209E286E
+:00000001FF
/programy/ASM/3Fmotor/BUDIC.LST
0,0 → 1,626
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
0000 00003 org 0
00004
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000 281B 00005 goto Start
00006 ;--------------------
0004 00007 org 4
00008 ;--------------------
0004 281B 00009 goto Start
00010
00011 #include Delay.asm
00001 ;--- Macro na spozdeni 1ms az 255ms ---
00002 Delay macro ms
00003 movlw ms
00004 movwf xxx
00005 call Delay1ms
00006 endm
00007
00008 ;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
00009 Delay01 macro us
00010 movlw us
00011 movwf yyy
00012 call us10
00013
00014 nop
00015 nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
00016 nop
00017 return
00018 endm
00019 ;--- Spozdeni v nasobcich 1ms+2us ----
00020
0005 00021 Delay1ms:
0005 3063 00022 movlw 99 ; 1 ms
0006 008C 00023 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0007 200C 00024 call us10
00025
0008 0B8D 00026 decfsz xxx, f
0009 2805 00027 goto Delay1ms
000A 0000 00028 nop
00029 ;---------------------------------
000B 0008 00030 return ;2us
00031
00032 ;--- Spozdeni v nasobcich 10us ----
000C 00033 us10: ; Prodleva (CT1 * 10us)
000C 0000 00034 nop
000D 0000 00035 nop
000E 0000 00036 nop
000F 0000 00037 nop
0010 0000 00038 nop
0011 0000 00039 nop
0012 0000 00040 nop
0013 0B8C 00041 decfsz yyy, f
0014 280C 00042 goto us10
0015 0000 00043 nop
0016 0008 00044 return
00045 ;-------------------------
00046
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00047 ;----------------------------
00048 ; Definice promenych
00049 ;----------------------------
00050
00051 cblock
00052
0000000C 00053 yyy
0000000D 00054 xxx
00055
00056 endc
00057
00012
0017 00013 zap:
0017 080F 00014 movf CT2, w
0018 008D 00015 movwf xxx ;xxx promena z delay.asm
0019 2005 00016 call Delay1ms
001A 0008 00017 return
00018 ;----------------------------------------------------
00019
001B 00020 Start:
00021 page1
001B 1683 M bsf STATUS,_RP0
001C 3000 00022 movlw 00000000B ; inicializace citace a prescaleru
001D 0081 00023 movwf TMR0
001E 3000 00024 movlw 00000000B ; konfigurace preruseni
001F 008B 00025 movwf INTCON
00026
00027 page1
0020 1683 M bsf STATUS,_RP0
0021 3000 00028 movlw 00000000B ; nastaveni portu na vstup nebo vystup
0022 0085 00029 movwf PORTA ; 1=vstup 0=vystup
0023 3043 00030 movlw 01000011B
0024 0086 00031 movwf PORTB
00032
0025 1781 00033 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00034
00035 page0
0026 1283 M bcf STATUS,_RP0
00036
0027 0103 00037 clrw ; vynulovani portu
0028 0085 00038 movwf PORTA
0029 0086 00039 movwf PORTB
00040
00041
002A 00042 MainLoop:
00043 ; movlw 50 ; Otacky
00044 ; movwf CT2
00045 ; movlw 45 ; Pocet kroku zrychleni
00046 ; movwf CT1
00047 ;rozj2:
00048 ; decf CT2, f
00049
00050
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
002A 30FA 00051 movlw 250 ; Pocet otacek jednoho kroku zrychleni
002B 0090 00052 movwf CT3
00053
002C 3096 00054 movlw 150
002D 0091 00055 movwf CT4
00056
002E 30C8 00057 movlw 200
002F 0092 00058 movwf CT5
00059
0030 30FA 00060 movlw 250
0031 0092 00061 movwf CT5
00062
0032 00063 rozj: ; Rozjezd
0032 1405 00064 bsf PORTA, 0
0033 1085 00065 bcf PORTA, 1 ;100
0034 1105 00066 bcf PORTA, 2
00067 Delay 5
0035 3005 M movlw 5
0036 008D M movwf xxx
0037 2005 M call Delay1ms
00068
00069 ; call zap
00070
0038 1405 00071 bsf PORTA, 0 ;110
0039 1485 00072 bsf PORTA, 1
003A 1105 00073 bcf PORTA, 2
00074 Delay 5
003B 3005 M movlw 5
003C 008D M movwf xxx
003D 2005 M call Delay1ms
00075
003E 1005 00076 bcf PORTA, 0 ;010
003F 1485 00077 bsf PORTA, 1
0040 1105 00078 bcf PORTA, 2
00079 Delay 4
0041 3004 M movlw 4
0042 008D M movwf xxx
0043 2005 M call Delay1ms
00080
0044 1005 00081 bcf PORTA, 0 ;011
0045 1485 00082 bsf PORTA, 1
0046 1505 00083 bsf PORTA, 2
00084 Delay 4
0047 3004 M movlw 4
0048 008D M movwf xxx
0049 2005 M call Delay1ms
00085
004A 1005 00086 bcf PORTA, 0 ;001
004B 1085 00087 bcf PORTA, 1
004C 1505 00088 bsf PORTA, 2
00089 Delay 3
004D 3003 M movlw 3
004E 008D M movwf xxx
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 6
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
004F 2005 M call Delay1ms
00090
0050 1405 00091 bsf PORTA, 0 ;101
0051 1085 00092 bcf PORTA, 1
0052 1505 00093 bsf PORTA, 2
00094 Delay 3
0053 3003 M movlw 3
0054 008D M movwf xxx
0055 2005 M call Delay1ms
00095
0056 0B90 00096 decfsz CT3, f
0057 2832 00097 goto rozj
00098
00099 ; decfsz CT1, f
00100 ; goto rozj2
00101 ; goto rozj
00102
0058 00103 rychle:
0058 1405 00104 bsf PORTA, 0
0059 1085 00105 bcf PORTA, 1 ;100
005A 1105 00106 bcf PORTA, 2
00107 Delay 2
005B 3002 M movlw 2
005C 008D M movwf xxx
005D 2005 M call Delay1ms
00108
005E 3000 00109 movlw 0
005F 0085 00110 movwf PORTA
00111 Delay 3
0060 3003 M movlw 3
0061 008D M movwf xxx
0062 2005 M call Delay1ms
00112
0063 1005 00113 bcf PORTA, 0 ;010
0064 1485 00114 bsf PORTA, 1
0065 1105 00115 bcf PORTA, 2
00116 Delay 2
0066 3002 M movlw 2
0067 008D M movwf xxx
0068 2005 M call Delay1ms
00117
0069 3000 00118 movlw 0
006A 0085 00119 movwf PORTA
00120 Delay 3
006B 3003 M movlw 3
006C 008D M movwf xxx
006D 2005 M call Delay1ms
00121
006E 1005 00122 bcf PORTA, 0 ;001
006F 1085 00123 bcf PORTA, 1
0070 1505 00124 bsf PORTA, 2
00125 Delay 2
0071 3002 M movlw 2
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 7
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0072 008D M movwf xxx
0073 2005 M call Delay1ms
00126
0074 3000 00127 movlw 0
0075 0085 00128 movwf PORTA
00129 Delay 3
0076 3003 M movlw 3
0077 008D M movwf xxx
0078 2005 M call Delay1ms
00130
0079 0B91 00131 decfsz CT4, f
007A 2858 00132 goto rychle
00133
007B 00134 rychle2:
00135
007B 1405 00136 bsf PORTA, 0
007C 1085 00137 bcf PORTA, 1 ;100
007D 1105 00138 bcf PORTA, 2
00139 Delay 1
007E 3001 M movlw 1
007F 008D M movwf xxx
0080 2005 M call Delay1ms
00140
0081 3000 00141 movlw 0
0082 0085 00142 movwf PORTA
00143 Delay 3
0083 3003 M movlw 3
0084 008D M movwf xxx
0085 2005 M call Delay1ms
00144
0086 1005 00145 bcf PORTA, 0 ;010
0087 1485 00146 bsf PORTA, 1
0088 1105 00147 bcf PORTA, 2
00148 Delay 1
0089 3001 M movlw 1
008A 008D M movwf xxx
008B 2005 M call Delay1ms
00149
008C 3000 00150 movlw 0
008D 0085 00151 movwf PORTA
00152 Delay 3
008E 3003 M movlw 3
008F 008D M movwf xxx
0090 2005 M call Delay1ms
00153
0091 1005 00154 bcf PORTA, 0 ;001
0092 1085 00155 bcf PORTA, 1
0093 1505 00156 bsf PORTA, 2
00157 Delay 1
0094 3001 M movlw 1
0095 008D M movwf xxx
0096 2005 M call Delay1ms
00158
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 8
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0097 3000 00159 movlw 0
0098 0085 00160 movwf PORTA
00161 Delay 3
0099 3003 M movlw 3
009A 008D M movwf xxx
009B 2005 M call Delay1ms
009C 0B92 00162 decfsz CT5, f
009D 287B 00163 goto rychle2
00164
009E 00165 rychle3:
009E 1405 00166 bsf PORTA, 0
009F 1085 00167 bcf PORTA, 1 ;100
00A0 1105 00168 bcf PORTA, 2
00169 Delay 1
00A1 3001 M movlw 1
00A2 008D M movwf xxx
00A3 2005 M call Delay1ms
00170
00A4 3000 00171 movlw 0
00A5 0085 00172 movwf PORTA
00173 Delay 2
00A6 3002 M movlw 2
00A7 008D M movwf xxx
00A8 2005 M call Delay1ms
00174
00A9 1005 00175 bcf PORTA, 0 ;010
00AA 1485 00176 bsf PORTA, 1
00AB 1105 00177 bcf PORTA, 2
00178 Delay 1
00AC 3001 M movlw 1
00AD 008D M movwf xxx
00AE 2005 M call Delay1ms
00179
00AF 3000 00180 movlw 0
00B0 0085 00181 movwf PORTA
00182 Delay 2
00B1 3002 M movlw 2
00B2 008D M movwf xxx
00B3 2005 M call Delay1ms
00183
00B4 1005 00184 bcf PORTA, 0 ;001
00B5 1085 00185 bcf PORTA, 1
00B6 1505 00186 bsf PORTA, 2
00187 Delay 1
00B7 3001 M movlw 1
00B8 008D M movwf xxx
00B9 2005 M call Delay1ms
00188
00BA 3000 00189 movlw 0
00BB 0085 00190 movwf PORTA
00191 Delay 2
00BC 3002 M movlw 2
00BD 008D M movwf xxx
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 9
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00BE 2005 M call Delay1ms
00192 ; decfsz CT3, f
00BF 289E 00193 goto rychle3
00194
00195 ;rychle4:
00196 ; bsf PORTA, 0
00197 ; bcf PORTA, 1 ;100
00198 ; bcf PORTA, 2
00199 ; Delay 1
00200 ;
00201 ; movlw 0
00202 ; movwf PORTA
00203 ; Delay 1
00204 ;
00205 ; bcf PORTA, 0 ;010
00206 ; bsf PORTA, 1
00207 ; bcf PORTA, 2
00208 ; Delay 1
00209 ;
00210 ; movlw 0
00211 ; movwf PORTA
00212 ; Delay 1
00213 ;
00214 ; bcf PORTA, 0 ;001
00215 ; bcf PORTA, 1
00216 ; bsf PORTA, 2
00217 ; Delay 1
00218 ;
00219 ; movlw 0
00220 ; movwf PORTA
00221 ; Delay 1
00222 ;
00223 ; goto rychle4
00224
00225 ;______________________________________________________________
00226
00227 ;----------------------------
00228 ; Definice promenych
00229 ;----------------------------
00230
00231 cblock
00232
0000000E 00233 CT1
0000000F 00234 CT2
00000010 00235 CT3
00000011 00236 CT4
00000012 00237 CT5
00000013 00238 CT6
00239 endc
00240
00241 end
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 10
 
 
SYMBOL TABLE
LABEL VALUE
 
CMP
CT1 0000000E
CT2 0000000F
CT3 00000010
CT4 00000011
CT5 00000012
CT6 00000013
Delay
Delay01
Delay1ms 00000005
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
IND0 00000000
INTCON 0000000B
MainLoop 0000002A
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Start 0000001B
TMR0 00000001
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
MPASM 02.80 Released BUDIC.ASM 7-22-2002 17:00:57 PAGE 11
 
 
SYMBOL TABLE
LABEL VALUE
 
_ZERO 00000002
__16C84__ 00000000
__16F84 00000001
page0
page1
rozj 00000032
rychle 00000058
rychle2 0000007B
rychle3 0000009E
us10 0000000C
xxx 0000000D
yyy 0000000C
zap 00000017
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
 
All other memory blocks unused.
 
Program Memory Words Used: 189
Program Memory Words Free: 835
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/3Fmotor/PRG.BAT
0,0 → 1,8
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
cls
picpgr program budic.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
/programy/ASM/3Fmotor/Prg.pif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor/Run.pif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor/budic.asm
0,0 → 1,230
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
zap:
movf CT2, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
return
;----------------------------------------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
 
movlw 250 ; Pocet otacek jednoho kroku zrychleni
movwf CT3
movlw 150
movwf CT4
 
movlw 200
movwf CT5
 
movlw 250
movwf CT5
 
rozj: ; Rozjezd
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 5
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 4
 
bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
Delay 4
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
decfsz CT3, f
goto rozj
 
 
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 3
 
decfsz CT4, f
goto rychle
 
rychle2:
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 3
decfsz CT5, f
goto rychle2
 
rychle3:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 1
 
movlw 0
movwf PORTA
Delay 2
; decfsz CT3, f
goto rychle3
 
;rychle4:
; bsf PORTA, 0
; bcf PORTA, 1 ;100
; bcf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; bcf PORTA, 0 ;010
; bsf PORTA, 1
; bcf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; bcf PORTA, 0 ;001
; bcf PORTA, 1
; bsf PORTA, 2
; Delay 1
;
; movlw 0
; movwf PORTA
; Delay 1
;
; goto rychle4
 
;______________________________________________________________
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
CT3
CT4
CT5
CT6
endc
 
end
/programy/ASM/3Fmotor/budic.pjt
0,0 → 1,89
[PROJECT]
Target=BUDIC.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=.
Library=
LinkerScript=
 
[Target Data]
FileList=BUDIC.ASM;
BuildTool=MPASM
OptionString=
AdditionalOptionString=
BuildRequired=0
 
[BUDIC.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=1
 
[Windows]
1=0000 d:\@kaklik\programy\3fmotor\budic.asm 44 44 690 377 3 0
0=0004 44 44 690 377 3 0
 
[mru-list]
1=d:\@kaklik\programy\3fmotor\budic.asm
2=d:\@kaklik\programy\blik\ovlad.asm
3=d:\@kaklik\programy\blik\delay.asm
4=d:\@kaklik\programy\ir_blik\delay.asm
5=d:\@kaklik\programy\ir_blik\ovlad.asm
 
/programy/ASM/3Fmotor/delay.asm
0,0 → 1,57
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf yyy
call us10
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz xxx, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto us10
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/3Fmotor/run.BAT
0,0 → 1,8
@echo off
picpgr run
pause
picpgr stop
pause
picpgr run
pause
picpgr stop
/programy/ASM/3Fmotor/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor1/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/3Fmotor1/BUDIC1.$$$
0,0 → 1,229
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
zap:
movf CT2, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
return
;----------------------------------------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
 
movlw 250 ; Pocet otacek jednoho kroku zrychleni
movwf CT3
movlw 170
movwf CT4
 
movlw 150
movwf CT5
 
movlw 250
movwf CT5
 
rozj: ; Rozjezd
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 6
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
Delay 6
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 5
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
Delay 5
 
decfsz CT3, f
goto rozj
 
 
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
decfsz CT4, f
goto rychle
 
rychle2:
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
decfsz CT5, f
goto rychle2
 
rychle3:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
decfsz CT3, f
goto rychle3
 
rychle4:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 1
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 1
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 1
 
goto rychle4
;______________________________________________________________
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
CT3
CT4
CT5
CT6
endc
 
end
/programy/ASM/3Fmotor1/BUDIC1.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor1/BUDIC1.ERR
--- 3Fmotor1/BUDIC1.HEX (nonexistent)
+++ 3Fmotor1/BUDIC1.HEX (revision 6)
@@ -0,0 +1,31 @@
+:020000001B28BB
+:080008001B2863308C000C2062
+:100010008D0B052800000800000000000000000013
+:100020000000000000008C0B0C28000008000F08E6
+:100030008D000520080083160030810000308B0001
+:100040008316003085004330860081178312030138
+:1000500085008600FA309000AA3091009630920018
+:10006000FA30920005148510051106308D00052028
+:1000700005148514051106308D0005200510851422
+:10008000051105308D000520051085140515053076
+:100090008D00052005108510051505308D00052003
+:1000A00005148510051505308D000520900B3228AC
+:1000B00005148510051103308D00052000308500E2
+:1000C00005308D00052005108514051103308D00C5
+:1000D00005200030850005308D00052005108510B5
+:1000E000051503308D0005200030850005308D009A
+:1000F0000520910B582805148510051103308D003B
+:1001000005200030850003308D0005200510851482
+:10011000051103308D0005200030850003308D006F
+:10012000052005108510051503308D0005200030D1
+:10013000850003308D000520920B7B280514851067
+:10014000051103308D0005200030850002308D0040
+:10015000052005108514051103308D0005200030A1
+:10016000850002308D00052005108510051503302F
+:100170008D0005200030850002308D000520900B99
+:100180009E2805148510051102308D0005200030D1
+:10019000850002308D000520051085140511023000
+:1001A0008D0005200030850002308D0005200510EF
+:1001B0008510051502308D000520003085000230C5
+:0601C0008D000520C1289E
+:00000001FF
/programy/ASM/3Fmotor1/BUDIC1.LST
0,0 → 1,640
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
0000 00003 org 0
00004
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000 281B 00005 goto Start
00006 ;--------------------
0004 00007 org 4
00008 ;--------------------
0004 281B 00009 goto Start
00010
00011 #include Delay.asm
00001 ;--- Macro na spozdeni 1ms az 255ms ---
00002 Delay macro ms
00003 movlw ms
00004 movwf xxx
00005 call Delay1ms
00006 endm
00007
00008 ;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
00009 Delay01 macro us
00010 movlw us
00011 movwf yyy
00012 call us10
00013
00014 nop
00015 nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
00016 nop
00017 return
00018 endm
00019 ;--- Spozdeni v nasobcich 1ms+2us ----
00020
0005 00021 Delay1ms:
0005 3063 00022 movlw 99 ; 1 ms
0006 008C 00023 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0007 200C 00024 call us10
00025
0008 0B8D 00026 decfsz xxx, f
0009 2805 00027 goto Delay1ms
000A 0000 00028 nop
00029 ;---------------------------------
000B 0008 00030 return ;2us
00031
00032 ;--- Spozdeni v nasobcich 10us ----
000C 00033 us10: ; Prodleva (CT1 * 10us)
000C 0000 00034 nop
000D 0000 00035 nop
000E 0000 00036 nop
000F 0000 00037 nop
0010 0000 00038 nop
0011 0000 00039 nop
0012 0000 00040 nop
0013 0B8C 00041 decfsz yyy, f
0014 280C 00042 goto us10
0015 0000 00043 nop
0016 0008 00044 return
00045 ;-------------------------
00046
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00047 ;----------------------------
00048 ; Definice promenych
00049 ;----------------------------
00050
00051 cblock
00052
0000000C 00053 yyy
0000000D 00054 xxx
00055
00056 endc
00057
00012
0017 00013 zap:
0017 080F 00014 movf CT2, w
0018 008D 00015 movwf xxx ;xxx promena z delay.asm
0019 2005 00016 call Delay1ms
001A 0008 00017 return
00018 ;----------------------------------------------------
00019
001B 00020 Start:
00021 page1
001B 1683 M bsf STATUS,_RP0
001C 3000 00022 movlw 00000000B ; inicializace citace a prescaleru
001D 0081 00023 movwf TMR0
001E 3000 00024 movlw 00000000B ; konfigurace preruseni
001F 008B 00025 movwf INTCON
00026
00027 page1
0020 1683 M bsf STATUS,_RP0
0021 3000 00028 movlw 00000000B ; nastaveni portu na vstup nebo vystup
0022 0085 00029 movwf PORTA ; 1=vstup 0=vystup
0023 3043 00030 movlw 01000011B
0024 0086 00031 movwf PORTB
00032
0025 1781 00033 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00034
00035 page0
0026 1283 M bcf STATUS,_RP0
00036
0027 0103 00037 clrw ; vynulovani portu
0028 0085 00038 movwf PORTA
0029 0086 00039 movwf PORTB
00040
00041
002A 00042 MainLoop:
00043
002A 30FA 00044 movlw 250 ; Pocet otacek jednoho kroku zrychleni
002B 0090 00045 movwf CT3
00046
002C 30AA 00047 movlw 170
002D 0091 00048 movwf CT4
00049
002E 3096 00050 movlw 150
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
002F 0092 00051 movwf CT5
00052
0030 30FA 00053 movlw 250
0031 0092 00054 movwf CT5
00055
0032 00056 rozj: ; Rozjezd
0032 1405 00057 bsf PORTA, 0
0033 1085 00058 bcf PORTA, 1 ;100
0034 1105 00059 bcf PORTA, 2
00060 Delay 6
0035 3006 M movlw 6
0036 008D M movwf xxx
0037 2005 M call Delay1ms
00061
00062
0038 1405 00063 bsf PORTA, 0 ;110
0039 1485 00064 bsf PORTA, 1
003A 1105 00065 bcf PORTA, 2
00066 Delay 6
003B 3006 M movlw 6
003C 008D M movwf xxx
003D 2005 M call Delay1ms
00067
003E 1005 00068 bcf PORTA, 0 ;010
003F 1485 00069 bsf PORTA, 1
0040 1105 00070 bcf PORTA, 2
00071 Delay 5
0041 3005 M movlw 5
0042 008D M movwf xxx
0043 2005 M call Delay1ms
00072
0044 1005 00073 bcf PORTA, 0 ;011
0045 1485 00074 bsf PORTA, 1
0046 1505 00075 bsf PORTA, 2
00076 Delay 5
0047 3005 M movlw 5
0048 008D M movwf xxx
0049 2005 M call Delay1ms
00077
004A 1005 00078 bcf PORTA, 0 ;001
004B 1085 00079 bcf PORTA, 1
004C 1505 00080 bsf PORTA, 2
00081 Delay 5
004D 3005 M movlw 5
004E 008D M movwf xxx
004F 2005 M call Delay1ms
00082
0050 1405 00083 bsf PORTA, 0 ;101
0051 1085 00084 bcf PORTA, 1
0052 1505 00085 bsf PORTA, 2
00086 Delay 5
0053 3005 M movlw 5
0054 008D M movwf xxx
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 6
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0055 2005 M call Delay1ms
00087
0056 0B90 00088 decfsz CT3, f
0057 2832 00089 goto rozj
00090
00091
0058 00092 rychle:
0058 1405 00093 bsf PORTA, 0
0059 1085 00094 bcf PORTA, 1 ;100
005A 1105 00095 bcf PORTA, 2
00096 Delay 3
005B 3003 M movlw 3
005C 008D M movwf xxx
005D 2005 M call Delay1ms
00097
005E 3000 00098 movlw 0
005F 0085 00099 movwf PORTA
00100 Delay 5
0060 3005 M movlw 5
0061 008D M movwf xxx
0062 2005 M call Delay1ms
00101
0063 1005 00102 bcf PORTA, 0 ;010
0064 1485 00103 bsf PORTA, 1
0065 1105 00104 bcf PORTA, 2
00105 Delay 3
0066 3003 M movlw 3
0067 008D M movwf xxx
0068 2005 M call Delay1ms
00106
0069 3000 00107 movlw 0
006A 0085 00108 movwf PORTA
00109 Delay 5
006B 3005 M movlw 5
006C 008D M movwf xxx
006D 2005 M call Delay1ms
00110
006E 1005 00111 bcf PORTA, 0 ;001
006F 1085 00112 bcf PORTA, 1
0070 1505 00113 bsf PORTA, 2
00114 Delay 3
0071 3003 M movlw 3
0072 008D M movwf xxx
0073 2005 M call Delay1ms
00115
0074 3000 00116 movlw 0
0075 0085 00117 movwf PORTA
00118 Delay 5
0076 3005 M movlw 5
0077 008D M movwf xxx
0078 2005 M call Delay1ms
00119
0079 0B91 00120 decfsz CT4, f
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 7
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
007A 2858 00121 goto rychle
00122
007B 00123 rychle2:
00124
007B 1405 00125 bsf PORTA, 0
007C 1085 00126 bcf PORTA, 1 ;100
007D 1105 00127 bcf PORTA, 2
00128 Delay 3
007E 3003 M movlw 3
007F 008D M movwf xxx
0080 2005 M call Delay1ms
00129
0081 3000 00130 movlw 0
0082 0085 00131 movwf PORTA
00132 Delay 3
0083 3003 M movlw 3
0084 008D M movwf xxx
0085 2005 M call Delay1ms
00133
0086 1005 00134 bcf PORTA, 0 ;010
0087 1485 00135 bsf PORTA, 1
0088 1105 00136 bcf PORTA, 2
00137 Delay 3
0089 3003 M movlw 3
008A 008D M movwf xxx
008B 2005 M call Delay1ms
00138
008C 3000 00139 movlw 0
008D 0085 00140 movwf PORTA
00141 Delay 3
008E 3003 M movlw 3
008F 008D M movwf xxx
0090 2005 M call Delay1ms
00142
0091 1005 00143 bcf PORTA, 0 ;001
0092 1085 00144 bcf PORTA, 1
0093 1505 00145 bsf PORTA, 2
00146 Delay 3
0094 3003 M movlw 3
0095 008D M movwf xxx
0096 2005 M call Delay1ms
00147
0097 3000 00148 movlw 0
0098 0085 00149 movwf PORTA
00150 Delay 3
0099 3003 M movlw 3
009A 008D M movwf xxx
009B 2005 M call Delay1ms
009C 0B92 00151 decfsz CT5, f
009D 287B 00152 goto rychle2
00153
009E 00154 rychle3:
009E 1405 00155 bsf PORTA, 0
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 8
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
009F 1085 00156 bcf PORTA, 1 ;100
00A0 1105 00157 bcf PORTA, 2
00158 Delay 3
00A1 3003 M movlw 3
00A2 008D M movwf xxx
00A3 2005 M call Delay1ms
00159
00A4 3000 00160 movlw 0
00A5 0085 00161 movwf PORTA
00162 Delay 2
00A6 3002 M movlw 2
00A7 008D M movwf xxx
00A8 2005 M call Delay1ms
00163
00A9 1005 00164 bcf PORTA, 0 ;010
00AA 1485 00165 bsf PORTA, 1
00AB 1105 00166 bcf PORTA, 2
00167 Delay 3
00AC 3003 M movlw 3
00AD 008D M movwf xxx
00AE 2005 M call Delay1ms
00168
00AF 3000 00169 movlw 0
00B0 0085 00170 movwf PORTA
00171 Delay 2
00B1 3002 M movlw 2
00B2 008D M movwf xxx
00B3 2005 M call Delay1ms
00172
00B4 1005 00173 bcf PORTA, 0 ;001
00B5 1085 00174 bcf PORTA, 1
00B6 1505 00175 bsf PORTA, 2
00176 Delay 3
00B7 3003 M movlw 3
00B8 008D M movwf xxx
00B9 2005 M call Delay1ms
00177
00BA 3000 00178 movlw 0
00BB 0085 00179 movwf PORTA
00180 Delay 2
00BC 3002 M movlw 2
00BD 008D M movwf xxx
00BE 2005 M call Delay1ms
00BF 0B90 00181 decfsz CT3, f
00C0 289E 00182 goto rychle3
00183
00C1 00184 rychle4:
00C1 1405 00185 bsf PORTA, 0
00C2 1085 00186 bcf PORTA, 1 ;100
00C3 1105 00187 bcf PORTA, 2
00188 Delay 2
00C4 3002 M movlw 2
00C5 008D M movwf xxx
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 9
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00C6 2005 M call Delay1ms
00189
00C7 3000 00190 movlw 0
00C8 0085 00191 movwf PORTA
00192 Delay 2
00C9 3002 M movlw 2
00CA 008D M movwf xxx
00CB 2005 M call Delay1ms
00193
00CC 1005 00194 bcf PORTA, 0 ;010
00CD 1485 00195 bsf PORTA, 1
00CE 1105 00196 bcf PORTA, 2
00197 Delay 2
00CF 3002 M movlw 2
00D0 008D M movwf xxx
00D1 2005 M call Delay1ms
00198
00D2 3000 00199 movlw 0
00D3 0085 00200 movwf PORTA
00201 Delay 2
00D4 3002 M movlw 2
00D5 008D M movwf xxx
00D6 2005 M call Delay1ms
00202
00D7 1005 00203 bcf PORTA, 0 ;001
00D8 1085 00204 bcf PORTA, 1
00D9 1505 00205 bsf PORTA, 2
00206 Delay 2
00DA 3002 M movlw 2
00DB 008D M movwf xxx
00DC 2005 M call Delay1ms
00207
00DD 3000 00208 movlw 0
00DE 0085 00209 movwf PORTA
00210 Delay 2
00DF 3002 M movlw 2
00E0 008D M movwf xxx
00E1 2005 M call Delay1ms
00211
00E2 28C1 00212 goto rychle4
00213 ;______________________________________________________________
00214
00215 ;----------------------------
00216 ; Definice promenych
00217 ;----------------------------
00218
00219 cblock
00220
0000000E 00221 CT1
0000000F 00222 CT2
00000010 00223 CT3
00000011 00224 CT4
00000012 00225 CT5
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 10
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00000013 00226 CT6
00227 endc
00228
00229 end
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 11
 
 
SYMBOL TABLE
LABEL VALUE
 
CMP
CT1 0000000E
CT2 0000000F
CT3 00000010
CT4 00000011
CT5 00000012
CT6 00000013
Delay
Delay01
Delay1ms 00000005
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
IND0 00000000
INTCON 0000000B
MainLoop 0000002A
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Start 0000001B
TMR0 00000001
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
MPASM 02.80 Released BUDIC1.ASM 7-30-2002 15:15:48 PAGE 12
 
 
SYMBOL TABLE
LABEL VALUE
 
_ZERO 00000002
__16C84__ 00000000
__16F84 00000001
page0
page1
rozj 00000032
rychle 00000058
rychle2 0000007B
rychle3 0000009E
rychle4 000000C1
us10 0000000C
xxx 0000000D
yyy 0000000C
zap 00000017
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXX------------- ----------------
 
All other memory blocks unused.
 
Program Memory Words Used: 224
Program Memory Words Free: 800
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/3Fmotor1/PRG.BAT
0,0 → 1,8
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
cls
picpgr program budic1.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
/programy/ASM/3Fmotor1/PRG.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor1/Run.pif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/3Fmotor1/budic.pjt
0,0 → 1,90
[PROJECT]
Target=BUDIC1.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=.
Library=
LinkerScript=
 
[Target Data]
FileList=BUDIC1.ASM;
BuildTool=MPASM
OptionString=
AdditionalOptionString=
BuildRequired=0
 
[BUDIC.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=0
 
[BUDIC1.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=d:\@kaklik\programy\3fmotor\budic.asm
2=d:\@kaklik\programy\3fmotor1\budic1.asm
3=d:\@kaklik\programy\3fmotor1\budic.asm
/programy/ASM/3Fmotor1/budic1.asm
0,0 → 1,229
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
zap:
movf CT2, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
return
;----------------------------------------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
 
movlw 250 ; Pocet otacek jednoho kroku zrychleni
movwf CT3
movlw 170
movwf CT4
 
movlw 150
movwf CT5
 
movlw 250
movwf CT5
 
rozj: ; Rozjezd
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 6
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
Delay 6
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
Delay 5
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 5
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
Delay 5
 
decfsz CT3, f
goto rozj
 
 
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 5
 
decfsz CT4, f
goto rychle
 
rychle2:
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 3
decfsz CT5, f
goto rychle2
 
rychle3:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
movlw 0
movwf PORTA
Delay 2
decfsz CT3, f
goto rychle3
 
rychle4:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 2
 
movlw 0
movwf PORTA
Delay 2
 
goto rychle4
;______________________________________________________________
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
CT3
CT4
CT5
CT6
endc
 
end
/programy/ASM/3Fmotor1/delay.asm
0,0 → 1,57
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf yyy
call us10
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz xxx, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto us10
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/3Fmotor1/run.BAT
0,0 → 1,8
@echo off
picpgr run
pause
picpgr stop
pause
picpgr run
pause
picpgr stop
/programy/ASM/3Fmotor1/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/blik/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/blik/DELAY.$$$
0,0 → 1,57
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf CT2
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf CT1
call us10
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf CT1 ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz CT2, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz CT1, f
goto us10
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
/programy/ASM/blik/OVLAD.$$$
0,0 → 1,147
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
movlw 255
movwf CT1
movlw 252
movwf CT2
rozj:
 
decf CT1, f
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
call zap
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
call zap
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
call zap
 
decfsz CT2, f
goto ble
goto rychle
 
ble: bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
call zap
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
call zap
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
call zap
 
zap:
movf CT1, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
 
;----------------------------------------------------
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
; bsf PORTA, 0 ;110
; bsf PORTA, 1
; bcf PORTA, 2
; Delay
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
; bcf PORTA, 0 ;011
; bsf PORTA, 1
; bsf PORTA, 2
; Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
; bsf PORTA, 0 ;101
; bcf PORTA, 1
; bsf PORTA, 2
; Delay 2
goto rychle
;______________________________________________________________
 
bcf PORTA, 2
bcf PORTA, 1
 
smycka:
btfss PORTB, 0
goto LEDon
goto smycka
LEDon:
bsf PORTA, 3 ;Rozsvit LED
Delay 250
bcf PORTA, 3 ;Zhasni LED
Delay 250
goto smycka
;---------------
 
 
 
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
end
/programy/ASM/blik/OVLAD.BKX
0,0 → 1,8
:020000000428D2
:08000800831600308100003076
:100010008B008316003085004330860081178312E1
:100020000301850086008615061685152320851197
:10003000232005118510061C1E281B28851523204A
:10004000851123201B28FF308C008D008C0B262867
:060050008D0B26280800BC
:00000001FF
/programy/ASM/blik/OVLAD.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/blik/OVLAD.ERR
--- blik/OVLAD.HEX (nonexistent)
+++ blik/OVLAD.HEX (revision 6)
@@ -0,0 +1,16 @@
+:020000001728BF
+:08000800172863308C000C2066
+:100010008D0B052800000800000000000000000013
+:100020000000000000008C0B0C2800000800831664
+:100030000030810000308B00831600308500433093
+:10004000860081178312030185008600FF308E0031
+:10005000FC308F008E030514851005114620051411
+:1000600085140511462005108514051146208F0BB7
+:100070003A284928051085140515462005108510D5
+:100080000515462005148510051546200E088D001F
+:10009000052005148510051103308D00052005107D
+:1000A0008514051103308D000520051085100515F8
+:1000B00003308D000520492805118510061C612894
+:1000C0005E288515FA308D0005208511FA308D00E7
+:0400D00005205E2881
+:00000001FF
/programy/ASM/blik/OVLAD.LST
0,0 → 1,459
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
0000 00003 org 0
00004
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000 2817 00005 goto Start
00006 ;--------------------
0004 00007 org 4
00008 ;--------------------
0004 2817 00009 goto Start
00010
00011 #include Delay.asm
00001 ;--- Macro na spozdeni 1ms az 255ms ---
00002 Delay macro ms
00003 movlw ms
00004 movwf xxx
00005 call Delay1ms
00006 endm
00007
00008 ;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
00009 Delay01 macro us
00010 movlw us
00011 movwf yyy
00012 call us10
00013
00014 nop
00015 nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
00016 nop
00017 return
00018 endm
00019 ;--- Spozdeni v nasobcich 1ms+2us ----
00020
0005 00021 Delay1ms:
0005 3063 00022 movlw 99 ; 1 ms
0006 008C 00023 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0007 200C 00024 call us10
00025
0008 0B8D 00026 decfsz xxx, f
0009 2805 00027 goto Delay1ms
000A 0000 00028 nop
00029 ;---------------------------------
000B 0008 00030 return ;2us
00031
00032 ;--- Spozdeni v nasobcich 10us ----
000C 00033 us10: ; Prodleva (CT1 * 10us)
000C 0000 00034 nop
000D 0000 00035 nop
000E 0000 00036 nop
000F 0000 00037 nop
0010 0000 00038 nop
0011 0000 00039 nop
0012 0000 00040 nop
0013 0B8C 00041 decfsz yyy, f
0014 280C 00042 goto us10
0015 0000 00043 nop
0016 0008 00044 return
00045 ;-------------------------
00046
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00047 ;----------------------------
00048 ; Definice promenych
00049 ;----------------------------
00050
00051 cblock
00052
0000000C 00053 yyy
0000000D 00054 xxx
00055
00056 endc
00057
00012
0017 00013 Start:
00014 page1
0017 1683 M bsf STATUS,_RP0
0018 3000 00015 movlw 00000000B ; inicializace citace a prescaleru
0019 0081 00016 movwf TMR0
001A 3000 00017 movlw 00000000B ; konfigurace preruseni
001B 008B 00018 movwf INTCON
00019
00020 page1
001C 1683 M bsf STATUS,_RP0
001D 3000 00021 movlw 00000000B ; nastaveni portu na vstup nebo vystup
001E 0085 00022 movwf PORTA ; 1=vstup 0=vystup
001F 3043 00023 movlw 01000011B
0020 0086 00024 movwf PORTB
00025
0021 1781 00026 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00027
00028 page0
0022 1283 M bcf STATUS,_RP0
00029
0023 0103 00030 clrw ; vynulovani portu
0024 0085 00031 movwf PORTA
0025 0086 00032 movwf PORTB
00033
00034
0026 00035 MainLoop:
0026 30FF 00036 movlw 255
0027 008E 00037 movwf CT1
0028 30FC 00038 movlw 252
0029 008F 00039 movwf CT2
002A 00040 rozj:
00041
002A 038E 00042 decf CT1, f
00043
002B 1405 00044 bsf PORTA, 0
002C 1085 00045 bcf PORTA, 1 ;100
002D 1105 00046 bcf PORTA, 2
002E 2046 00047 call zap
00048
002F 1405 00049 bsf PORTA, 0 ;110
0030 1485 00050 bsf PORTA, 1
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0031 1105 00051 bcf PORTA, 2
0032 2046 00052 call zap
00053
0033 1005 00054 bcf PORTA, 0 ;010
0034 1485 00055 bsf PORTA, 1
0035 1105 00056 bcf PORTA, 2
0036 2046 00057 call zap
00058
0037 0B8F 00059 decfsz CT2, f
0038 283A 00060 goto ble
0039 2849 00061 goto rychle
00062
003A 1005 00063 ble: bcf PORTA, 0 ;011
003B 1485 00064 bsf PORTA, 1
003C 1505 00065 bsf PORTA, 2
003D 2046 00066 call zap
00067
003E 1005 00068 bcf PORTA, 0 ;001
003F 1085 00069 bcf PORTA, 1
0040 1505 00070 bsf PORTA, 2
0041 2046 00071 call zap
00072
0042 1405 00073 bsf PORTA, 0 ;101
0043 1085 00074 bcf PORTA, 1
0044 1505 00075 bsf PORTA, 2
0045 2046 00076 call zap
00077
0046 00078 zap:
0046 080E 00079 movf CT1, w
0047 008D 00080 movwf xxx ;xxx promena z delay.asm
0048 2005 00081 call Delay1ms
00082
00083 ;----------------------------------------------------
0049 00084 rychle:
0049 1405 00085 bsf PORTA, 0
004A 1085 00086 bcf PORTA, 1 ;100
004B 1105 00087 bcf PORTA, 2
00088 Delay 3
004C 3003 M movlw 3
004D 008D M movwf xxx
004E 2005 M call Delay1ms
00089
00090 ; bsf PORTA, 0 ;110
00091 ; bsf PORTA, 1
00092 ; bcf PORTA, 2
00093 ; Delay
00094
004F 1005 00095 bcf PORTA, 0 ;010
0050 1485 00096 bsf PORTA, 1
0051 1105 00097 bcf PORTA, 2
00098 Delay 3
0052 3003 M movlw 3
0053 008D M movwf xxx
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 6
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0054 2005 M call Delay1ms
00099
00100 ; bcf PORTA, 0 ;011
00101 ; bsf PORTA, 1
00102 ; bsf PORTA, 2
00103 ; Delay 2
00104
0055 1005 00105 bcf PORTA, 0 ;001
0056 1085 00106 bcf PORTA, 1
0057 1505 00107 bsf PORTA, 2
00108 Delay 3
0058 3003 M movlw 3
0059 008D M movwf xxx
005A 2005 M call Delay1ms
00109
00110 ; bsf PORTA, 0 ;101
00111 ; bcf PORTA, 1
00112 ; bsf PORTA, 2
00113 ; Delay 2
005B 2849 00114 goto rychle
00115 ;______________________________________________________________
00116
005C 1105 00117 bcf PORTA, 2
005D 1085 00118 bcf PORTA, 1
00119
005E 00120 smycka:
005E 1C06 00121 btfss PORTB, 0
005F 2861 00122 goto LEDon
0060 285E 00123 goto smycka
0061 00124 LEDon:
0061 1585 00125 bsf PORTA, 3 ;Rozsvit LED
00126 Delay 250
0062 30FA M movlw 250
0063 008D M movwf xxx
0064 2005 M call Delay1ms
0065 1185 00127 bcf PORTA, 3 ;Zhasni LED
00128 Delay 250
0066 30FA M movlw 250
0067 008D M movwf xxx
0068 2005 M call Delay1ms
0069 285E 00129 goto smycka
00130 ;---------------
00131
00132
00133
00134
00135
00136 ;----------------------------
00137 ; Definice promenych
00138 ;----------------------------
00139
00140 cblock
00141
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 7
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000000E 00142 CT1
0000000F 00143 CT2
00144
00145 endc
00146
00147 end
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 8
 
 
SYMBOL TABLE
LABEL VALUE
 
CMP
CT1 0000000E
CT2 0000000F
Delay
Delay01
Delay1ms 00000005
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
IND0 00000000
INTCON 0000000B
LEDon 00000061
MainLoop 00000026
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Start 00000017
TMR0 00000001
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
_ZERO 00000002
__16C84__ 00000000
__16F84 00000001
MPASM 02.80 Released OVLAD.ASM 7-21-2002 12:49:43 PAGE 9
 
 
SYMBOL TABLE
LABEL VALUE
 
ble 0000003A
page0
page1
rozj 0000002A
rychle 00000049
smycka 0000005E
us10 0000000C
xxx 0000000D
yyy 0000000C
zap 00000046
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXX------ ----------------
 
All other memory blocks unused.
 
Program Memory Words Used: 103
Program Memory Words Free: 921
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/blik/PRG.BAT
0,0 → 1,10
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
pause
rem cls
picpgr program ovlad.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
pause
/programy/ASM/blik/PRG.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/blik/RUN.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/blik/delay.asm
0,0 → 1,57
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf yyy
call us10
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz xxx, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto us10
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/blik/ovlad.asm
0,0 → 1,162
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
movlw 255
movwf CT2
movlw 252
movwf CT1
rozj:
 
decf CT1, f
 
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
call zap
 
bsf PORTA, 0 ;110
bsf PORTA, 1
bcf PORTA, 2
call zap
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
call zap
 
decfsz CT2, f
goto ble
goto rychle
 
ble: bcf PORTA, 0 ;011
bsf PORTA, 1
bsf PORTA, 2
call zap
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
call zap
 
bsf PORTA, 0 ;101
bcf PORTA, 1
bsf PORTA, 2
call zap
 
zap: decfsz
movf CT3, w
movwf xxx ;xxx promena z delay.asm
call Delay1ms
 
;----------------------------------------------------
rychle:
bsf PORTA, 0
bcf PORTA, 1 ;100
bcf PORTA, 2
Delay 3
 
; bsf PORTA, 0 ;110
; bsf PORTA, 1
; bcf PORTA, 2
; Delay
 
bcf PORTA, 0 ;010
bsf PORTA, 1
bcf PORTA, 2
Delay 3
 
; bcf PORTA, 0 ;011
; bsf PORTA, 1
; bsf PORTA, 2
; Delay 2
 
bcf PORTA, 0 ;001
bcf PORTA, 1
bsf PORTA, 2
Delay 3
 
; bsf PORTA, 0 ;101
; bcf PORTA, 1
; bsf PORTA, 2
; Delay 2
goto rychle
;______________________________________________________________
movlw 250
movwf ct2
 
 
 
decfsz ct2
goto
decfsz ct3
 
 
 
 
bcf PORTA, 2
bcf PORTA, 1
 
smycka:
btfss PORTB, 0
goto LEDon
goto smycka
LEDon:
bsf PORTA, 3 ;Rozsvit LED
Delay 250
bcf PORTA, 3 ;Zhasni LED
Delay 250
goto smycka
;--0-------------
 
 
 
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
CT3
CT4
 
endc
 
end
/programy/ASM/blik/ovlad.pjt
0,0 → 1,93
[PROJECT]
Target=OVLAD.HEX.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=
Library=
LinkerScript=
 
[Target Data]
FileList=;
BuildTool=MPASM
OptionString=
AdditionalOptionString=W÷n
BuildRequired=1
 
[OVLAD.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=1
 
[]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=d:\@kaklik\programy\blik\ovlad.asm
2=d:\@kaklik\programy\blik\delay.asm
3=d:\@kaklik\programy\ir_blik\delay.asm
4=d:\@kaklik\programy\ir_blik\ovlad.asm
5=d:\@kaklik\programy\prenos\main.asm
 
/programy/ASM/blik/run.BAT
0,0 → 1,8
@echo off
picpgr run
pause
picpgr stop
pause
picpgr run
pause
picpgr stop
/programy/ASM/blik/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/ir_blik/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/ir_blik/DELAY.$$$
0,0 → 1,50
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Spozdeni v nasobcich 1.002ms ----
Jednou:
nop
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz xxx, f
goto Jednou
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (yyy * 10us)+3us
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto us10
nop
nop
nop
nop
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/ir_blik/OVLAD.$$$
0,0 → 1,75
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
bsf PORTB, 3 ; Pridrz napajeni
bsf PORTB, 4
bsf PORTA, 3 ;Rozsvit LED
Delay 250ms
 
bcf PORTA, 3 ;Zhasni LED
 
Delay 250ms
 
 
bcf PORTA, 2
bcf PORTA, 1
smycka:
btfss PORTB, 0
goto LEDon
goto smycka
LEDon:
bsf PORTA, 3 ;Rozsvit LED
Delay 250ms
bcf PORTA, 3 ;Zhasni LED
Delay 250ms
goto smycka
;---------------
 
 
 
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
end
/programy/ASM/ir_blik/OVLAD.BKX
0,0 → 1,8
:020000000428D2
:08000800831600308100003076
:100010008B008316003085004330860081178312E1
:100020000301850086008615061685152320851197
:10003000232005118510061C1E281B28851523204A
:10004000851123201B28FF308C008D008C0B262867
:060050008D0B26280800BC
:00000001FF
/programy/ASM/ir_blik/OVLAD.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/ir_blik/OVLAD.ERR
--- ir_blik/OVLAD.HEX (nonexistent)
+++ ir_blik/OVLAD.HEX (revision 6)
@@ -0,0 +1,11 @@
+:020000001A28BC
+:080008001A28000063308C008F
+:100010000C208D0B052808000000000000000000E7
+:10002000000000008C0B0C28000000000000000005
+:100030000000080083160030810000308B0083161A
+:10004000003085004330860081178312030185004C
+:100050008600861506168515FA308D000620851156
+:10006000FA308D00062005118510061C3828352829
+:100070008515FA308D0006208511FA308D00062096
+:02008000352821
+:00000001FF
/programy/ASM/ir_blik/OVLAD.LST
0,0 → 1,361
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
0000 00003 org 0
00004
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000 281A 00005 goto Start
00006 ;--------------------
0004 00007 org 4
00008 ;--------------------
0004 281A 00009 goto Start
00010
00011 #include Delay.asm
00001 ;--- Macro na spozdeni 1ms az 255ms ---
00002 Delay macro _ms
00003 movlw _ms
00004 movwf xxx
00005 call Delay1ms
00006 endm
00007
00008 ;--- Spozdeni v nasobcich 1.002ms ----
0005 00009 Jednou:
0005 0000 00010 nop
0006 00011 Delay1ms:
0006 3063 00012 movlw 99 ; 1 ms
0007 008C 00013 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0008 200C 00014 call us10
00015
0009 0B8D 00016 decfsz xxx, f
000A 2805 00017 goto Jednou
00018 ;---------------------------------
000B 0008 00019 return ;2us
00020
00021 ;--- Spozdeni v nasobcich 10us ----
000C 00022 us10: ; Prodleva (yyy * 10us)+3us
00023
000C 0000 00024 nop
000D 0000 00025 nop
000E 0000 00026 nop
000F 0000 00027 nop
0010 0000 00028 nop
0011 0000 00029 nop
0012 0B8C 00030 decfsz yyy, f
0013 280C 00031 goto us10
0014 0000 00032 nop
0015 0000 00033 nop
0016 0000 00034 nop
0017 0000 00035 nop
0018 0000 00036 nop
0019 0008 00037 return
00038 ;-------------------------
00039
00040 ;----------------------------
00041 ; Definice promenych
00042 ;----------------------------
00043
00044 cblock
00045
0000000C 00046 yyy
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000000D 00047 xxx
00048
00049 endc
00050
00012
001A 00013 Start:
00014 page1
001A 1683 M bsf STATUS,_RP0
001B 3000 00015 movlw 00000000B ; inicializace citace a prescaleru
001C 0081 00016 movwf TMR0
001D 3000 00017 movlw 00000000B ; konfigurace preruseni
001E 008B 00018 movwf INTCON
00019
00020 page1
001F 1683 M bsf STATUS,_RP0
0020 3000 00021 movlw 00000000B ; nastaveni portu na vstup nebo vystup
0021 0085 00022 movwf PORTA ; 1=vstup 0=vystup
0022 3043 00023 movlw 01000011B
0023 0086 00024 movwf PORTB
00025
0024 1781 00026 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00027
00028 page0
0025 1283 M bcf STATUS,_RP0
00029
0026 0103 00030 clrw ; vynulovani portu
0027 0085 00031 movwf PORTA
0028 0086 00032 movwf PORTB
00033
0029 00034 MainLoop:
0029 1586 00035 bsf PORTB, 3 ; Pridrz napajeni
002A 1606 00036 bsf PORTB, 4
002B 1585 00037 bsf PORTA, 3 ;Rozsvit LED
00038
00039 Delay 250
002C 30FA M movlw 250
002D 008D M movwf xxx
002E 2006 M call Delay1ms
00040
002F 1185 00041 bcf PORTA, 3 ;Zhasni LED
00042
00043 Delay 250
0030 30FA M movlw 250
0031 008D M movwf xxx
0032 2006 M call Delay1ms
00044
00045
0033 1105 00046 bcf PORTA, 2
0034 1085 00047 bcf PORTA, 1
0035 00048 smycka:
0035 1C06 00049 btfss PORTB, 0
0036 2838 00050 goto LEDon
0037 2835 00051 goto smycka
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0038 00052 LEDon:
0038 1585 00053 bsf PORTA, 3 ;Rozsvit LED
00054 Delay 250
0039 30FA M movlw 250
003A 008D M movwf xxx
003B 2006 M call Delay1ms
003C 1185 00055 bcf PORTA, 3 ;Zhasni LED
00056 Delay 250
003D 30FA M movlw 250
003E 008D M movwf xxx
003F 2006 M call Delay1ms
0040 2835 00057 goto smycka
00058 ;---------------
00059
00060
00061
00062
00063
00064 ;----------------------------
00065 ; Definice promenych
00066 ;----------------------------
00067
00068 cblock
00069
0000000E 00070 CT1
0000000F 00071 CT2
00072
00073 endc
00074
00075 end
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 6
 
 
SYMBOL TABLE
LABEL VALUE
 
CMP
CT1 0000000E
CT2 0000000F
Delay
Delay1ms 00000006
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
IND0 00000000
INTCON 0000000B
Jednou 00000005
LEDon 00000038
MainLoop 00000029
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Start 0000001A
TMR0 00000001
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
_ZERO 00000002
__16C84__ 00000000
__16F84 00000001
MPASM 02.80 Released OVLAD.ASM 7-12-2002 20:18:51 PAGE 7
 
 
SYMBOL TABLE
LABEL VALUE
 
page0
page1
smycka 00000035
us10 0000000C
xxx 0000000D
yyy 0000000C
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : X--------------- ---------------- ---------------- ----------------
 
All other memory blocks unused.
 
Program Memory Words Used: 62
Program Memory Words Free: 962
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/ir_blik/PRG.BAT
0,0 → 1,9
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
cls
picpgr program ovlad.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
pause
/programy/ASM/ir_blik/PRG.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/ir_blik/RUN.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/ir_blik/delay.asm
0,0 → 1,50
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro _ms
movlw _ms
movwf xxx
call Delay1ms
endm
 
;--- Spozdeni v nasobcich 1.002ms ----
Jednou:
nop
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
 
decfsz xxx, f
goto Jednou
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (yyy * 10us)+3us
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto us10
nop
nop
nop
nop
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/ir_blik/ovlad.asm
0,0 → 1,75
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 00000000B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 01000011B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
MainLoop:
bsf PORTB, 3 ; Pridrz napajeni
bsf PORTB, 4
bsf PORTA, 3 ;Rozsvit LED
Delay 250
 
bcf PORTA, 3 ;Zhasni LED
 
Delay 250
 
 
bcf PORTA, 2
bcf PORTA, 1
smycka:
btfss PORTB, 0
goto LEDon
goto smycka
LEDon:
bsf PORTA, 3 ;Rozsvit LED
Delay 250
bcf PORTA, 3 ;Zhasni LED
Delay 250
goto smycka
;---------------
 
 
 
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
end
/programy/ASM/ir_blik/ovlad.pjt
0,0 → 1,85
[PROJECT]
Target=OVLAD.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=.
Library=
LinkerScript=
 
[Target Data]
FileList=OVLAD.ASM;
BuildTool=MPASM
OptionString=
AdditionalOptionString=
BuildRequired=0
 
[OVLAD.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=0
 
[mru-list]
1=d:\@kaklik\programy\ir_blik\delay.asm
2=d:\@kaklik\programy\ir_blik\ovlad.asm
3=d:\@kaklik\programy\prenos\main.asm
4=d:\@kaklik\programy\prenos\servo.asm
5=d:\@kaklik\programy\ØÍzenÍ~1\chodba\main2.asm
 
/programy/ASM/ir_blik/run.BAT
0,0 → 1,4
@echo off
picpgr run
pause
picpgr stop
/programy/ASM/ir_blik/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/prenos/17C42.H
0,0 → 1,165
NOLIST
 
; rev 1.2 4/06/92
; rev 1.3 4/15/94 removed HIGH and LOW
;***************************************************************
; define special function registers:
#define W 0
#define w 0
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
;
#define LSB 0
#define MSB 7
;
_INC equ 1
_NO_INC equ 0
_LOW equ 0
_HIGH equ 1
;
cblock 0x00
bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7
endc
 
cblock 0x00 ; define banks
bank0,bank1,bank2,bank3
endc
 
cblock 0x00 ; unbanked registers
indf0,fsr0,pcl,pclath,alusta,rtcsta,cpusta,intsta
indf1,fsr1,wreg,rtccl,rtcch,tblptrl,tblptrh,bsr
endc
 
cblock 0x10 ; bank0 registers
porta,ddrb,portb,rcsta,rcreg,txsta,txreg,spbrg
endc
 
cblock 0x10 ; bank1 registers
ddrc,portc,ddrd,portd,ddre,porte,pir,pie
endc
 
cblock 0x10 ; bank2 registers
tmr1,tmr2,tmr3l,tmr3h,pr1,pr2,pr3l,pr3h
endc
 
ca1l equ 0x16 ; alternate function def
ca1h equ 0x17
 
cblock 0x10 ; define bank3 variables
pw1dcl,pw2dcl,pw1dch,pw2dch,ca2l,ca2h,tcon1,tcon2
endc
 
;***************************************************************
; define commonly used bits:
 
; ALUSTA bit definitions
 
#define _carry alusta,0
#define _c alusta,0
#define _cy alusta,0
#define _dc alusta,1
#define _z alusta,2
#define _ov alusta,3
#define _fs0 alusta,4
#define _fs1 alusta,5
#define _fs2 alusta,6
#define _fs3 alusta,7
 
; RTCSTA bit definitions
 
#define _rtps0 rtcsta,1
#define _rtps1 rtcsta,2
#define _rtps2 rtcsta,3
#define _rtps3 rtcsta,4
#define _tc rtcsta,5
#define _rtedg rtcsta,6
#define _intedg rtcsta,7
 
; CPUSTA bit definitions
 
#define _npd cpusta,2
#define _nto cpusta,3
#define _gint cpusta,4
#define _glintd cpusta,4
#define _stkavl cpusta,5
 
; INTSTA bit definitions
 
#define _intie intsta,0
#define _rtcie intsta,1
#define _rtxie intsta,2
#define _peie intsta,3
#define _intir intsta,4
#define _rtcir intsta,5
#define _rtxir intsta,6
#define _peir intsta,7
 
; PIR Bit definitions
 
#define _rbfl pir,0
#define _tbmt pir,1
#define _ca1ir pir,2
#define _ca2ir pir,3
#define _tm1ir pir,4
#define _tm2ir pir,5
#define _tm3ir pir,6
#define _irb pir,7
 
; PIE Bit definitions
 
#define _rcie pie,0
#define _txie pie,1
#define _ca1ie pie,2
#define _ca2ie pie,3
#define _tm1ie pie,4
#define _tm2ie pie,5
#define _tm3ie pie,6
#define _ieb pie,7
 
; RCSTA bit definitions
 
#define _rcd8 rcsta,0
#define _oerr rcsta,1
#define _ferr rcsta,2
#define _cren rcsta,4
#define _sren rcsta,5
#define _rc89 rcsta,6
#define _spen rcsta,7
; TXSTA bit definitions
 
#define _txd8 txsta,0
#define _trmt txsta,1
#define _sync txsta,4
#define _txen txsta,5
#define _tx89 txsta,6
#define _csrc txsta,7
 
; TCON1 bit definitions
 
#define _tmr1c tcon1,0
#define _tmr2c tcon1,1
#define _tmr3c tcon1,2
#define _tmr16 tcon1,3
#define _ca1ed0 tcon1,4
#define _ca1ed1 tcon1,5
#define _ca2ed0 tcon1,6
#define _ca2ed1 tcon1,7
 
; TCON2 bit definitions
 
#define _tmr1on tcon2,0
#define _tmr2on tcon2,1
#define _tmr3on tcon2,2
#define _ca1pr3 tcon2,3
#define _pwm1on tcon2,4
#define _pwm2on tcon2,5
#define _ca1ovf tcon2,6
#define _ca2ovf tcon2,7
 
LIST
 
 
/programy/ASM/prenos/FOXUSER.DBF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/FOXUSER.FPT
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/Kopie (2) - main.asm
0,0 → 1,157
#include 16C84.INC
 
 
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110011B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
;movlw 2
;movwf volani ; Nastavi pocet volani procedury vybito
;bsf PORT ; Nabiti kondenzatoru1
;bsf PORT ; Nabiti kondenzatoru2
dal:
;btfss PORTA, 1 ; Test kondenzatoru1
;call vibito
bsf PORTB, 3
bsf PORTB, 4
Delay 100
;bsf PORTA, 3
;Delay 250
;bcf PORTA, 3
 
bsf PORTA, 2
Delay 250
bcf PORTA, 2
 
Delay 250
Delay 250
Delay 250
Delay 250
Delay 250
 
bsf PORTA, 2
Delay 250
bcf PORTA, 2
 
;bsf PORTA, 3
;Delay 250
bcf PORTA, 3
bcf PORTB, 3
bcf PORTB, 4
Delay 250
;btfss PORTB, 6 ; Test kondenzatoru2
;call vibito
;incf Ramec, f
;goto dal
goto MainLoop
;---------------
 
 
Sinchro:
;bsf PORTB, 1
;call Delay10us
;call Delay10us
;call Delay10us
;bcf PORTB, 1 ; 1. impuls (30ms)
;call Delay10us
;call Delay10us
;call Delay10us
;bsf PORTB, 1
;call Delay10us
;call Delay10us
;bcf PORTB, 1 ; 2. impuls (20ms)
;call Delay10us
;call Delay10us
;bsf PORTB, 1
;call Delay10us
;bcf PORTB, 1 ; 3. impuls (10ms)
;call Delay10us
;return
 
;-------------------------
Protokol:
movlw 8
movwf Bity ; nastaveni slova
call Sinchro
VysBit:
btfss Ramec, 0
call frek0
call frek1
Rotace:
rrf Ramec, f
decfsz Bity, f
goto VysBit
return
 
;-------------------------
frek0:
; 2000 Hz 45 impulsu
;-------------------------
frek1:
; 1500 Hz 60 impulsu
;-------------------------
vibito:
movlw 4
movwf CT1 ; uvolneni mista
zapis:
rlf Ramec, f
decfsz CT1, f
goto zapis
decfsz volani, f
return
call Protokol
call MainLoop
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
Bity
Ramec
volani
XXX
 
endc
 
end
/programy/ASM/prenos/MAIN.$$$
0,0 → 1,110
#include 16C84.INC
 
vys EQU 1 ;vystupni portB protokol.asm
C1 EQU 2 ;pripojeni C1 na port B
C2 EQU 3 ;ptipojeni C2 na port B
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
#include Protokol.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110011B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
movlw 2
movwf volani ; Nastavi pocet volani procedury vybito
bsf PORTB, C1 ; Nabiti kondenzatoru1
bsf PORTB, C2 ; Nabiti kondenzatoru2
dal:
;btfss PORTA, 1 ; Test kondenzatoru1
;call vibito
bsf PORTB, 3
bsf PORTB, 4
Delay 100
;bsf PORTA, 3
;Delay 250
;bcf PORTA, 3
 
bsf PORTA, 2
Delay 250
bcf PORTA, 2
 
Delay 250
Delay 250
Delay 250
Delay 250
Delay 250
 
bsf PORTA, 2
Delay 250
bcf PORTA, 2
 
;bsf PORTA, 3
;Delay 250
bcf PORTA, 3
bcf PORTB, 3
bcf PORTB, 4
Delay 250
;btfss PORTB, 6 ; Test kondenzatoru2
;call vibito
;incf Ramec, f
;goto dal
goto MainLoop
;---------------
 
vibito:
movlw 4
movwf CT1 ; uvolneni mista
zapis:
rlf Ramec, f
decfsz CT1, f
goto zapis
decfsz volani, f
return
call Protokol
call MainLoop
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
volani
 
endc
 
end
/programy/ASM/prenos/MAIN.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/MAIN.ERR
--- prenos/MAIN.HEX (nonexistent)
+++ prenos/MAIN.HEX (revision 6)
@@ -0,0 +1,17 @@
+:020000004D2889
+:080008004D2863308C000C2030
+:100010008D0B052800000800000000000000000013
+:100020000000000000008C0B0C2800000800861463
+:100030000C200C200C2086100C200C200C20861488
+:100040000C200C2086100C200C2086140C2086100E
+:100050000C2008308F001720101C33204020900CFB
+:100060008F0B2C2808003C308E00861432308D0017
+:100070000520861032308D0005208E0B35282F206C
+:100080002D308E00861496308D0005208610963017
+:100090008D0005208E0B42282F2083160030810012
+:1000A00000308B008316F3308500F1308600811715
+:1000B00083120301850086008515861006118611BE
+:1000C0000230910006158615051D6B20861D6B20DC
+:1000D000900A6428602804309200900D920B6D28DD
+:0600E000910B29206028AD
+:00000001FF
/programy/ASM/prenos/MAIN.LST
0,0 → 1,483
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
00000001 00003 vys EQU 1 ;vystupni portB protokol.asm
00000002 00004 C1 EQU 2 ;pripojeni C1 na port B
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00000003 00005 C2 EQU 3 ;ptipojeni C2 na port B
00006
0000 00007 org 0
00008
0000 284D 00009 goto Start
00010 ;--------------------
0004 00011 org 4
00012 ;--------------------
0004 284D 00013 goto Start
00014
00015 #include Delay.asm
00001 ;Pro krystal 4Mhz
00002
00003 ;--- Macro na spozdeni 1ms az 255ms ---
00004 Delay macro ms
00005 movlw ms
00006 movwf xxx
00007 call Delay1ms
00008 endm
00009
00010 ;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
00011 Delay01 macro us
00012 movlw us
00013 movwf yyy
00014 call Delay10us
00015
00016 nop
00017 nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
00018 nop
00019 return
00020 endm
00021 ;--- Spozdeni v nasobcich 1ms+2us ----
00022
0005 00023 Delay1ms:
0005 3063 00024 movlw 99 ; 1 ms
0006 008C 00025 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0007 200C 00026 call Delay10us
00027
0008 0B8D 00028 decfsz xxx, f
0009 2805 00029 goto Delay1ms
000A 0000 00030 nop
00031 ;---------------------------------
000B 0008 00032 return ;2us
00033
00034 ;--- Spozdeni v nasobcich 10us ----
000C 00035 Delay10us: ; Prodleva (CT1 * 10us)
000C 0000 00036 nop
000D 0000 00037 nop
000E 0000 00038 nop
000F 0000 00039 nop
0010 0000 00040 nop
0011 0000 00041 nop
0012 0000 00042 nop
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0013 0B8C 00043 decfsz yyy, f
0014 280C 00044 goto Delay10us
0015 0000 00045 nop
0016 0008 00046 return
00047 ;-------------------------
00048
00049 ;----------------------------
00050 ; Definice promenych
00051 ;----------------------------
00052
00053 cblock
00054
0000000C 00055 yyy
0000000D 00056 xxx
00057
00058 endc
00059
00016 #include Protokol.asm
0017 00001 Sinchro:
0017 1486 00002 bsf PORTB, vys
0018 200C 00003 call Delay10us
0019 200C 00004 call Delay10us
001A 200C 00005 call Delay10us
001B 1086 00006 bcf PORTB, vys ; 1. impuls (30us)
001C 200C 00007 call Delay10us
001D 200C 00008 call Delay10us
001E 200C 00009 call Delay10us
001F 1486 00010 bsf PORTB, vys
0020 200C 00011 call Delay10us
0021 200C 00012 call Delay10us
0022 1086 00013 bcf PORTB, vys ; 2. impuls (20us)
0023 200C 00014 call Delay10us
0024 200C 00015 call Delay10us
0025 1486 00016 bsf PORTB, vys
0026 200C 00017 call Delay10us
0027 1086 00018 bcf PORTB, vys ; 3. impuls (10us)
0028 200C 00019 call Delay10us
00020
00021 ;return
00022
00023 ;-------------------------
0029 00024 Protokol:
0029 3008 00025 movlw 8
002A 008F 00026 movwf Bity ; nastaveni slova
002B 2017 00027 call Sinchro
002C 00028 VysBit:
002C 1C10 00029 btfss Ramec, 0
002D 2033 00030 call frek0
002E 2040 00031 call frek1
002F 00032 Rotace:
002F 0C90 00033 rrf Ramec, f
0030 0B8F 00034 decfsz Bity, f
0031 282C 00035 goto VysBit
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0032 0008 00036 return
00037
00038 ;-------------------------
0033 00039 frek0:
0033 303C 00040 movlw 60
0034 008E 00041 movwf Frek
0035 00042 smycka1:
0035 1486 00043 bsf PORTB, vys ; 2000 Hz 60 impulsu
00044 Delay 50
0036 3032 M movlw 50
0037 008D M movwf xxx
0038 2005 M call Delay1ms
0039 1086 00045 bcf PORTB, vys
00046 Delay 50
003A 3032 M movlw 50
003B 008D M movwf xxx
003C 2005 M call Delay1ms
003D 0B8E 00047 decfsz Frek,f
003E 2835 00048 goto smycka1
003F 202F 00049 call Rotace
00050 ;-------------------------
0040 00051 frek1:
0040 302D 00052 movlw 45
0041 008E 00053 movwf Frek
0042 00054 smycka2:
0042 1486 00055 bsf PORTB, vys ; 1500 Hz 45 impulsu
00056 Delay 150
0043 3096 M movlw 150
0044 008D M movwf xxx
0045 2005 M call Delay1ms
0046 1086 00057 bcf PORTB, vys
00058 Delay 150
0047 3096 M movlw 150
0048 008D M movwf xxx
0049 2005 M call Delay1ms
004A 0B8E 00059 decfsz Frek,f
004B 2842 00060 goto smycka2
004C 202F 00061 call Rotace
00062 ;-------------------------
00063
00064
00065 ;----------------------------
00066 ; Definice promenych
00067 ;----------------------------
00068
00069 cblock
00070
0000000E 00071 Frek
0000000F 00072 Bity
00000010 00073 Ramec
00074
00075 endc
004D 00017 Start:
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 6
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00018 page1
004D 1683 M bsf STATUS,_RP0
004E 3000 00019 movlw 00000000B ; inicializace citace a prescaleru
004F 0081 00020 movwf TMR0
0050 3000 00021 movlw 00000000B ; konfigurace preruseni
0051 008B 00022 movwf INTCON
00023
00024 page1
0052 1683 M bsf STATUS,_RP0
0053 30F3 00025 movlw 11110011B ; nastaveni portu na vstup nebo vystup
0054 0085 00026 movwf PORTA ; 1=vstup 0=vystup
0055 30F1 00027 movlw 11110001B
0056 0086 00028 movwf PORTB
00029
0057 1781 00030 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00031
00032 page0
0058 1283 M bcf STATUS,_RP0
00033
0059 0103 00034 clrw ; vynulovani portu
005A 0085 00035 movwf PORTA
005B 0086 00036 movwf PORTB
00037
005C 1585 00038 bsf PORTA, 3 ; Pull-Up na tlacitka
00039
005D 1086 00040 bcf PORTB, 1 ; zhasnuti LED
005E 1106 00041 bcf PORTB, 2
005F 1186 00042 bcf PORTB, 3
00043
0060 00044 MainLoop:
0060 3002 00045 movlw 2
0061 0091 00046 movwf volani ; Nastavi pocet volani procedury vybito
0062 1506 00047 bsf PORTB, C1 ; Nabiti kondenzatoru1
0063 1586 00048 bsf PORTB, C2 ; Nabiti kondenzatoru2
0064 00049 dal:
0064 1D05 00050 btfss PORTA, C1 ; Test kondenzatoru1
0065 206B 00051 call vibito
00052
0066 1D86 00053 btfss PORTB, C2 ; Test kondenzatoru2
0067 206B 00054 call vibito
00055
0068 0A90 00056 incf Ramec, f
0069 2864 00057 goto dal
006A 2860 00058 goto MainLoop
00059 ;---------------
00060
006B 00061 vibito:
006B 3004 00062 movlw 4
006C 0092 00063 movwf CT1 ; uvolneni mista
006D 00064 zapis:
006D 0D90 00065 rlf Ramec, f
006E 0B92 00066 decfsz CT1, f
006F 286D 00067 goto zapis
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 7
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0070 0B91 00068 decfsz volani, f
00069
0071 2029 00070 call Protokol
00071
0072 2860 00072 goto MainLoop
00073
00074
00075 ;----------------------------
00076 ; Definice promenych
00077 ;----------------------------
00078
00079 cblock
00080
00000011 00081 volani
00000012 00082 CT1
00083
00084 endc
00085
00086 end
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 8
 
 
SYMBOL TABLE
LABEL VALUE
 
Bity 0000000F
C1 00000002
C2 00000003
CMP
CT1 00000012
Delay
Delay01
Delay10us 0000000C
Delay1ms 00000005
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
Frek 0000000E
IND0 00000000
INTCON 0000000B
MainLoop 00000060
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
Protokol 00000029
Ramec 00000010
Rotace 0000002F
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Sinchro 00000017
Start 0000004D
TMR0 00000001
VysBit 0000002C
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
MPASM 02.80 Released MAIN.ASM 8-9-2002 12:26:04 PAGE 9
 
 
SYMBOL TABLE
LABEL VALUE
 
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
_ZERO 00000002
__16C84__ 00000000
__16F84 00000001
dal 00000064
frek0 00000033
frek1 00000040
page0
page1
smycka1 00000035
smycka2 00000042
vibito 0000006B
volani 00000011
vys 00000001
xxx 0000000D
yyy 0000000C
zapis 0000006D
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXX-------------
 
All other memory blocks unused.
 
Program Memory Words Used: 112
Program Memory Words Free: 912
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/prenos/PRG.BAT
0,0 → 1,8
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
cls
picpgr program main.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
/programy/ASM/prenos/PRG.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/PROTOKOL.$$$
0,0 → 1,75
Sinchro:
bsf PORTB, vys
call Delay10us
call Delay10us
call Delay10us
bcf PORTB, vys ; 1. impuls (30us)
call Delay10us
call Delay10us
call Delay10us
bsf PORTB, vys
call Delay10us
call Delay10us
bcf PORTB, vys ; 2. impuls (20us)
call Delay10us
call Delay10us
bsf PORTB, vys
call Delay10us
bcf PORTB, vys ; 3. impuls (10us)
call Delay10us
;return
 
;-------------------------
Protokol:
movlw 8
movwf Bity ; nastaveni slova
call Sinchro
VysBit:
btfss Ramec, 0
call frek0
call frek1
Rotace:
rrf Ramec, f
decfsz Bity, f
goto VysBit
return
 
;-------------------------
frek0:
movlw 60
movwf Frek
smycka1:
bsf PORTB, vys ; 2000 Hz 60 impulsu
Delay 50
bcf PORTB, vys
Delay 50
decfsz Frek,f
goto smycka1
call Rotace
;-------------------------
frek1:
movlw 45
movwf Frek
smycka2:
bsf PORTB, vys ; 1500 Hz 45 impulsu
Delay 150
bcf PORTB, vys
Delay 150
decfsz Frek,f
goto smycka2
call Rotace
;-------------------------
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
Frek
Bity
Ramec
endc
/programy/ASM/prenos/RUN.PIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/delay.asm
0,0 → 1,59
;Pro krystal 4Mhz
 
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf yyy
call Delay10us
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call Delay10us
 
decfsz xxx, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
Delay10us: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto Delay10us
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/prenos/main.asm
0,0 → 1,86
#include 16C84.INC
 
vys EQU 1 ;vystupni portB protokol.asm
C1 EQU 2 ;pripojeni C1 na port B
C2 EQU 3 ;ptipojeni C2 na port B
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include Delay.asm
#include Protokol.asm
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110011B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
movlw 2
movwf volani ; Nastavi pocet volani procedury vybito
bsf PORTB, C1 ; Nabiti kondenzatoru1
bsf PORTB, C2 ; Nabiti kondenzatoru2
dal:
btfss PORTA, C1 ; Test kondenzatoru1
call vibito
 
btfss PORTB, C2 ; Test kondenzatoru2
call vibito
 
incf Ramec, f
goto dal
goto MainLoop
;---------------
 
vibito:
movlw 4
movwf CT1 ; uvolneni mista
zapis:
rlf Ramec, f
decfsz CT1, f
goto zapis
decfsz volani, f
 
call Protokol
 
goto MainLoop
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
volani
CT1
 
endc
 
end
/programy/ASM/prenos/main.pjt
0,0 → 1,101
[PROJECT]
Target=MAIN.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=.
Library=
LinkerScript=
 
[Target Data]
FileList=MAIN.ASM;
BuildTool=MPASM
OptionString=
AdditionalOptionString=·pÿo
BuildRequired=0
 
[SERVO.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=1
 
[]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[MAIN.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=d:\@kaklik\programy\prenos\protokol.asm
2=d:\@kaklik\programy\prenos\prijimac\prijimac.asm
3=d:\@kaklik\programy\prenos\main.asm
4=d:\@kaklik\programy\prenos\servo.asm
5=d:\@kaklik\programy\prenos\delay.asm
 
/programy/ASM/prenos/prijimac/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16f84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/prenos/prijimac/PRIJIMAC.$$$
0,0 → 1,99
#include 16C84.INC
 
PRYJM EQU 0 ;portb
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include delay.asm
 
 
Start:
page1
movlw 00101000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110111B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
;bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
btfss PORTB, PRYJM ;cekani na impuls1
goto MainLoop
 
call Delay10us
call Delay10us
 
btfss PORTB, PRYJM ;potvrzeni impulsu1
goto MainLoop
 
call Delay10us
call Delay10us
smycka:
btfsc PORTB, PRYJM
goto smycka
;sinchronizace
call Delay10us
 
smycka1: ;2impuls
btfss PORTB, PRYJM
goto smycka1
call Delay10us
 
smycka2:
btfss PORTB, PRYJM
goto MainLoop
 
mezera2:
btfsc PORTB, PRYJM
goto mezera2
 
impuls3:
btfss PORTB, PRYJM
goto impuls3
 
mezera3:
btfsc PORTB, PRYJM
goto mezera3
call Delay10ms
clrf TMR0
Delay
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
end
/programy/ASM/prenos/prijimac/PRIJIMAC.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/prijimac/PRIJIMAC.ERR
--- prenos/prijimac/PRIJIMAC.HEX (nonexistent)
+++ prenos/prijimac/PRIJIMAC.HEX (revision 6)
@@ -0,0 +1,10 @@
+:020000001728BF
+:08000800172863308C000C2066
+:100010008D0B052800000800000000000000000013
+:100020000000000000008C0B0C2800000800831664
+:100030002830810000308B008316F7308500F130C6
+:10004000860083120301850086008515861006113F
+:100050008611061C29280C200C20061C29280C209F
+:100060000C20061831280C20061C34280C20061CF5
+:0E007000292806183928061C3B2806183D28AA
+:00000001FF
/programy/ASM/prenos/prijimac/PRIJIMAC.LST
0,0 → 1,383
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00001 #include 16C84.INC
00001 ;
00002 ; Definice registru a zakladnich maker pro 16C84
00003 ;
00004 processor 16f84
00005 radix D
00006
0000 00007 __16C84__: ; Priznak modulu 16C84
00008
00009 ; Definice registru
00010
00000000 00011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
00000001 00012 TMR0 equ 01H ; 0 Real Time clock counter
00000002 00013 PCL equ 02H ; 0&1 Spodni cast PC
00000003 00014 STATUS equ 03H ; 0&1 Stavove bity
00000000 00015 _CARRY equ 0
00000001 00016 _DC equ 1
00000002 00017 _ZERO equ 2
00000003 00018 _PD equ 3
00000004 00019 _TO equ 4
00000005 00020 _RP0 equ 5
00000006 00021 _RP1 equ 6
00000007 00022 _IRP equ 7
00000004 00023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
00000005 00024 PORTA equ 05H ; 0&1 Data a rizeni portu A
00000006 00025 PORTB equ 06H ; 0&1 Data a rizeni portu B
00000008 00026 EEDATA_0 equ 08H ; 0 Data EEPROM
00000008 00027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
00000000 00028 _EERD equ 0
00000001 00029 _EEWR equ 1
00000002 00030 _EEWREN equ 2
00000003 00031 _EEWRERR equ 3
00000004 00032 _EEIF equ 4
00000009 00033 EEADR_0 equ 09H ; 0 Adresa EEPROM
00000009 00034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
0000000A 00035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
0000000B 00036 INTCON equ 0BH ; 0&1 Rizeni preruseni
00000000 00037 _RBIF equ 0 ;
00000001 00038 _INTF equ 1
00000002 00039 _T0IF equ 2
00000003 00040 _RBIE equ 3
00000004 00041 _INTE equ 4
00000005 00042 _T0IE equ 5
00000006 00043 _EEIE equ 6
00000007 00044 _GIE equ 7
00045
00046 page0 macro
00047 bcf STATUS,_RP0
00048 endm
00049
00050 page1 macro
00051 bsf STATUS,_RP0
00052 endm
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00053 ;
00054 ; Sada maker pro porovnani a skoky
00055 ;
00056
00057 ;--- Compare ---
00058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
00059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
00060 btfsc STATUS,_ZERO
00061 goto PROCEDURA
00062 xorlw ZNAK
00063 endm
00064
00065 ;--- Skip if Carry ---
00066 SC macro
00067 btfss STATUS,_CARRY
00068 endm
00069
00070 ;--- Skip if not Carry ---
00071 SNC macro
00072 btfsc STATUS,_CARRY
00073 endm
00074
00075 ;--- Skip if Zero ---
00076 SZ macro
00077 btfss STATUS,_ZERO
00078 endm
00079
00080 ;--- Skip if not Zero ---
00081 SNZ macro
00082 btfsc STATUS,_ZERO
00083 endm
00084
00085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
00086 SB macro
00087 btsfsc STATUS,_CARRY
00088 endm
00089 SN macro
00090 btfsc STATUS,_CARRY
00091 endm
00092
00093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
00094 SNB macro
00095 btfss STATUS,_CARRY
00096 endm
00097 SP macro
00098 btfss STATUS,_CARRY
00099 endm
00100
00101 cblock 0CH ; Prvni volny registr
00102 endc
00002
00000000 00003 PRYJM EQU 0 ;portb
00004
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0000 00005 org 0
00006
0000 2817 00007 goto Start
00008 ;--------------------
0004 00009 org 4
00010 ;--------------------
0004 2817 00011 goto Start
00012
00013 #include delay.asm
00001 ;Pro krystal 4Mhz
00002
00003 ;--- Macro na spozdeni 1ms az 255ms ---
00004 Delay macro ms
00005 movlw ms
00006 movwf xxx
00007 call Delay1ms
00008 endm
00009
00010 ;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
00011 Delay01 macro us
00012 movlw us
00013 movwf yyy
00014 call Delay10us
00015
00016 nop
00017 nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
00018 nop
00019 return
00020 endm
00021 ;--- Spozdeni v nasobcich 1ms+2us ----
00022
0005 00023 Delay1ms:
0005 3063 00024 movlw 99 ; 1 ms
0006 008C 00025 movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
0007 200C 00026 call Delay10us
00027
0008 0B8D 00028 decfsz xxx, f
0009 2805 00029 goto Delay1ms
000A 0000 00030 nop
00031 ;---------------------------------
000B 0008 00032 return ;2us
00033
00034 ;--- Spozdeni v nasobcich 10us ----
000C 00035 Delay10us: ; Prodleva (CT1 * 10us)
000C 0000 00036 nop
000D 0000 00037 nop
000E 0000 00038 nop
000F 0000 00039 nop
0010 0000 00040 nop
0011 0000 00041 nop
0012 0000 00042 nop
0013 0B8C 00043 decfsz yyy, f
0014 280C 00044 goto Delay10us
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0015 0000 00045 nop
0016 0008 00046 return
00047 ;-------------------------
00048
00049 ;----------------------------
00050 ; Definice promenych
00051 ;----------------------------
00052
00053 cblock
00054
0000000C 00055 yyy
0000000D 00056 xxx
00057
00058 endc
00059
00014
00015
0017 00016 Start:
00017 page1
0017 1683 M bsf STATUS,_RP0
0018 3028 00018 movlw 00101000B ; inicializace citace a prescaleru
0019 0081 00019 movwf TMR0
001A 3000 00020 movlw 00000000B ; konfigurace preruseni
001B 008B 00021 movwf INTCON
00022
00023 page1
001C 1683 M bsf STATUS,_RP0
001D 30F7 00024 movlw 11110111B ; nastaveni portu na vstup nebo vystup
001E 0085 00025 movwf PORTA ; 1=vstup 0=vystup
001F 30F1 00026 movlw 11110001B
0020 0086 00027 movwf PORTB
00028
00029 ;bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
00030
00031 page0
0021 1283 M bcf STATUS,_RP0
00032
0022 0103 00033 clrw ; vynulovani portu
0023 0085 00034 movwf PORTA
0024 0086 00035 movwf PORTB
00036
0025 1585 00037 bsf PORTA, 3 ; Pull-Up na tlacitka
00038
0026 1086 00039 bcf PORTB, 1 ; zhasnuti LED
0027 1106 00040 bcf PORTB, 2
0028 1186 00041 bcf PORTB, 3
00042
0029 00043 MainLoop:
0029 1C06 00044 btfss PORTB, PRYJM ;cekani na impuls1
002A 2829 00045 goto MainLoop
00046
002B 200C 00047 call Delay10us
002C 200C 00048 call Delay10us
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
00049
002D 1C06 00050 btfss PORTB, PRYJM ;potvrzeni impulsu1
002E 2829 00051 goto MainLoop
00052
002F 200C 00053 call Delay10us
0030 200C 00054 call Delay10us
0031 00055 smycka:
0031 1806 00056 btfsc PORTB, PRYJM
0032 2831 00057 goto smycka
00058 ;sinchronizace
0033 200C 00059 call Delay10us
00060
0034 00061 smycka1: ;2impuls
0034 1C06 00062 btfss PORTB, PRYJM
0035 2834 00063 goto smycka1
0036 200C 00064 call Delay10us
00065
0037 00066 smycka2:
0037 1C06 00067 btfss PORTB, PRYJM
0038 2829 00068 goto MainLoop
00069
0039 00070 mezera2:
0039 1806 00071 btfsc PORTB, PRYJM
003A 2839 00072 goto mezera2
00073
003B 00074 impuls3:
003B 1C06 00075 btfss PORTB, PRYJM
003C 283B 00076 goto impuls3
00077
003D 00078 mezera3:
003D 1806 00079 btfsc PORTB, PRYJM
003E 283D 00080 goto mezera3
00081
00082
00083 ;-------------------------
00084
00085 ;----------------------------
00086 ; Definice promenych
00087 ;----------------------------
00088
00089 cblock
00090
0000000E 00091 CT1
0000000F 00092 CT2
00093
00094 endc
00095
00096 end
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 6
 
 
SYMBOL TABLE
LABEL VALUE
 
CMP
CT1 0000000E
CT2 0000000F
Delay
Delay01
Delay10us 0000000C
Delay1ms 00000005
EEADR_0 00000009
EECON1_1 00000008
EECON2_1 00000009
EEDATA_0 00000008
FSR 00000004
IND0 00000000
INTCON 0000000B
MainLoop 00000029
PCL 00000002
PCLATH 0000000A
PORTA 00000005
PORTB 00000006
PRYJM 00000000
SB
SC
SN
SNB
SNC
SNZ
SP
STATUS 00000003
SZ
Start 00000017
TMR0 00000001
_CARRY 00000000
_DC 00000001
_EEIE 00000006
_EEIF 00000004
_EERD 00000000
_EEWR 00000001
_EEWREN 00000002
_EEWRERR 00000003
_GIE 00000007
_INTE 00000004
_INTF 00000001
_IRP 00000007
_PD 00000003
_RBIE 00000003
_RBIF 00000000
_RP0 00000005
_RP1 00000006
_T0IE 00000005
_T0IF 00000002
_TO 00000004
_ZERO 00000002
__16C84__ 00000000
MPASM 02.80 Released PRIJIMAC.ASM 8-8-2002 19:29:29 PAGE 7
 
 
SYMBOL TABLE
LABEL VALUE
 
__16F84 00000001
impuls3 0000003B
mezera2 00000039
mezera3 0000003D
page0
page1
smycka 00000031
smycka1 00000034
smycka2 00000037
xxx 0000000D
yyy 0000000C
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX-
 
All other memory blocks unused.
 
Program Memory Words Used: 60
Program Memory Words Free: 964
 
 
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
 
/programy/ASM/prenos/prijimac/delay.asm
0,0 → 1,59
;Pro krystal 4Mhz
 
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf xxx
call Delay1ms
endm
 
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf yyy
call Delay10us
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
 
Delay1ms:
movlw 99 ; 1 ms
movwf yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call Delay10us
 
decfsz xxx, f
goto Delay1ms
nop
;---------------------------------
return ;2us
 
;--- Spozdeni v nasobcich 10us ----
Delay10us: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz yyy, f
goto Delay10us
nop
return
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
yyy
xxx
 
endc
 
/programy/ASM/prenos/prijimac/main.pjt
0,0 → 1,97
[PROJECT]
Target=PRIJIMAC.HEX
Development_Mode=1
Processor=0x684a
ToolSuite=Microchip
 
[Fuses]
Frequency=4000000.000000
ClockSource=1
Mode=0
WDTEnable=0
WDTBreak=0
WDTPrescale=710
StackBreak=0
Freeze=1
EmulatorMemory=1
ShortWrites=0
PwrSetting=0
OSC_Settings=0
ProgBankRegEnable=0
BankRegStartAddress=0
BankRegEndAddress=0
DisableIoPins=0
12CXXX_MCLR_ENABLE=0
CPP2_ENABLE=0
LPSC_ENABLE=0
MCLRPU_ENABLE=0
 
[Directories]
Include=.
Library=
LinkerScript=
 
[Target Data]
FileList=PRIJIMAC.ASM;
BuildTool=MPASM
OptionString=
AdditionalOptionString=qWp
BuildRequired=1
 
[PRIJIMAC.ASM]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[Trace-Config]
GetAddress=1
AddressWidth=5.000000
GetOpcode=1
OpcodeWidth=5.000000
GetLabel=1
LabelWidth=8.000000
GetInstruction=1
InstructionWidth=10.000000
InstructionRaw=1
GetSrcAddr=1
SrcAddrWidth=4.000000
SrcAddrRaw=1
GetSrcValue=1
SrcValueWidth=4.000000
GetDstAddr=1
DstAddrWidth=4.000000
DstAddrRaw=1
GetDstValue=1
DstValueWidth=4.000000
GetExtInputs=1
ExtInputsWidth=9.000000
ExtInputsHexFmt=0
GetTimeStamp=1
TimeStampWidth=11.000000
TimeStampDiplay=0
TraceLines=100
TraceFull=0
CodeCoverageReset=1
 
[]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=d:\@kaklik\programy\prenos\prijimac\prijimac.asm
2=d:\@kaklik\programy\prenos\prijimac\delay.asm
3=d:\@kaklik\programy\prenos\protokol.asm
4=d:\@kaklik\programy\prenos\main.asm
5=d:\@kaklik\programy\prenos\servo.asm
 
[Windows]
1=0000 d:\@kaklik\programy\prenos\prijimac\prijimac.asm 0 0 638 324 3 0
0=0004 22 22 660 346 3 0
 
/programy/ASM/prenos/prijimac/prijimac.asm
0,0 → 1,101
#include 16C84.INC
 
PRYJM EQU 0 ;portb
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
goto Start
 
#include delay.asm
 
 
Start:
page1
movlw 00101000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110111B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
;bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
btfss PORTB, PRYJM ;cekani na impuls1
goto MainLoop
 
call Delay10us
call Delay10us
 
btfss PORTB, PRYJM ;potvrzeni impulsu1
goto MainLoop
 
call Delay10us
call Delay10us
smycka:
btfsc PORTB, PRYJM
goto smycka
;sinchronizace
call Delay10us
 
smycka1: ;2impuls
btfss PORTB, PRYJM
goto smycka1
call Delay10us
 
smycka2:
btfss PORTB, PRYJM
goto MainLoop
 
mezera2:
btfsc PORTB, PRYJM
goto mezera2
 
impuls3:
btfss PORTB, PRYJM
goto impuls3
 
mezera3:
btfsc PORTB, PRYJM
goto mezera3
 
call Delay10ms
clrf TMR0
Delay
;-------------------------
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
 
endc
 
end
/programy/ASM/prenos/prijimac/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/prenos/protokol.asm
0,0 → 1,76
Sinchro:
bsf PORTB, vys
call Delay10us
call Delay10us
call Delay10us
bcf PORTB, vys ; 1. impuls (30us)
call Delay10us
call Delay10us
call Delay10us
bsf PORTB, vys
call Delay10us
call Delay10us
bcf PORTB, vys ; 2. impuls (20us)
call Delay10us
call Delay10us
bsf PORTB, vys
call Delay10us
bcf PORTB, vys ; 3. impuls (10us)
call Delay10us
;return
 
;-------------------------
Protokol:
movlw 8
movwf Bity ; nastaveni slova
call Sinchro
VysBit:
btfss Ramec, 0
call frek0
call frek1
;-------------------------
Rotace:
rrf Ramec, f
decfsz Bity, f
goto VysBit
return
 
;-------------------------
frek0:
movlw 60
movwf Frek
smycka1:
bsf PORTB, vys ; 2000 Hz 60 impulsu
Delay 50
bcf PORTB, vys
Delay 50
decfsz Frek,f
goto smycka1
goto Rotace
;-------------------------
frek1:
movlw 45
movwf Frek
smycka2:
bsf PORTB, vys ; 1500 Hz 45 impulsu
Delay 150
bcf PORTB, vys
Delay 150
decfsz Frek,f
goto smycka2
goto Rotace
;-------------------------
 
 
;----------------------------
; Definice promenych
;----------------------------
 
cblock
Frek
Bity
Ramec
endc
/programy/ASM/prenos/run.BAT
0,0 → 1,11
@echo off
picpgr stop
pause
picpgr run
pause
picpgr stop
pause
picpgr run
pause
picpgr stop
pause
/programy/ASM/prenos/servo.asm
0,0 → 1,163
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110111B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
movlw 2
movwf volani ; Nastavi pocet volani procedury vibito
;bsf PORT ; Nabiti kondenzatoru1
;bsf PORT ; Nabiti kondenzatoru2
dal:
btfss PORTA, 1 ; Test kondenzatoru1
call vibito
bsf PORTB, 2
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
bcf PORTB, 2
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
 
bsf PORTB, 2
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
call Delay10ms
bcf PORTB, 2
 
 
 
 
btfss PORTB, 6 ; Test kondenzatoru2
call vibito
incf Ramec, f
goto dal
;---------------
 
Delay10us: ; Prodleva (DELAY10 * 10us)+3us
nop
nop
nop
nop
nop
nop
nop
decfsz CT1, 1
goto Delay10us
return
;-------------------------
Sinchro:
bsf PORTB, 1
call Delay10ms
call Delay10ms
call Delay10ms
bcf PORTB, 1 ; 1 impuls (30ms)
call Delay10ms
call Delay10ms
call Delay10ms
bsf PORTB, 1
call Delay10ms
call Delay10ms
bcf PORTB, 1 ; 2 impuls (20ms)
call Delay10ms
call Delay10ms
bsf PORTB, 1
call Delay10ms
bcf PORTB, 1 ; 3 impuls (10ms)
call Delay10ms
return
;-------------------------
Delay10ms:
movlw 100
movwf CT2
call Delay10us
decfsz CT2, f
goto Delay10ms
return
;-------------------------
Protokol:
movlw 8
movwf Bity ; nastaveni slova
call Sinchro
VysBit:
btfss Ramec, 0
call frek0
call frek1
rrf Ramec, f
decfsz Bity, f
goto VysBit
return
 
;-------------------------
frek0:
;-------------------------
frek1:
;-------------------------
vibito:
movlw 4
movwf CT1 ; uvolneni mista
zapis:
rlf Ramec, f
decfsz CT1, f
goto zapis
decfsz volani, f
return
call Protokol
call MainLoop
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
Bity
Ramec
volani
XXX
 
endc
 
end
/programy/ASM/prenos/servo.inc
0,0 → 1,11
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT1
CT2
XXX
 
endc
/programy/ASM/prenos/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/servo_na_lod/16C84.INC
0,0 → 1,102
;
; Definice registru a zakladnich maker pro 16C84
;
processor 16C84
radix D
 
__16C84__: ; Priznak modulu 16C84
 
; Definice registru
 
IND0 equ 00H ; 0&1 Pristup na neprimou adresu
TMR0 equ 01H ; 0 Real Time clock counter
PCL equ 02H ; 0&1 Spodni cast PC
STATUS equ 03H ; 0&1 Stavove bity
_CARRY equ 0
_DC equ 1
_ZERO equ 2
_PD equ 3
_TO equ 4
_RP0 equ 5
_RP1 equ 6
_IRP equ 7
FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
PORTA equ 05H ; 0&1 Data a rizeni portu A
PORTB equ 06H ; 0&1 Data a rizeni portu B
EEDATA_0 equ 08H ; 0 Data EEPROM
EECON1_1 equ 08H ; 1 Rizeni EEPROM
_EERD equ 0
_EEWR equ 1
_EEWREN equ 2
_EEWRERR equ 3
_EEIF equ 4
EEADR_0 equ 09H ; 0 Adresa EEPROM
EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
PCLATH equ 0AH ; 0&1 Horni cast PC pro move
INTCON equ 0BH ; 0&1 Rizeni preruseni
_RBIF equ 0 ;
_INTF equ 1
_T0IF equ 2
_RBIE equ 3
_INTE equ 4
_T0IE equ 5
_EEIE equ 6
_GIE equ 7
 
page0 macro
bcf STATUS,_RP0
endm
 
page1 macro
bsf STATUS,_RP0
endm
;
; Sada maker pro porovnani a skoky
;
 
;--- Compare ---
CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
btfsc STATUS,_ZERO
goto PROCEDURA
xorlw ZNAK
endm
 
;--- Skip if Carry ---
SC macro
btfss STATUS,_CARRY
endm
 
;--- Skip if not Carry ---
SNC macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if Zero ---
SZ macro
btfss STATUS,_ZERO
endm
 
;--- Skip if not Zero ---
SNZ macro
btfsc STATUS,_ZERO
endm
 
;--- Skip if Borrow ( Negative ) --- ( po odecitani )
SB macro
btsfsc STATUS,_CARRY
endm
SN macro
btfsc STATUS,_CARRY
endm
 
;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
SNB macro
btfss STATUS,_CARRY
endm
SP macro
btfss STATUS,_CARRY
endm
 
cblock 0CH ; Prvni volny registr
endc
/programy/ASM/servo_na_lod/17C42.H
0,0 → 1,165
NOLIST
 
; rev 1.2 4/06/92
; rev 1.3 4/15/94 removed HIGH and LOW
;***************************************************************
; define special function registers:
#define W 0
#define w 0
#define true 1
#define false 0
#define TRUE 1
#define FALSE 0
;
#define LSB 0
#define MSB 7
;
_INC equ 1
_NO_INC equ 0
_LOW equ 0
_HIGH equ 1
;
cblock 0x00
bit0,bit1,bit2,bit3,bit4,bit5,bit6,bit7
endc
 
cblock 0x00 ; define banks
bank0,bank1,bank2,bank3
endc
 
cblock 0x00 ; unbanked registers
indf0,fsr0,pcl,pclath,alusta,rtcsta,cpusta,intsta
indf1,fsr1,wreg,rtccl,rtcch,tblptrl,tblptrh,bsr
endc
 
cblock 0x10 ; bank0 registers
porta,ddrb,portb,rcsta,rcreg,txsta,txreg,spbrg
endc
 
cblock 0x10 ; bank1 registers
ddrc,portc,ddrd,portd,ddre,porte,pir,pie
endc
 
cblock 0x10 ; bank2 registers
tmr1,tmr2,tmr3l,tmr3h,pr1,pr2,pr3l,pr3h
endc
 
ca1l equ 0x16 ; alternate function def
ca1h equ 0x17
 
cblock 0x10 ; define bank3 variables
pw1dcl,pw2dcl,pw1dch,pw2dch,ca2l,ca2h,tcon1,tcon2
endc
 
;***************************************************************
; define commonly used bits:
 
; ALUSTA bit definitions
 
#define _carry alusta,0
#define _c alusta,0
#define _cy alusta,0
#define _dc alusta,1
#define _z alusta,2
#define _ov alusta,3
#define _fs0 alusta,4
#define _fs1 alusta,5
#define _fs2 alusta,6
#define _fs3 alusta,7
 
; RTCSTA bit definitions
 
#define _rtps0 rtcsta,1
#define _rtps1 rtcsta,2
#define _rtps2 rtcsta,3
#define _rtps3 rtcsta,4
#define _tc rtcsta,5
#define _rtedg rtcsta,6
#define _intedg rtcsta,7
 
; CPUSTA bit definitions
 
#define _npd cpusta,2
#define _nto cpusta,3
#define _gint cpusta,4
#define _glintd cpusta,4
#define _stkavl cpusta,5
 
; INTSTA bit definitions
 
#define _intie intsta,0
#define _rtcie intsta,1
#define _rtxie intsta,2
#define _peie intsta,3
#define _intir intsta,4
#define _rtcir intsta,5
#define _rtxir intsta,6
#define _peir intsta,7
 
; PIR Bit definitions
 
#define _rbfl pir,0
#define _tbmt pir,1
#define _ca1ir pir,2
#define _ca2ir pir,3
#define _tm1ir pir,4
#define _tm2ir pir,5
#define _tm3ir pir,6
#define _irb pir,7
 
; PIE Bit definitions
 
#define _rcie pie,0
#define _txie pie,1
#define _ca1ie pie,2
#define _ca2ie pie,3
#define _tm1ie pie,4
#define _tm2ie pie,5
#define _tm3ie pie,6
#define _ieb pie,7
 
; RCSTA bit definitions
 
#define _rcd8 rcsta,0
#define _oerr rcsta,1
#define _ferr rcsta,2
#define _cren rcsta,4
#define _sren rcsta,5
#define _rc89 rcsta,6
#define _spen rcsta,7
; TXSTA bit definitions
 
#define _txd8 txsta,0
#define _trmt txsta,1
#define _sync txsta,4
#define _txen txsta,5
#define _tx89 txsta,6
#define _csrc txsta,7
 
; TCON1 bit definitions
 
#define _tmr1c tcon1,0
#define _tmr2c tcon1,1
#define _tmr3c tcon1,2
#define _tmr16 tcon1,3
#define _ca1ed0 tcon1,4
#define _ca1ed1 tcon1,5
#define _ca2ed0 tcon1,6
#define _ca2ed1 tcon1,7
 
; TCON2 bit definitions
 
#define _tmr1on tcon2,0
#define _tmr2on tcon2,1
#define _tmr3on tcon2,2
#define _ca1pr3 tcon2,3
#define _pwm1on tcon2,4
#define _pwm2on tcon2,5
#define _ca1ovf tcon2,6
#define _ca2ovf tcon2,7
 
LIST
 
 
/programy/ASM/servo_na_lod/DELAY.INC
0,0 → 1,75
;;
;; include DELAY.INC
;;
;;DELAY5 ; Delka spozdeni v nasobcich 5us
;;DELAY1 ; Delka spozdeni v nasobcich 1ms
;;
;
; Procedury pro generovani spozdeni SW prostredky
;
; Include 16C84.INC pro definici zakladnich registru
 
__DELAY__: ; Priznak modulu DELAY
 
ifndef __16C84__
error "Include file 16C84.INC"
endif
 
ifndef DELAY5
cblock
DELAY5
endc
endif
 
ifndef DELAY1
cblock
DELAY1
endc
endif
 
;-----------------------
;
; Short Delay - 6 az 1281 us 'a 5us --> 1+5*DELAY5 [us]
;
;-----------------------
;
; Vstup: DELAY5 pozadovane spozdeni v 5us jednotkach
; Nici: DELAY5
 
del_0:
goto $+1 ; Cyklus je 5us
delay5us:
decfsz DELAY5
goto del_0
return ; Cas pro call a return je take zapocten
 
;-----------------------
;
; Jednorazove spozdeni 10ms
;
;-----------------------
;
; Nici: W, DELAY1, DELAY5
 
delay10ms:
movlw 10
movwf DELAY1
 
;-----------------------
;
; Long Delay - 1 az 256 ms 'a 1ms --> 1000*DELAY1 + 3 [us]
;
;-----------------------
;
; Vstup: DELAY1 pozadovane spozdeni v 1ms
; Znici: W, DELAY5, DELAY1
 
delay1ms:
movlw (1000 / 5 ) - 2 ; 1us
movwf DELAY5 ; 1us
goto $+1 ; 2us
goto $+1 ; 2us
call delay5us ; 198 * 5 + 1 = 991us
decfsz DELAY1 ; 1/2us
goto delay1ms ; 2us
return ; 2us
/programy/ASM/servo_na_lod/KOPIE-~1.ASM
0,0 → 1,85
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page0 ; inicializace portu
movlw 0
movwf PORTA
movwf PORTB
 
page1
movlw 11110111B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
 
movlw 10 ; 10 ms
movwf DELAY1
call delay1ms
 
bsf PORTB, 3 ; ON
 
movlw 100 ; 100 * 5us = 0,5 ms
 
btfss PORTA, 1 ; Test TL1
movlw 200 ; 200 * 5us = 1 ms
 
btfss PORTB, 6 ; Test TL2
movlw 1 ; 1 * 5us = 0,005 ms
 
movwf DELAY5
call delay5us
 
movlw 1 ; 1 ms
movwf DELAY1
call delay1ms
 
bcf PORTB, 3 ; OFF
 
goto MainLoop
 
bcf PORTB, 2 ; zhasnuti LED
bcf PORTB, 1
btfss PORTA, 1 ; Test TL1
bsf PORTB, 2 ; rozsviceni LED2
 
btfss PORTB, 6 ; Test TL2
bsf PORTB, 1 ; rozsviceni LED2
 
goto MainLoop
;---------------
 
 
#include SERVO.INC
#include DELAY.INC
 
end
/programy/ASM/servo_na_lod/MPASM.EXE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/servo_na_lod/PRG.BAT
0,0 → 1,6
picpgr reset
picpgr program tep.hex hex xt
picpgr run
rem pause
rem picpgr stop
:end
/programy/ASM/servo_na_lod/RUN.BAT
0,0 → 1,9
mpasm servo
if errorlevel = 1 goto :end
rem pause
picpgr reset
picpgr program servo.hex hex xt pwt
rem picpgr run
rem pause
picpgr stop
:end
/programy/ASM/servo_na_lod/SERVO.ASM
0,0 → 1,95
#include 16C84.INC
 
org 0
 
goto Start
;--------------------
org 4
;--------------------
 
Start:
page1
movlw 00000000B ; inicializace citace a prescaleru
movwf TMR0
movlw 00000000B ; konfigurace preruseni
movwf INTCON
 
page1
movlw 11110111B ; nastaveni portu na vstup nebo vystup
movwf PORTA ; 1=vstup 0=vystup
movlw 11110001B
movwf PORTB
 
bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
 
page0
 
clrw ; vynulovani portu
movwf PORTA
movwf PORTB
 
bsf PORTA, 3 ; Pull-Up na tlacitka
 
bcf PORTB, 1 ; zhasnuti LED
bcf PORTB, 2
bcf PORTB, 3
 
MainLoop:
;prodleva 10ms
 
movlw 250 ; 2,5 ms
movwf CT10
call Delay10us
movlw 250 ; 2,5 ms
movwf CT10
call Delay10us
movlw 250 ; 2,5 ms
movwf CT10
call Delay10us
movlw 250 ; 2,5 ms
movwf CT10
call Delay10us
 
bsf PORTB, 1 ; ON
 
movlw 150
 
btfss PORTA, 1 ; Test TL1
movlw 100
 
btfss PORTB, 6 ; Test TL2
movlw 200
 
movwf CT10
call Delay10us
 
bcf PORTB, 1 ; OFF
 
 
bcf PORTB, 2 ; zhasnuti LED
bcf PORTB, 3
btfss PORTA, 1 ; Test TL1
bsf PORTB, 2 ; rozsviceni LED2
 
btfss PORTB, 6 ; Test TL2
bsf PORTB, 3 ; rozsviceni LED2
 
goto MainLoop
;---------------
 
Delay10us: ; Prodleva (DELAY10 * 10us)+3us
nop
nop
nop
nop
nop
nop
nop
decfsz CT10, 1
goto Delay10us
return
 
#include SERVO.INC
 
end
/programy/ASM/servo_na_lod/SERVO.COD
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/ASM/servo_na_lod/SERVO.ERR
--- servo_na_lod/SERVO.HEX (nonexistent)
+++ servo_na_lod/SERVO.HEX (revision 6)
@@ -0,0 +1,17 @@
+:020000000428D2
+:08000800831600308100003076
+:080010008B008316F730850018
+:08001800F1308600811783120C
+:08002000000185008600851532
+:08002800861006118611FA3062
+:080030008C003320FA308C0033
+:080038003320FA308C00332064
+:08004000FA308C003320861415
+:080048009630851C6430061F90
+:08005000C8308C00332086103B
+:0800580006118611851C061536
+:08006000061F86151728000099
+:08006800000000000000000090
+:08007000000000008C0B332896
+:0200780008007E
+:00000001FF
/programy/ASM/servo_na_lod/SERVO.INC
0,0 → 1,9
;----------------------------
; Definice promenych
;----------------------------
 
cblock
 
CT10
 
endc
/programy/ASM/servo_na_lod/SERVO.LST
0,0 → 1,303
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 1
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0001 #include 16C84.INC
0001 ;
0002 ; Definice registru a zakladnich maker pro 16C84
0003 ;
0004 processor 16C84
0005 radix D
0006
0000 0007 __16C84__: ; Priznak modulu 16C84
0008
0009 ; Definice registru
0010
0000 0011 IND0 equ 00H ; 0&1 Pristup na neprimou adresu
0001 0012 TMR0 equ 01H ; 0 Real Time clock counter
0002 0013 PCL equ 02H ; 0&1 Spodni cast PC
0003 0014 STATUS equ 03H ; 0&1 Stavove bity
0000 0015 _CARRY equ 0
0001 0016 _DC equ 1
0002 0017 _ZERO equ 2
0003 0018 _PD equ 3
0004 0019 _TO equ 4
0005 0020 _RP0 equ 5
0006 0021 _RP1 equ 6
0007 0022 _IRP equ 7
0004 0023 FSR equ 04H ; 0&1 Ukazatel pro neprime adresovani
0005 0024 PORTA equ 05H ; 0&1 Data a rizeni portu A
0006 0025 PORTB equ 06H ; 0&1 Data a rizeni portu B
0008 0026 EEDATA_0 equ 08H ; 0 Data EEPROM
0008 0027 EECON1_1 equ 08H ; 1 Rizeni EEPROM
0000 0028 _EERD equ 0
0001 0029 _EEWR equ 1
0002 0030 _EEWREN equ 2
0003 0031 _EEWRERR equ 3
0004 0032 _EEIF equ 4
0009 0033 EEADR_0 equ 09H ; 0 Adresa EEPROM
0009 0034 EECON2_1 equ 09H ; 1 Aktivacni pseudoregistr
000A 0035 PCLATH equ 0AH ; 0&1 Horni cast PC pro move
000B 0036 INTCON equ 0BH ; 0&1 Rizeni preruseni
0000 0037 _RBIF equ 0 ;
0001 0038 _INTF equ 1
0002 0039 _T0IF equ 2
0003 0040 _RBIE equ 3
0004 0041 _INTE equ 4
0005 0042 _T0IE equ 5
0006 0043 _EEIE equ 6
0007 0044 _GIE equ 7
0045
0046 page0 macro
0047 bcf STATUS,_RP0
0048 endm
0049
0050 page1 macro
0051 bsf STATUS,_RP0
0052 endm
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 2
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0053 ;
0054 ; Sada maker pro porovnani a skoky
0055 ;
0056
0057 ;--- Compare ---
0058 CMP macro ZNAK, PROCEDURA ; if W=ZNAK then goto PROCEDURA
0059 xorlw ZNAK ; if W#ZNAK then zachovej W a neskakej
0060 btfsc STATUS,_ZERO
0061 goto PROCEDURA
0062 xorlw ZNAK
0063 endm
0064
0065 ;--- Skip if Carry ---
0066 SC macro
0067 btfss STATUS,_CARRY
0068 endm
0069
0070 ;--- Skip if not Carry ---
0071 SNC macro
0072 btfsc STATUS,_CARRY
0073 endm
0074
0075 ;--- Skip if Zero ---
0076 SZ macro
0077 btfss STATUS,_ZERO
0078 endm
0079
0080 ;--- Skip if not Zero ---
0081 SNZ macro
0082 btfsc STATUS,_ZERO
0083 endm
0084
0085 ;--- Skip if Borrow ( Negative ) --- ( po odecitani )
0086 SB macro
0087 btsfsc STATUS,_CARRY
0088 endm
0089 SN macro
0090 btfsc STATUS,_CARRY
0091 endm
0092
0093 ;--- Skip if not Borrow ( Positive ) --- ( po odecitani )
0094 SNB macro
0095 btfss STATUS,_CARRY
0096 endm
0097 SP macro
0098 btfss STATUS,_CARRY
0099 endm
0100
0101 cblock 0CH ; Prvni volny registr
0102 endc
0001
0002
0003 org 0
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 3
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0004
0000 2804 0005 goto Start
0006 ;--------------------
0007 org 4
0008 ;--------------------
0009
0004 0010 Start:
0011 page1
0004 1683 M bsf STATUS,_RP0
0005 3000 0012 movlw 00000000B ; inicializace citace a prescaleru
0006 0081 0013 movwf TMR0
0007 3000 0014 movlw 00000000B ; konfigurace preruseni
0008 008B 0015 movwf INTCON
0016
0017 page1
0009 1683 M bsf STATUS,_RP0
000A 30F7 0018 movlw 11110111B ; nastaveni portu na vstup nebo vystup
000B 0085 0019 movwf PORTA ; 1=vstup 0=vystup
000C 30F1 0020 movlw 11110001B
000D 0086 0021 movwf PORTB
0022
000E 1781 0023 bsf TMR0, 7 ; vypni pull-up na PORTB (OPTION registr)
0024
0025 page0
000F 1283 M bcf STATUS,_RP0
0026
0010 0100 0027 clrw ; vynulovani portu
0011 0085 0028 movwf PORTA
0012 0086 0029 movwf PORTB
0030
0013 1585 0031 bsf PORTA, 3 ; Pull-Up na tlacitka
0032
0014 1086 0033 bcf PORTB, 1 ; zhasnuti LED
0015 1106 0034 bcf PORTB, 2
0016 1186 0035 bcf PORTB, 3
0036
0017 0037 MainLoop:
0038 ;prodleva 10ms
0039
0017 30FA 0040 movlw 250 ; 2,5 ms
0018 008C 0041 movwf CT10
0019 2033 0042 call Delay10us
001A 30FA 0043 movlw 250 ; 2,5 ms
001B 008C 0044 movwf CT10
001C 2033 0045 call Delay10us
001D 30FA 0046 movlw 250 ; 2,5 ms
001E 008C 0047 movwf CT10
001F 2033 0048 call Delay10us
0020 30FA 0049 movlw 250 ; 2,5 ms
0021 008C 0050 movwf CT10
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 4
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0022 2033 0051 call Delay10us
0052
0023 1486 0053 bsf PORTB, 1 ; ON
0054
0024 3096 0055 movlw 150
0056
0025 1C85 0057 btfss PORTA, 1 ; Test TL1
0026 3064 0058 movlw 100
0059
0027 1F06 0060 btfss PORTB, 6 ; Test TL2
0028 30C8 0061 movlw 200
0062
0029 008C 0063 movwf CT10
002A 2033 0064 call Delay10us
0065
002B 1086 0066 bcf PORTB, 1 ; OFF
0067
0068
002C 1106 0069 bcf PORTB, 2 ; zhasnuti LED
002D 1186 0070 bcf PORTB, 3
0071
002E 1C85 0072 btfss PORTA, 1 ; Test TL1
002F 1506 0073 bsf PORTB, 2 ; rozsviceni LED2
0074
0030 1F06 0075 btfss PORTB, 6 ; Test TL2
0031 1586 0076 bsf PORTB, 3 ; rozsviceni LED2
0077
0032 2817 0078 goto MainLoop
0079 ;---------------
0080
0033 0081 Delay10us: ; Prodleva (DELAY10 * 10us)+3us
0033 0000 0082 nop
0034 0000 0083 nop
0035 0000 0084 nop
0036 0000 0085 nop
0037 0000 0086 nop
0038 0000 0087 nop
0039 0000 0088 nop
003A 0B8C 0089 decfsz CT10, 1
003B 2833 0090 goto Delay10us
003C 0008 0091 return
0092
0093 #include SERVO.INC
0001 ;----------------------------
0002 ; Definice promenych
0003 ;----------------------------
0004
0005 cblock
000C 0006
000C 0007 CT10
000D 0008
0009 endc
0093
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 5
 
 
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
 
0094
0095 end
0096
MPASM 01.02 Released SERVO.ASM 8-21-1999 18:28:26 PAGE 6
 
 
SYMBOL TABLE
 
LABEL VALUE
 
CT10 000C
Delay10us 0033
EEADR_0 0009
EECON1_1 0008
EECON2_1 0009
EEDATA_0 0008
FSR 0004
IND0 0000
INTCON 000B
MainLoop 0017
PCL 0002
PCLATH 000A
PORTA 0005
PORTB 0006
STATUS 0003
Start 0004
TMR0 0001
_CARRY 0000
_DC 0001
_EEIE 0006
_EEIF 0004
_EERD 0000
_EEWR 0001
_EEWREN 0002
_EEWRERR 0003
_GIE 0007
_INTE 0004
_INTF 0001
_IRP 0007
_PD 0003
_RBIE 0003
_RBIF 0000
_RP0 0005
_RP1 0006
_T0IE 0005
_T0IF 0002
_TO 0004
_ZERO 0002
__16C84__ 0000
 
 
MEMORY USAGE MAP ('X' = Used, '-' = Unused)
 
0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXX---
0040 : ---------------- ---------------- ---------------- ----------------
 
All other memory blocks unused.
 
 
Errors : 0
Warnings : 0
Messages : 0
 
/programy/ASM/servo_na_lod/vssver.scc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property