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

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

?? 93c46.asm

?? PIC16CXX C語言工具
?? 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一区二区三区免费野_久草精品视频
日本亚洲视频在线| 91麻豆国产福利精品| 99久久久久久| 日韩一级二级三级精品视频| 国产精品久久一卡二卡| 美女网站视频久久| 色综合天天做天天爱| 久久综合资源网| 午夜精品视频一区| 91久久精品一区二区二区| 国产日韩成人精品| 国产在线不卡一区| 精品少妇一区二区| 亚洲一区二区三区美女| 99久久99精品久久久久久| 精品对白一区国产伦| 日本欧美在线观看| 欧美日韩中文字幕一区二区| 亚洲欧美乱综合| 91视频com| 亚洲欧美日韩国产一区二区三区 | 日日欢夜夜爽一区| 99视频在线精品| 国产精品福利一区二区| 国产高清无密码一区二区三区| 精品少妇一区二区三区| 美女一区二区三区在线观看| 欧美日韩国产一二三| 亚洲精品videosex极品| 91日韩精品一区| 亚洲精品中文字幕在线观看| 在线观看免费亚洲| 一区二区三区四区高清精品免费观看| av在线不卡电影| 亚洲免费资源在线播放| 色综合网色综合| 一二三区精品视频| 欧美高清视频一二三区| 亚洲美女在线一区| 欧美色图12p| 石原莉奈在线亚洲二区| 日韩欧美区一区二| 国产精品亚洲综合一区在线观看| 精品国精品自拍自在线| 国产激情一区二区三区四区| 国产精品免费网站在线观看| 91农村精品一区二区在线| 亚洲精品国产品国语在线app| 欧美综合欧美视频| 免费日本视频一区| 日本一区二区免费在线| 91女人视频在线观看| 亚洲国产aⅴ成人精品无吗| 日韩一级高清毛片| 白白色亚洲国产精品| 一区二区在线观看av| 正在播放亚洲一区| 国产一区二区网址| 中文字幕一区免费在线观看| 在线视频一区二区三| 麻豆成人久久精品二区三区红| 精品久久久久久久人人人人传媒| 国产不卡在线播放| 一区二区三区免费观看| 日韩欧美中文字幕精品| 日本欧洲一区二区| 中文字幕日韩精品一区| 欧美精品在线视频| 国产a精品视频| 五月天视频一区| 欧美韩国日本综合| 欧美剧在线免费观看网站| 久久国产剧场电影| 亚洲另类一区二区| 欧美精品一区二区三区视频 | 国产精品福利在线播放| 在线不卡欧美精品一区二区三区| 国产一区二区福利| 一区二区不卡在线视频 午夜欧美不卡在 | 美女免费视频一区| 亚洲欧美日韩在线不卡| 久久综合久久综合亚洲| 色伊人久久综合中文字幕| 久久精品久久99精品久久| 一区二区三区四区在线| 国产亚洲va综合人人澡精品| 在线不卡中文字幕| 在线视频欧美精品| 成人午夜免费av| 韩国精品免费视频| 亚洲va在线va天堂| 亚洲四区在线观看| 国产日韩欧美高清在线| 日韩一级免费观看| 欧美日韩激情在线| 91蜜桃免费观看视频| 国产成人8x视频一区二区| 免费人成在线不卡| 首页亚洲欧美制服丝腿| 夜色激情一区二区| 中文字幕在线不卡| 国产三级欧美三级日产三级99 | 91视频www| bt欧美亚洲午夜电影天堂| 国产剧情一区二区| 久久99国产精品免费| 日本大胆欧美人术艺术动态| 亚洲一区二区在线观看视频| 亚洲色图欧美在线| 亚洲黄色小说网站| 亚洲精品中文在线影院| 亚洲人成网站色在线观看| 国产精品午夜免费| 国产精品久久久久久妇女6080| 国产精品剧情在线亚洲| 国产精品欧美一区喷水| 亚洲国产成人在线| 国产精品久久夜| 亚洲精品中文在线影院| 亚洲综合在线视频| 性做久久久久久久免费看| 一区二区三区久久久| 亚洲一区二区免费视频| 午夜亚洲福利老司机| 日本 国产 欧美色综合| 日韩电影免费在线观看网站| 秋霞成人午夜伦在线观看| 美女mm1313爽爽久久久蜜臀| 精品一区二区日韩| 国产激情一区二区三区四区| av电影在线观看完整版一区二区| av日韩在线网站| 欧美日韩免费不卡视频一区二区三区| 6080国产精品一区二区| 久久久久久久久久久黄色| 国产欧美一区二区在线观看| 中文字幕日韩一区| 日韩国产欧美在线播放| 国产在线国偷精品产拍免费yy| 99综合电影在线视频| 欧美视频一区二| 日韩欧美一级二级三级久久久 | 欧美一卡2卡3卡4卡| 欧美电影免费观看高清完整版在线| 91精品一区二区三区在线观看| 日韩免费看的电影| 国产精品乱码一区二区三区软件| 一区二区三区中文字幕电影| 另类的小说在线视频另类成人小视频在线| 激情综合一区二区三区| 91色婷婷久久久久合中文| 91精品国产高清一区二区三区 | 波多野结衣中文字幕一区 | 91小视频在线观看| 在线不卡中文字幕| 国产日产欧美一区二区三区| 亚洲高清不卡在线观看| 久久99久久久欧美国产| 91老师国产黑色丝袜在线| 欧美一区二区三区的| 国产精品久久久久天堂| 美洲天堂一区二卡三卡四卡视频| www.一区二区| 日韩精品影音先锋| 亚洲一区在线观看网站| 国产激情偷乱视频一区二区三区| 欧美日韩第一区日日骚| 久久久久久电影| 日韩电影免费在线| 91麻豆免费在线观看| 久久你懂得1024| 日韩在线a电影| 日本高清不卡视频| 国产亚洲美州欧州综合国| 日本在线不卡视频| 在线一区二区三区| 亚洲国产精品精华液2区45| 日韩国产精品久久| 91麻豆国产精品久久| 国产精品天美传媒沈樵| 精品在线一区二区三区| 7777精品伊人久久久大香线蕉完整版 | 久久久五月婷婷| 免费观看日韩av| 欧美日韩精品欧美日韩精品一 | 91官网在线观看| 中文字幕乱码久久午夜不卡| 国产一区二区伦理片| 日韩亚洲欧美一区二区三区| 亚洲国产日韩a在线播放性色| 91亚洲国产成人精品一区二三| 国产欧美一区二区精品秋霞影院| 久久99国产精品麻豆| 69久久99精品久久久久婷婷| 亚洲1区2区3区4区| 精品视频在线看| 亚洲国产视频直播| 欧美日韩视频专区在线播放| 亚洲中国最大av网站| 欧美综合天天夜夜久久|