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

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

?? 93c46.asm

?? Microchip pic c source code
?? 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免费视频网| 亚洲成人久久影院| 日韩视频不卡中文| 欧美性猛交一区二区三区精品| 波多野结衣精品在线| 粉嫩av一区二区三区| www.一区二区| 色8久久人人97超碰香蕉987| 色综合天天狠狠| 在线区一区二视频| 欧美三级视频在线播放| 欧美一区二区三区视频免费 | 国产精品1区2区3区| 国产一区二区三区日韩| 国产成人综合网| 9色porny自拍视频一区二区| 91麻豆国产福利在线观看| 91成人网在线| 精品国产三级a在线观看| 久久免费午夜影院| 一区二区高清视频在线观看| 亚洲国产日韩精品| 国产麻豆精品在线观看| www.激情成人| 欧美一区午夜精品| 国产精品视频免费看| 一区二区三区在线视频免费| 青青国产91久久久久久| 国产高清精品在线| 色伊人久久综合中文字幕| 欧美一区二区三区在线视频| 欧美精品一区在线观看| 亚洲高清视频中文字幕| 国产精品一区二区不卡| 91电影在线观看| 精品久久国产老人久久综合| 亚洲色图19p| 国产麻豆一精品一av一免费 | 亚洲在线一区二区三区| 老司机精品视频一区二区三区| 国产麻豆视频一区| 色视频成人在线观看免| 日韩一级片网站| 亚洲国产va精品久久久不卡综合 | 国产精品日韩精品欧美在线| 天天做天天摸天天爽国产一区| 国产成人综合在线| 日韩欧美国产成人一区二区| 亚洲精品一卡二卡| 国产精品99久久久久| 日韩一区二区免费高清| 亚洲一区中文日韩| 不卡的电视剧免费网站有什么| 日韩精品一区二区三区中文不卡| 一区二区三区四区亚洲| 国产精品一线二线三线| 日韩一区二区在线观看视频| 一区二区三区**美女毛片| 波多野结衣亚洲| 中文字幕免费不卡| 国产一区不卡在线| 精品国产乱码91久久久久久网站| 亚洲777理论| 欧美人狂配大交3d怪物一区| 一区二区三区.www| 色噜噜偷拍精品综合在线| 国产精品久久免费看| 成人免费观看av| 国产精品日韩精品欧美在线| 国产91丝袜在线播放0| 久久精品亚洲精品国产欧美kt∨ | 91片黄在线观看| 日本一区二区不卡视频| 成人18视频日本| 日本欧美一区二区三区| 欧美日韩国产不卡| 亚洲第一狼人社区| 3751色影院一区二区三区| 午夜免费欧美电影| 91麻豆精品国产91久久久久| 日韩国产在线观看一区| 欧美一区二区三区日韩| 看片的网站亚洲| 国产亚洲欧美一级| www.亚洲国产| 亚洲大片免费看| 欧美一级黄色片| 国产成人av电影在线| 中文一区二区在线观看| 波多野结衣亚洲| 午夜欧美视频在线观看| 精品精品国产高清a毛片牛牛 | 91高清在线观看| 午夜电影网一区| 日韩免费在线观看| 成人中文字幕在线| 亚洲午夜免费电影| 欧美岛国在线观看| 99热精品一区二区| 午夜伊人狠狠久久| 中文在线免费一区三区高中清不卡| 99精品热视频| 日韩 欧美一区二区三区| 国产亚洲欧洲997久久综合| 国产成a人亚洲精| 丝袜a∨在线一区二区三区不卡 | 不卡一区二区三区四区| 亚洲成人午夜影院| 久久青草国产手机看片福利盒子 | 日韩欧美激情一区| 99综合电影在线视频| 美美哒免费高清在线观看视频一区二区| 精品福利av导航| 欧美无乱码久久久免费午夜一区| 国精产品一区一区三区mba桃花 | 欧美性做爰猛烈叫床潮| 国产中文字幕一区| 亚洲影视在线播放| 国产午夜亚洲精品理论片色戒| 日本高清无吗v一区| 国产酒店精品激情| 无码av免费一区二区三区试看 | 亚洲免费成人av| 久久久青草青青国产亚洲免观| 欧洲国内综合视频| av网站一区二区三区| 精品综合免费视频观看| 亚洲午夜一区二区三区| 国产精品久久久久aaaa樱花| 日韩欧美第一区| 欧美一区二区三区视频免费播放 | 欧美一区二区三区视频免费播放| 99免费精品在线观看| 国内精品国产三级国产a久久| 五月婷婷久久丁香| 亚洲卡通欧美制服中文| 国产精品高潮久久久久无| 久久网站热最新地址| 欧美日韩成人综合在线一区二区| 97久久精品人人爽人人爽蜜臀 | 视频在线观看91| 亚洲综合区在线| 亚洲免费观看视频| 亚洲欧美日韩成人高清在线一区| 久久精品日产第一区二区三区高清版| 91精品国产综合久久久久久久 | 亚洲天堂av一区| 中文字幕国产一区| 国产精品三级av| 亚洲欧洲一区二区在线播放| 国产精品色在线| 亚洲人成网站在线| 亚洲精品精品亚洲| 亚洲精品国产视频| 亚洲最大的成人av| 亚洲成av人片在线| 免费的成人av| 国产精品91一区二区| 高清不卡在线观看av| 成人动漫视频在线| 91视频精品在这里| 欧美在线观看视频一区二区| 欧美高清视频不卡网| 51午夜精品国产| 久久久精品一品道一区| 久久精品一区蜜桃臀影院| 国产精品国产精品国产专区不片| 国产精品毛片高清在线完整版 | 欧美美女直播网站| 日韩精品一区二| 日本一区二区免费在线观看视频| 国产精品电影一区二区| 一区二区三区在线播放| 日韩vs国产vs欧美| 国产精品一品二品| 欧美在线一二三| 337p粉嫩大胆色噜噜噜噜亚洲| 国产精品麻豆欧美日韩ww| 夜夜揉揉日日人人青青一国产精品 | 久久噜噜亚洲综合| 亚洲四区在线观看| 理论片日本一区| 色呦呦国产精品| 日韩精品一区二区三区视频在线观看 | 久久久久久久久一| 一区二区三区日韩欧美| 久久国产精品免费| 97久久精品人人爽人人爽蜜臀| 在线成人小视频| 国产精品不卡视频| 麻豆精品一区二区综合av| 97se亚洲国产综合在线| 日韩一区二区影院| 国产精品国产馆在线真实露脸| 日日噜噜夜夜狠狠视频欧美人| 国产精品一区二区果冻传媒| 欧美日韩精品欧美日韩精品 | 91极品视觉盛宴| 久久久www成人免费无遮挡大片| 一区二区三区视频在线观看|