亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美成人精品福利| 狠狠色2019综合网| 欧美一区二区视频在线观看2020| 亚洲成人久久影院| 久久综合色天天久久综合图片| 国产91精品精华液一区二区三区| 日韩av网站在线观看| 一区二区理论电影在线观看| 在线国产电影不卡| 激情欧美一区二区三区在线观看| 欧美精品日韩一本| 日日夜夜精品视频免费| 91精品在线免费| 免费观看在线色综合| 日韩欧美国产一区二区三区| 久久精品国产精品亚洲红杏| 26uuu精品一区二区在线观看| 精品一区二区免费在线观看| 久久久久免费观看| 成人黄页毛片网站| 午夜一区二区三区视频| 91精品国产一区二区| 国产一区二区三区| 一区二区视频在线| 欧美成人免费网站| 色av一区二区| 韩国女主播一区二区三区| 日韩毛片一二三区| 日韩女优电影在线观看| 成人高清伦理免费影院在线观看| 国产精品国模大尺度视频| 欧美丰满一区二区免费视频| 国产一区二区三区最好精华液| 国产精品无码永久免费888| 欧美色综合网站| 粉嫩蜜臀av国产精品网站| 亚洲一区二区在线播放相泽| 精品国产伦一区二区三区观看方式 | 最新国产成人在线观看| 欧美日韩国产美| 日本韩国一区二区三区视频| 国产一区二区在线观看免费 | 一区二区三区四区激情 | 精品国产免费一区二区三区四区| 91丨九色丨蝌蚪富婆spa| 国产成人久久精品77777最新版本| 午夜精品一区二区三区三上悠亚 | 欧美精品一区二区三区蜜桃| 精品视频1区2区| 色88888久久久久久影院按摩| 国产精品亚洲人在线观看| 亚洲成人手机在线| 亚洲一区日韩精品中文字幕| ...av二区三区久久精品| 国产精品欧美久久久久无广告 | 精品国产乱码久久久久久久| 正在播放一区二区| 91精品国产色综合久久不卡蜜臀 | 琪琪久久久久日韩精品| 亚洲与欧洲av电影| 亚洲成人www| 亚洲成人av在线电影| 亚洲一区二区免费视频| 亚洲电影视频在线| 日韩精品电影在线| 美女一区二区三区在线观看| 久久精品99国产精品日本| 精品亚洲免费视频| 国产精品综合一区二区三区| 精品在线一区二区三区| 成人美女在线视频| 在线日韩av片| 欧美大白屁股肥臀xxxxxx| 久久午夜国产精品| 亚洲精品国产无天堂网2021| 婷婷国产在线综合| 精东粉嫩av免费一区二区三区| 粉嫩av一区二区三区在线播放| av午夜一区麻豆| 日韩视频一区二区在线观看| 日韩欧美电影一区| 1024成人网色www| 经典三级在线一区| 欧美人妇做爰xxxⅹ性高电影| 久久免费视频色| 日韩va亚洲va欧美va久久| gogogo免费视频观看亚洲一| 欧美日韩久久一区| 亚洲男同性恋视频| 国产最新精品免费| 欧美一区二区三区成人| 亚洲三级理论片| 国产99久久久国产精品潘金| 69p69国产精品| 亚洲综合激情另类小说区| 成人黄色网址在线观看| 久久日韩粉嫩一区二区三区| 日韩va亚洲va欧美va久久| 91久久精品一区二区三区| 亚洲色图在线播放| 不卡的av网站| 一区二区三区精品在线观看| av一二三不卡影片| 久久综合九色综合欧美就去吻| 成人免费视频视频在线观看免费 | 日韩和欧美一区二区三区| 91蜜桃免费观看视频| 国产精品大尺度| bt7086福利一区国产| 国产精品久久久久久久久久久免费看 | 国产精品一区久久久久| 亚洲精品一区二区三区影院 | 午夜欧美在线一二页| 日本道色综合久久| 日日摸夜夜添夜夜添亚洲女人| 欧美日韩成人高清| 国产一区在线视频| 亚洲欧美另类久久久精品| 色播五月激情综合网| 亚洲小说欧美激情另类| 欧美精品久久久久久久多人混战| 视频精品一区二区| 精品久久久影院| 色噜噜狠狠成人网p站| 日韩不卡在线观看日韩不卡视频| 日韩一本二本av| 99精品欧美一区二区三区综合在线| 亚洲综合色在线| 精品成人私密视频| 欧美亚洲综合另类| 成人一二三区视频| 婷婷亚洲久悠悠色悠在线播放| 精品美女一区二区| 8v天堂国产在线一区二区| 99久久精品国产毛片| 久久国产乱子精品免费女| 成人免费在线视频| 久久精品一区二区三区四区| 欧美日韩中文精品| 97久久精品人人澡人人爽| 美日韩一级片在线观看| 天天射综合影视| 亚洲线精品一区二区三区八戒| 国产精品国产三级国产有无不卡| 日韩欧美一二三区| 欧美一区二区国产| 欧美精品久久天天躁| 欧美日本一道本在线视频| 色综合久久久久综合| 91视频免费播放| 成人激情动漫在线观看| 国产v综合v亚洲欧| 成人亚洲一区二区一| 国产成人在线看| 成a人片国产精品| 91福利视频久久久久| 91久久精品网| 欧美一级国产精品| 久久网站最新地址| 中文字幕欧美激情一区| 中文字幕+乱码+中文字幕一区| 亚洲国产精华液网站w| 国产精品每日更新| 一区二区三区电影在线播| 亚洲gay无套男同| 男女性色大片免费观看一区二区| 日韩激情在线观看| 亚洲一区二区三区中文字幕| 亚洲综合丁香婷婷六月香| 日韩精品乱码av一区二区| 国产成人综合视频| 成人黄色小视频| 欧美日韩一区三区四区| 日韩欧美精品三级| 亚洲欧美日韩一区| 蜜桃视频在线观看一区| 91在线无精精品入口| 欧美日本乱大交xxxxx| 国产午夜精品福利| 日韩经典中文字幕一区| 成人永久aaa| 久久久亚洲高清| 免费高清在线视频一区·| 99久久婷婷国产| 久久亚洲一级片| 视频一区视频二区在线观看| 国产麻豆精品theporn| 欧美人xxxx| 亚洲国产精品一区二区www| 国产成人高清视频| 国产色一区二区| 国产自产v一区二区三区c| 日韩欧美中文一区二区| 亚洲va国产天堂va久久en| 欧美亚洲一区二区三区四区| 国产精品二三区| av电影天堂一区二区在线观看| 国产欧美精品一区aⅴ影院| 狠狠色丁香婷婷综合久久片| 欧美精品欧美精品系列|