亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 93c46.asm

?? PIC子程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
;********************************************************************
;*                      PICALC Directives Section                   *
;********************************************************************

	SUBTITL "93C46 3 WIRE INTERFACE ROUTINE"
	LIST     P=16C54,N=40,C=132


;********************************************************************
;*                      Register Assignments                        *
;********************************************************************

indir   equ     0x00            ;Use this register as source/destination for
				;indirect addressing.
pc      equ     0x02            ;PIC Program Counter.
status  equ     0x03            ;PIC Status Register.
fsr     equ     0x04            ;File Select Register.
serial  equ     0x05            ;Port used for 93C46 control.  Since Port A
				;is 4 bits wide, we'll use all of Port A.

				;The following three registers must be
				;located consecutively in memory.
cmd     equ     0x10            ;This register contains the 2 bit 93C46
				;command is the upper 2 bit positions and
				;memory address in the lower 6.
highb   equ     0x11            ;Used in read/write routines to store the
				;upper byte of a 16 bit 93C46 data word.
lowb    equ     0x12            ;Used in read/write routines to store the
				;lower byte of a 16 bit 93C46 data word.

cnthi   equ     0x13            ;Used as the upper byte of a sixteen bit loop
				;counter in RDYCHK routine.
cnt     equ     0x14            ;Used as the lower byte of a sixteen bit loop
				;counter in RDYCHK routine, and elsewhere as
				;an eight bit counter.

;********************************************************************
;*                      Bit Assignments                             *
;********************************************************************

carry   equ     0               ;Carry Flag of Status Register.
zflag   equ     2               ;Zero Flag of Status Register.

;For the 3 wire interface, connect the din and dout to the same
;i/o line of the PIC16C5X.
cs      equ     0               ;Port pin tied to CS on 93C46.
din     equ     1               ;Port pin tied to DI on 93C46.
dout    equ     1               ;Port pin tied to DO on 93C46.
clock   equ     2               ;Port pin tied to CLK on 93C46.

;********************************************************************
;*                      General Assignments                         *
;********************************************************************

no_err  equ     0               ;
error   equ     1               ;
tries   equ     0x04            ;After issuing a WRITE, ERASE, ERAL, or WRAL
				;command, the approximate number of machine
				;cycles X 256 to wait for the RDY status.
				;This value must be adjusted for operating
				;frequencies other than 4 MHz.

read    equ     0x80            ;93C46 Read command.
write   equ     0x40            ;93C46 Write command.
erase   equ     0xC0            ;93C46 Erase command.
ewen    equ     0x30            ;93C46 Erase/Write Enable command.
ewds    equ     0x00            ;93C46 Erase/Write Disable command.
eral    equ     0x20            ;92CXX Erase All command.
wral    equ     0x10            ;92CXX Write All command.

;********************************************************************
;*                      Macro Definitions                           *
;********************************************************************

sel     MACRO                   ;Selects the 93C46 device.
	bsf     serial,cs       ;Chip Select (CS) = '1' to select the device.
	ENDM

dsel    MACRO                   ;De-select the 93C46 device.
	bcf     serial,cs       ;Chip Select (CS) = '0' to de-select the
				;device.
	ENDM

strtbt  MACRO                   ;Issue the Start Bit to the 93C46.
	bsf     serial,din      ;Start Bit = '1'.
	clkit                   ;Clock it out.
	ENDM

clkit   MACRO                   ;Clocks a serial data bit into or out of the
				;93C46 device.
	bsf     serial,clock    ;Clock (CLK) = '1'.

	nop                     ;Adjust the number of nop instructions
				;between the assertion and de-assertion of
				;CLK in proportion to the PIC operating
				;frequency.  Refer to the 93C46 data for the
				;minimum CLK period.
				
	bcf     serial,clock    ;Clock (CLK) = '0'.
	ENDM

;********************************************************************
;*                      Power-On/Reset Entry Point                  *
;********************************************************************

reset_  org     0x1FF
	goto    main

;********************************************************************
;*                      93C46 Routines                              *
;********************************************************************
	org     0x000           ;Locate all subroutines in the lower half of
				;a Program Memory Page.

;********************************************************************
;*                      DOUT8                                       *
;********************************************************************
				;Dout8 will output 8 bits of data to the
				;93C46.  Before calling this routine, the FSR
				;must point to the byte being transmitted.

dout8   movlw   0x08            ;Initialize loop counter.
	movwf   cnt             ;

d_o_8   bcf     serial,din      ;Assume that the bit to be transfered is a
				;'0'.  Hence, de-assert DI.
	rlf     indir           ;Rotate the actual bit to be transferred into
				;the carry bit.
	btfsc   status,carry    ;Test the carry, if our assumption was
				;correct, skip the next instruction.
	bsf     serial,din      ;No, actual bit was a '1'.  Assert DI.
	clkit                   ;Clock the 93C46.
	decfsz  cnt             ;Repeat until cnt = 0.
	goto    d_o_8           ;Cnt still > 0.
	rlf     indir           ;Restore register to its original condition.
	retlw   no_err          ;Exit with good status.

;********************************************************************
;*                      DIN8                                        *
;********************************************************************
				;Din8 will input 8 bits of data from the
				;93C46.  Before calling this routine, the FSR
				;must point to the register being used to
				;hold the incomming data.
din8    movlw   0x08            ;Initialize loop counter.
	movwf   cnt             ;
;for the 3 wire interface the direction of the i/o line connected to
;din and dout has to converted from an output to an input.
	movlw   b'00000010'     ;convert RA1 to an input
	tris    serial          ;       /

d_i_8   clkit                   ;Clock a bit out of the 93C46.
	rlf     indir           ;Make room for the incomming bit in the
				;destination register.
	bcf     indir,0         ;Assume that the incomming bit is a '0' and
				;clear the LSB of the destination register.
	btfsc   serial,dout     ;Test the incomming bit, if our assumption
				;was correct, skip the next instruction.
	bsf     indir,0         ;No, actual bit is a '1'.  Set the LSB of the
				;destination register.
	decfsz  cnt             ;Repeat until cnt = 0.
	goto    d_i_8           ;Cnt still > 0
;for a 3 wire interface, convert the RA1 line back to an output
	movlw   0               ;make RA1 to an output
	tris    serial          ;       /
	retlw   no_err          ;Exit with good status.

;********************************************************************
;*                      RDYCHK                                      *
;********************************************************************
				;Rdychk will read the 93C46 READY/BUSY status
				;and wait for RDY status within the alloted
				;number of processor cycles.  If RDY status
				;is not present after this set period, the
				;routine will return with an error status.

rdychk  movlw   tries           ;Initialize time-out counter.
	movwf   cnthi           ;
	clrf    cnt             ;
;for a 3 wire interface, make the RA1 line an input

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区四区久久| 成人性生交大片免费看视频在线| 免费在线成人网| 国产精品亚洲一区二区三区妖精| 本田岬高潮一区二区三区| 色网站国产精品| 日韩一卡二卡三卡四卡| 精品88久久久久88久久久 | 精品日韩在线观看| 国产午夜精品一区二区三区四区| 欧美日韩卡一卡二| 亚洲精品国产第一综合99久久| 欧美日本在线观看| 欧美精品高清视频| 欧美性欧美巨大黑白大战| 欧美日韩三级视频| 国内久久精品视频| 国产成人免费在线观看| 蜜桃视频一区二区三区| 老司机精品视频一区二区三区| 免播放器亚洲一区| 韩国午夜理伦三级不卡影院| 国产麻豆视频一区二区| 国产东北露脸精品视频| 免费在线观看一区| 国内精品视频一区二区三区八戒| 国产精品一区二区男女羞羞无遮挡| 国产一区二区三区电影在线观看 | 欧美日韩在线一区二区| 成人精品gif动图一区| 色婷婷精品大在线视频| 91黄视频在线| 欧美一级黄色片| 欧美日韩在线不卡| 精品国产不卡一区二区三区| 亚洲天堂福利av| 麻豆精品蜜桃视频网站| 91蝌蚪porny| 欧美大片一区二区| 亚洲乱码中文字幕| 国产成人精品影院| 日韩美女一区二区三区| 丁香一区二区三区| 日韩精品色哟哟| 色香色香欲天天天影视综合网| 成人午夜激情片| 国产视频一区不卡| 国产精品一区在线观看乱码| 欧美一区国产二区| 一区二区三区在线免费播放| 成人美女在线视频| 国产婷婷色一区二区三区在线| 久久99精品久久久久久动态图 | 91麻豆国产自产在线观看| 亚洲自拍另类综合| 色伊人久久综合中文字幕| 一区二区三区四区五区视频在线观看 | 555夜色666亚洲国产免| 午夜激情综合网| 欧美色偷偷大香| 蜜芽一区二区三区| 日韩一级黄色片| 激情综合网最新| 欧美国产视频在线| jiyouzz国产精品久久| 91国在线观看| 蜜桃传媒麻豆第一区在线观看| 91精品国产色综合久久不卡蜜臀 | 欧美成人一区二区| 国产一区二区在线影院| 国产精品丝袜91| 捆绑调教美女网站视频一区| 精品剧情在线观看| 丁香天五香天堂综合| 一区二区三区在线视频观看| 欧美日韩激情在线| 国产精华液一区二区三区| 亚洲一区二区av在线| 精品国产免费视频| 91啪亚洲精品| 秋霞电影网一区二区| 国产精品香蕉一区二区三区| 亚洲国产精品精华液2区45| 欧美午夜电影网| 日本一不卡视频| 亚洲天堂av一区| 久久你懂得1024| 91福利视频在线| eeuss国产一区二区三区| 国产老肥熟一区二区三区| 亚洲成人手机在线| 亚洲制服丝袜在线| 国产亚洲综合色| 欧美日韩精品电影| 成人动漫一区二区| 久久99国产精品免费| 69成人精品免费视频| 欧美卡1卡2卡| 欧美日韩一区二区电影| 99久久久免费精品国产一区二区| 精品一区二区在线视频| 麻豆精品视频在线观看免费| 国产欧美一区二区精品婷婷| 国产亚洲一二三区| 亚洲精品在线电影| 欧美综合欧美视频| 制服丝袜亚洲色图| 精品少妇一区二区三区在线视频| 精品成人一区二区| 久久午夜色播影院免费高清| 久久九九久久九九| 国产精品护士白丝一区av| 亚洲va韩国va欧美va| 日日夜夜免费精品| 国产揄拍国内精品对白| 91老师国产黑色丝袜在线| 美女国产一区二区三区| 国产成人免费视| 欧美调教femdomvk| 久久精品亚洲一区二区三区浴池| 日本一区二区三区久久久久久久久不| 久久久久久久久久久99999| 亚洲综合激情另类小说区| 一区二区视频免费在线观看| 免费视频一区二区| 97精品久久久午夜一区二区三区 | 免费观看在线综合色| 丁香网亚洲国际| 欧美成人video| 国产精品入口麻豆九色| 美国毛片一区二区三区| 欧美日韩国产综合一区二区三区| 久久久久国产成人精品亚洲午夜| 一区二区三区日韩欧美精品| 久99久精品视频免费观看| 欧美日韩美少妇| 国产午夜精品福利| 欧洲视频一区二区| 国产一区二区精品在线观看| 国产日韩欧美亚洲| 色综合久久中文综合久久牛| 日韩电影在线观看网站| 日本一区二区久久| 日韩一区二区中文字幕| 国产99精品国产| 日韩中文字幕亚洲一区二区va在线 | 午夜精品久久久久久久99水蜜桃| 91精品欧美综合在线观看最新| 国产精品12区| 日韩av在线免费观看不卡| 国产精品水嫩水嫩| 日韩欧美电影一区| 欧美日韩精品是欧美日韩精品| 国产福利电影一区二区三区| 亚洲一区二区在线观看视频| 精品久久久久一区| 欧美一级高清片在线观看| 一本到三区不卡视频| 成人综合日日夜夜| 国产精品一区二区三区99| 免费高清成人在线| 亚洲电影视频在线| 亚洲精品写真福利| 国产精品三级电影| 国产精品无遮挡| 中文字幕高清一区| 日本一区二区成人在线| 久久精品人人爽人人爽| 欧美激情一区二区三区在线| 久久亚洲一级片| 26uuu精品一区二区三区四区在线| 日韩午夜精品视频| 久久日韩精品一区二区五区| 精品国产免费一区二区三区香蕉| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 91丨porny丨最新| 色吧成人激情小说| 欧美一级午夜免费电影| 欧美sm美女调教| 国产午夜精品久久久久久免费视 | 欧美日韩成人高清| 欧美成人三级电影在线| 亚洲国产高清不卡| 亚洲丰满少妇videoshd| 久久精品国产99久久6| 成人一道本在线| 欧美夫妻性生活| 国产精品卡一卡二卡三| 丝袜美腿亚洲综合| 国产精品自拍一区| 精品视频123区在线观看| 久久久久久久一区| 亚洲美女屁股眼交| 黄色成人免费在线| 欧洲av在线精品| 国产精品久久777777| 青青草91视频| 欧美色倩网站大全免费| 国产精品不卡一区二区三区| 视频一区中文字幕|