📄 dal_bus.lst
字号:
00000000 M cycles -=2
M endw
M endif
M
M if (cycles > 0)
M nop
M
M endif
M exitm
0012 1605 00043 bsf DALLAS_BUS ;end of low pulse
00044 Wait 59 Microsec,0 ; (Tslot + Trec) - Tlow1
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
003B M variable cycles = ((59 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 10
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
003B M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
0013 3012 M movlw ((cycles-5)/3)
0014 2??? M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
M
M exitm
0015 0008 00045 return
00046
00047 ;****************************************************************************
00048 ;*
00049 ;* Write a ZERO on the Dallas bus
00050 ;*
00051 ;****************************************************************************
00052
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 11
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0016 1605 00053 DSWriteaZero bsf DALLAS_BUS ;just in case it isn't
0017 0000 00054 nop
0018 1205 00055 bcf DALLAS_BUS ;start/sync edge
00056 Wait 60 Microsec,0 ; Tlow0
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
003C M variable cycles = ((60 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
003C M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
0019 3012 M movlw ((cycles-5)/3)
001A 2??? M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 12
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M
M exitm
001B 1605 00057 bsf DALLAS_BUS ;end of low pulse
00058 Wait 1 Microsec,0 ; Trec
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
0001 M variable cycles = ((1 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
0001 M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
M movlw ((cycles-5)/3)
M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 13
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M
M exitm
M endif
M
M if (cycles < 8)
M while ( cycles > 1 )
M
M goto $+1 ;two cycle nop
M
M cycles -=2
M endw
M endif
M
M if (cycles > 0)
001C 0000 M nop
M
M endif
M exitm
001D 0008 00059 return
00060
00061 ;****************************************************************************
00062 ;*
00063 ;* Write byte in DScommbuff or W to the Dallas bus
00064 ;*
00065 ;****************************************************************************
00066
001E 00?? 00067 DSWriteByteW movwf DScommbuff ;store W
001F 1605 00068 DSWriteByte bsf DALLAS_BUS ;just in case it isn't
0020 3008 00069 movlw 0x08 ;byte is 8 bits
0021 00?? 00070 movwf count
0022 1205 00071 DSWriteLoop bcf DALLAS_BUS ;start/sync edge
00072 Wait 2 Microsec,1 ; Tlow1
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
0002 M variable cycles = ((2 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (1) )
M messg NOTE - negative delay time with 1 cycles (no code)
M
M exitm
M else
0001 M variable cycles = (cycles - (1))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 14
LOC OBJECT CODE LINE SOURCE TEXT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -