亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品一二三区| 亚洲国产日韩a在线播放性色| 中文字幕日韩精品一区| 亚洲激情一二三区| 日本不卡视频在线观看| 国产成人99久久亚洲综合精品| 99国产精品国产精品久久| 欧美日韩综合一区| 久久亚洲欧美国产精品乐播| 亚洲欧美另类久久久精品| 丝袜美腿亚洲一区二区图片| 国产精品一级片在线观看| 色综合天天做天天爱| 欧美成人性战久久| 亚洲欧美激情在线| 久久精品久久综合| 91福利在线看| 欧美精品一区二区三区四区| 亚洲精品videosex极品| 精品一区二区三区免费观看| 在线观看欧美黄色| 久久免费的精品国产v∧| 一区二区免费看| 国产精品夜夜嗨| 欧美日韩国产天堂| 国产精品不卡在线| 久久精品国产一区二区三| 一道本成人在线| 2021中文字幕一区亚洲| 亚洲午夜精品网| 丁香激情综合五月| 日韩一级免费一区| 一区二区在线观看av| 国产成人在线观看| 91精品国产91热久久久做人人| 欧美韩国日本综合| 极品少妇xxxx精品少妇| 欧美揉bbbbb揉bbbbb| 综合久久综合久久| 国产福利精品导航| 91精品国产色综合久久不卡电影| 中文字幕亚洲区| 国产精品69毛片高清亚洲| 欧美一区二区精品久久911| 一区二区三区色| 成人黄色网址在线观看| 精品乱人伦一区二区三区| 亚洲h在线观看| 色菇凉天天综合网| 国产精品区一区二区三区 | 色哟哟国产精品| 久久精品夜色噜噜亚洲a∨| 亚洲6080在线| 欧美三级乱人伦电影| 亚洲精品日产精品乱码不卡| 国产69精品久久777的优势| 欧美成人性福生活免费看| 午夜久久福利影院| 在线观看国产精品网站| 亚洲色欲色欲www在线观看| 国产成人av一区二区三区在线观看| 欧美一级国产精品| 日日夜夜一区二区| 欧美日韩一卡二卡| 亚洲高清中文字幕| 欧美视频一区二区三区四区| 亚洲综合小说图片| 一本一道波多野结衣一区二区| 最新日韩av在线| 9久草视频在线视频精品| 国产人久久人人人人爽| 国产精品一区二区久久精品爱涩| 精品国产露脸精彩对白| 九九视频精品免费| 久久夜色精品国产欧美乱极品| 久久成人精品无人区| 精品少妇一区二区三区| 久久99精品国产.久久久久久| 日韩欧美精品三级| 精品一区二区在线观看| 久久久久九九视频| 成人国产亚洲欧美成人综合网| 欧美国产精品久久| 99麻豆久久久国产精品免费| 亚洲欧美在线观看| 91日韩在线专区| 亚洲综合激情网| 欧美精品欧美精品系列| 毛片av中文字幕一区二区| 精品日韩在线观看| 国产麻豆成人传媒免费观看| 国产日韩在线不卡| caoporn国产精品| 亚洲免费av网站| 69堂精品视频| 国产美女视频一区| 亚洲欧洲日韩av| 欧美视频一区二区三区四区| 青青草国产精品97视觉盛宴| 久久久夜色精品亚洲| av爱爱亚洲一区| 性久久久久久久久久久久 | 国产乱人伦偷精品视频免下载 | 成人av动漫在线| 亚洲精品一二三| 91麻豆精品91久久久久久清纯 | 久久久精品影视| 9人人澡人人爽人人精品| 亚洲一区二区三区激情| 日韩写真欧美这视频| 国产成人精品三级| 亚洲人成在线播放网站岛国| 欧美日韩一区在线| 国内精品自线一区二区三区视频| 国产精品剧情在线亚洲| 欧美日韩一卡二卡| 国产成人亚洲综合a∨婷婷图片| 中文字幕欧美一| 在线播放亚洲一区| 成人黄页在线观看| 日韩电影免费一区| 国产精品视频麻豆| 欧美久久高跟鞋激| 大陆成人av片| 婷婷六月综合亚洲| 国产精品沙发午睡系列990531| 欧美老女人在线| 东方欧美亚洲色图在线| 午夜电影网亚洲视频| 久久久久国产一区二区三区四区| 91黄视频在线观看| 国产精品一二三四| 天天做天天摸天天爽国产一区| 中文字幕不卡在线观看| 777奇米四色成人影色区| av男人天堂一区| 久久99热狠狠色一区二区| 亚洲天堂2016| 欧美日韩精品一区二区| 青青青伊人色综合久久| 亚洲精品成人天堂一二三| 日韩精品综合一本久道在线视频| 国产91精品一区二区麻豆网站| 日产国产欧美视频一区精品 | 亚洲欧美一区二区三区国产精品| 日韩午夜三级在线| 99精品视频免费在线观看| 日本不卡中文字幕| 自拍偷拍欧美精品| 欧美一二三区在线观看| 91久久精品一区二区三| 国产综合久久久久久鬼色| 亚洲一区二区三区免费视频| 亚洲国产精品av| 欧美成人一区二区三区在线观看| 99re视频精品| 国产精品99久久久久久久女警 | 欧美日韩视频一区二区| 99精品欧美一区| 久久精品国产亚洲高清剧情介绍| 亚洲免费观看高清完整版在线 | 激情偷乱视频一区二区三区| 亚洲一二三区不卡| 国产精品美女久久久久久| 欧美mv日韩mv国产网站app| 91一区二区在线| www.亚洲色图.com| 韩国女主播一区二区三区| 五月婷婷色综合| 日本一区二区三区四区在线视频| 精品粉嫩aⅴ一区二区三区四区| 欧美天堂一区二区三区| 99re这里只有精品首页| 国产精品白丝jk黑袜喷水| 国产在线一区观看| 免费av成人在线| 五月综合激情网| 亚洲宅男天堂在线观看无病毒| 亚洲欧美电影院| 国产精品三级av在线播放| 国产午夜精品久久久久久免费视| 日韩一卡二卡三卡| 日韩欧美高清一区| 欧美一区午夜视频在线观看| 欧美色综合网站| 在线视频欧美精品| 欧美色图在线观看| 色播五月激情综合网| 99热这里都是精品| 不卡大黄网站免费看| 国产一二精品视频| 国产剧情在线观看一区二区| 精品一区二区三区在线观看国产| 日本91福利区| 亚洲夂夂婷婷色拍ww47| 亚洲成av人综合在线观看| 亚洲福利视频一区二区| 亚洲一区二区三区视频在线播放 | 日韩精品一二三| 天天综合色天天综合色h|