娇小w搡bbbb搡bbb,《第一次の人妻》,中国成熟妇女毛茸茸,边啃奶头边躁狠狠躁视频免费观看

; list  p=16C74, st=off
; PORTC PIN DESCRIPTION
; SCK bit 3, SDI bit 4, SDO bit 5, CS bit 7
; Fosc = 10.0 MHz, thus each instr. cycle = 400ns

;***************Ram Register Definitions*******************************

 
   rxdata equ 25h
   addr   equ 26h
   loops  equ 27h

;***************Bit Definitions****************************************
;#define   CS    PORTC,7           ; SPI chip select bit definition

;**********************************************************************


;***************25Cxxx command definitions
;#define      WREN  6                 ;write enable latch
;#define      WRDI  4                 ;reset the write enable latch
;#define      RDSR  5                 ;read status register
;#define      WRSR  1                 ;write status register
;#define      READ  3                 ;read data from memory
;#define      WRITE 2                 ;write data to memory

; Bit defines within status register
;#define      WIP   0                 ;write in progress
;#define      WEL   1                 ;write enable latch
;#define      BP0   2                 ;block protection bit
;#define      BP1   3                 ;block protection bit
;**********************************************************************

 ;        include "p16c74.inc"     ; 16C74 include file
 ;        __CONFIG   _WDT_OFF & _CP_OFF & _HS_OSC & _PWRTE_ON

;**********************************************************************
    page

         org   0000              ; Reset Vector
         clrf  PCLATH             ; ensure PCLATH bit 3 is cleared
         clrf  INTCON             ; ensure all interrupts are disabled
         goto  start              ; jump to the beginning of the program

         org   004              ; interrupt vector, do nothing
isr:      goto  isr                ; do nothing, location just
                                  ; identified in code


;***************BEGIN MAIN PROGRAM*************************************
;
start:    bcf   STATUS,5         ; need to set bank 0
         clrf  PORTC              ; initialize port c
         bsf   CS                 ; make sure cs is set 
         bsf   STATUS,5         ; need to set bank 1
         movlw 0x10               ; all bits are outputs except SDI
         movwf TRISC              ; for SPI setup
         bcf   STATUS,RP0         ; need to set bank 0
         movlw 0x31               ; SPI master, clk/16, ckp=1
         movwf SSPCON             ; SSPEN enabled
         movlw 0x10               ; *** put beginning address in addr**
         movwf addr               ; for later use

loop
;The first thing we will do is the WREN
         call  wren               ; call the write enable routine
;Next write status reg. to clear the block protect bits
         call  wrsr               ; call the write status routine
;Next do a busy test
         call  busy_test          ; test WIP bit in status register
;Then do the WREN before writing to the array
         call  wren               ; call the write enable command

;Next write 0xA5 (or any other value) to 0x10
         bcf   CS                 ; set chip select line low
         movlw WRITE              ; WRITE control byte
         call  output             ; call the output subroutine
         movlw b'00000000'        ; high addr byte is all 0's
         call  output             ; call the output subroutine
         movf  addr,w             ; low addr byte
         call  output             ; call the output subroutine
         movlw b'10100101'        ; load 0xA5 as data to be sent out
         call  output             ; call the output subroutine
         bcf   SSPCON,CKP         ; set clock idle low, mode 0,1
         bsf   CS                 ; set chip select, begin write cycle
         bsf   SSPCON,CKP         ; set clock idle high, mode 1,1

         call  busy_test
         call  rdsr               ; call the read status subroutine

;Now, read location 0x10h and store in rxdata. With Picmaster a
;user can break, read that memory location to see if the read worked
         bcf   CS                 ; set chip select line low
         movlw READ               ; READ control byte
         call  output             ; call the output subroutine
         movlw b'00000000'        ; high addr byte is all 0's
         call  output             ; call the output subroutine
         movf  addr,w             ; get ready to send next byte
         call  output             ; call the output subroutine
         movlw b'01011010'        ; move don't care byte of 0x5A into
         call  output             ; call the output subroutine
         bsf   CS                 ; bring chip select high end
                                  ; terminate read command

;While program is continuously looping, the user may halt (if using an
;emulator), and look at the data in rxdata. If it is 0xA5, the
;read/write worked.
         call  wait               ; little delay between SPI sequence
         goto  loop               ; do it all over again
                                  ; loop can be used to evaluate SPI
                                  ; signals on oscilloscope


;********************* BEGIN SUBROUTINES*******************************
;*** DELAY ROUTINE - 400uS ***
;
wait     movlw .200               ; timing adjustment variable
         movwf loops              ; move variable into loops
top      nop                      ; sit and wait
         nop                      ; no operation
         decfsz loops,f           ; loop complete?
         goto   top               ; no, go again
         return                   ; yes, return from sub


;****** This is the OUTPUT transmit/receive subroutine. ***************
output   movwf SSPBUF             ; place data in buffer to send
loop1    bsf   STATUS,RP0         ; specify bank 1
         btfss SSPSTAT,BF         ; has data been received (xmit done)?
         goto  loop1              ; not done yet, keep trying
         bcf   STATUS,RP0         ; specify bank 0
         movf  SSPBUF,W           ; empty receive buffer
         movwf rxdata             ; put received byte into rxdata
         return                   ; return from subroutine

;*******Write Enable Subroutine****************************************
wren     bcf   CS                 ; set chip select line low
         movlw WREN               ; WREN control byte
         call  output             ; Call the output subroutine
         bcf   SSPCON,CKP         ; set clock idle low, mode 0,1
         bsf   CS                 ; set chip select, begin write
         bsf   SSPCON,CKP         ; set clock idle high, mode 1,1
         return                   ; return from subroutine

;*******Read Status Register Subroutine********************************
rdsr     movlw RDSR               ; RDSR control byte
         call  output             ; Call the output subroutine
         movlw b'00000101'        ; this byte is a don't care byte
         call  output             ; status reg data will be in rxdata
         bsf   CS                 ; set chip select
         return                   ; return from subroutine

;*******Write Status Register Subroutine*******************************
wrsr     bcf    CS                ; set chip select line low
         movlw  WRSR              ; WRSR control byte
         call   output            ; Call the output subroutine
         movlw  b'00001000'       ; set BP1 bit in status register
         call   output            ; this will clear block protect bits
         bcf    SSPCON,CKP        ; set clock idle low, mode 0,1
         bsf    CS                ; set chip select
         bsf    SSPCON,CKP        ; set clock idle high, mode 1,1
         return                   ; return from subroutine

;*******Busy Test - WIP bit in Status Register*************************
busy_test
         bcf    CS                ; set chip select line low
         movlw  RDSR              ; RDSR control byte
         call   output            ; Call the output subroutine
         movlw  b'00000000'       ; send dummy byte
         call   output            ; to initiate clock sequence for read
         bsf    CS                ; else, set chip select high
         btfsc  rxdata,WIP        ; test WIP bit read from status register
         goto   busy_test         ; repeat busy test
         return                   ; return from subroutine

         end

[1] [1]
關(guān)鍵字:PIC16C74  單片機(jī)  SPI方式  讀寫串行EEPROM 引用地址:PIC16C74單片機(jī)SPI方式讀寫串行EEPROM程序

上一篇:PIC單片機(jī)定時器中斷源程序
下一篇:PIC16C63單片機(jī)串口通信程序

推薦閱讀

歐司朗在天津舉辦的2018年中國室內(nèi)照明論壇上發(fā)布了全新一代智能樓宇照明控制系統(tǒng)ENCELIUM?,旨在推進(jìn)數(shù)字化照明變革,滿足智能物聯(lián)的市場需求。ENCELIUM?智能樓宇照明控制系統(tǒng)可以根據(jù)建筑物不同應(yīng)用場景的變化和需求提供合適的照明并節(jié)約能源,還能聯(lián)接樓宇自動化控制系統(tǒng),提高建筑物的附加值,是一套高效易操作的智能化照明控制系統(tǒng)。 ENCELIUM全新...
利用arm-linux-gnueabihf-gcc交叉編譯openssl,生成靜態(tài)庫文件libcrypto.a ,libssl.a以及動態(tài)庫文件1、從openssl官網(wǎng)下載openssl最新版本,我下載的是openssl-1.0.2e。下載地址:http://www.openssl.org/source/2、安裝自己的交叉編譯工具鏈。3、解壓openssl源碼,進(jìn)入目錄。并配置好交叉編譯鏈的環(huán)境變量: export PATH=$PATH:/usr/local/linaro-mult...
IT之家 10 月 16 日消息 10月14日,華為消費(fèi)者業(yè)務(wù)手機(jī)產(chǎn)品線總裁何剛公布了 Mate 40 系列全球發(fā)布會的最新海報,展示了 Mate40 系列的更多細(xì)節(jié)。海報中,新機(jī)的多邊形輪廓鮮明,紅色的電源鍵十分惹眼。現(xiàn)在 Twitter 用戶 Teme (特米)曝光了一款搭載后置六攝鏡頭的華為手機(jī),預(yù)計就是這款預(yù)熱海報中的相機(jī)模組真正的樣子。六個攝像頭疑似組...
近日,豐田研究院(Toyota Research Institute,以下簡稱TRI)宣布,成功研發(fā)出最新一代家庭保姆機(jī)器人——巴士男孩(Busboy),能夠完成85%的人類級任務(wù)!,最擅長“做家務(wù)活”。在產(chǎn)品的發(fā)布會上, “巴士男孩”展示了“他”的能力:從高亮反光桌面上拿起玻璃杯并放到洗碗池里,還能擦干凈桌子和地板等。豐田研發(fā)的初衷是日本嚴(yán)峻的人口老齡化問題,...

史海拾趣

問答坊 | AI 解惑

用單層PCB設(shè)計超低成本混合調(diào)諧器

今天,電視機(jī)與視訊轉(zhuǎn)換盒應(yīng)用中的大多數(shù)調(diào)諧器采用的都是傳統(tǒng)單變換MOPLL概念。這種調(diào)諧器既能處理模擬電視訊號也能處理數(shù)字電視訊號,或是同時處理這兩種電視訊號(即所謂的混合調(diào)諧器)。在設(shè)計這種調(diào)諧器時需考慮的關(guān)鍵因素包括低成本、低功耗、 ...…

查看全部問答∨

扣幣不對啊!

今天我發(fā)現(xiàn)下載附件的時候,芯幣被多扣了! 按照soso所說的每下一個附件-4芯幣,可我下載兩個附件卻不見了16個芯幣。是不是下載不同的附件需要不同數(shù)量的芯幣?現(xiàn)在我只剩下3個芯幣了:L !!!         所以我有兩點(diǎn)建 ...…

查看全部問答∨

急需!!畢業(yè)設(shè)計,題目《IC卡的身份識別開關(guān)》

周六就要交給老師看了,可才做了一半,實(shí)在找不到資料了,請求各路朋友幫幫忙啊!!!…

查看全部問答∨

求助:44B0定時器5不產(chǎn)生中斷問題~

我在程序中使用定時器5進(jìn)行定時調(diào)用AD采樣函數(shù),可是定時器一直無法啟動,程序如下,還請高手們指出錯誤之處 void Time5IntTest(void) { rTCON = 0xffffff;  // 000    不自動重載(反轉(zhuǎn)模式)|不更新TCNTB5|停止定時器5 r ...…

查看全部問答∨

關(guān)于USB設(shè)備的讀取

{                 m_strLog += _T("抱歉,未找到可用的USB設(shè)備");…

查看全部問答∨

EVC4.0+PXA270SDK(自定義無錯)開發(fā)的軟件?

使用 EVC4.0+PXA270SDK(自定義無錯)開發(fā)的軟件release版無法在270pPDA上使用,請問是為什么? (運(yùn)行時報缺庫文件)  …

查看全部問答∨

提問:evc4.0能否支持DirectX9.0??

公司要我在WINCE下實(shí)現(xiàn)Direct3D應(yīng)用,我以前沒用過EVC4.0,但用過VC6.0。在EVC中我只加進(jìn)頭文件<d3dx9.0>后就發(fā)生以下錯誤: pogram Files\\Microsoft DirectX 9.0 SDK (December 2004)\\Include\\d3dx9math.inl(1578) : error C2065: \'sqrtf\ ...…

查看全部問答∨

驅(qū)動為何會裝載后馬上卸載?

寫了個USB轉(zhuǎn)COM口的驅(qū)動,但是為何系統(tǒng)啟動過程中裝載完驅(qū)動就迅速卸載? 打印信息, USBToCOM::Process Attach USBToCOM::Process Detach sources文件 RELEASETYPE=PLATFORM TARGETNAME=ucom TARGETTYPE=DYNLINK DLLENTRY=DllEntry DEF ...…

查看全部問答∨

串口讀寫函數(shù)是同步的嗎?

在WINCE下通過writefile寫串口,原以為該函數(shù)應(yīng)該是阻塞式的,與串口發(fā)送過程是同步的,即串口實(shí)際發(fā)送完畢,該函數(shù)才 能返回。現(xiàn)在用示波器測量了下,發(fā)現(xiàn)不是這樣,特別是寫多個字節(jié)時,串口還沒有發(fā)送完畢,writefile函數(shù)就返回了。 請問在 ...…

查看全部問答∨
小廣播
設(shè)計資源 培訓(xùn) 開發(fā)板 精華推薦

最新單片機(jī)文章

 
EEWorld訂閱號

 
EEWorld服務(wù)號

 
汽車開發(fā)圈

 
機(jī)器人開發(fā)圈

電子工程世界版權(quán)所有 京ICP證060456號 京ICP備10001474號-1 電信業(yè)務(wù)審批[2006]字第258號函 京公網(wǎng)安備 11010802033920號 Copyright ? 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
主站蜘蛛池模板: 蓬溪县| 安徽省| 宣化县| 福鼎市| 偏关县| 灌云县| 正宁县| 合川市| 皋兰县| 高尔夫| 满洲里市| 通河县| 五华县| 和静县| 武胜县| 敖汉旗| 朝阳市| 敦化市| 新泰市| 济阳县| 乐安县| 桑日县| 永善县| 金堂县| 浠水县| 周宁县| 健康| 印江| 西城区| 重庆市| 侯马市| 邛崃市| 七台河市| 泊头市| 玛沁县| 黑水县| 神农架林区| 屏东县| 隆林| 黄龙县| 茂名市|