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

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

?? 2.txt

?? 基于pic的DS1302串行實時時鐘程序
?? TXT
?? 第 1 頁 / 共 3 頁
字號:

;       specs
;       baud rate       parity  data bits       stop bits               
;       2400            n       8               2
;       data
;       year    month   day     hour    minute second   index   break value
;       yyyy    mm      dd      hh      mm      ss      iiiiii  kkkkd       
;
;////   16f84   pin     In/Out  function       
;////   ra0     17      I       reed rla 4 closure for HOLD
;////   ra1     18      O       rtc     /rst    pin5
;////   ra2     1       O       rtc     clk     pin7
;////   ra3     2       I/O     rtc     dq data pin6
;////   ra4     3       O       serial out rs232 0-5vdc (or up to 14v)
;////
;////   rb0     6       I/O     interrupt of D.U. of mc14433 adc
;////   rb1     7       I       BCD data from mc14433   Q0      pin20
;////   rb2     8       I       BCD                     Q1 &p;    pin21
;////   rb3     9       I       BCD                     Q2 &p;    pin22
;////   rb4     10      I       BCD most sig.           Q3      pin23
;////   rb5     11      I       normally HI switches    advance time
;////   rb6     12      I               "       "       retard time
;////   rb7     13      spare
;////                                            
;//////////////////////////////////////////////////////////////////////////

	include <p16f84.inc>
eerd            equ     0               ;eeprom eecon1,0 read bit
eewr            equ     1               ;eeprom eecon1,1 write bit

;porta
rr4             equ     0               ;reed relay4 closure.   LO=closed
_rst            equ     1               ;rtc rst 
clk             equ     2               ;rtc clk
dataq           equ     3               ;rtc (I/O)
tx              equ     4               ;rs232 tx line
#define         REED4   porta,rr4       ;INPUT ex m/b reed relay4. close=LO
#define         CLKRST  porta,_rst      ;rtc rst 
#define         SCLK    porta,clk       ;rtc clk
#define         CLKDATA porta,dataq     ;rtc (I/O)
#define         SERTX   porta,tx        ;rs232 serial transmit line

;portb
eoc             equ     0               ;du = end of conv. int. and HOLD
bcd_q0          equ     1               ;bcd data. ls bit
bcd_q1          equ     2               ;bcd
bcd_q2          equ     3               ;bcd
bcd_q3          equ     4               ;bcd data. ms bit
up_switch       equ     5               ;normally HI switch for up time
down_switch     equ     6               ;"      "       " retard time
;               equ     7               ;spare
#define         EOC     portb,eoc
#define         BCD_Q0  portb,bcd_q0
#define         BCD_Q1  portb,bcd_q1
#define         BCD_Q2  portb,bcd_q2
#define         BCD_Q3  portb,bcd_q3
#define         UP_SWIT portb,up_switch
#define         DO_SWIT portb,down_switch
;#define                portb,

;general purpose bit definitions
;gpflags register
reed            equ     0               ;reed relay  `got pushed' flag
up              equ     1               ;up button `already pushed' flag
down            equ     2               ;down button `already pushed'

;general purpose register definitions
        cblock  0x0C
                m_porta                 ;mirror of port a
                m_portb                 ;mirror of port b
                gpflags                 ;general flags
                scratch                 ;scratch reg for *temporary* use
                scratch1                ;       "    &n;          

                count1                  ;counts 1,2,3 are for gen purpose
                count2                  ;delay routines
                count3                  ;
                up_count                ;count of 0.1 secs when UP switch closed
                down_count              ;count of 0.1 secs when DOWN switch closed

                timer1                  ;for 8bit rotates in/out
                timer2                  ;per Mark Sullivan's code 25.7.96
                timer3                  ;for the ds1202 or ds1302
                count4                  ;real-time-clock
                second                  ;
                minute                  ;
                hour                    ;
                date                    ;
                month                   ;
                day                     ;
                year                    ;
                
                ds1                     ;adc most sig. bcd byte-low nibble only
                ds2                     ; these are the bcd bytes as read in fro
                ds3                     ; the adc, and have been massaged into
                ds4                     ; (not packed) bcd

                tx_buff                 ;rs232 send routine
                pr01                    ;rs232 buffer table pointer offset
                
                samp_index1             ;sample index no. binary l.s.byte EEPROM
                samp_index2             ;binary eeprom
                samp_index3             ;binary most sig. index eeprom byte

                count5                  ;used in binary-to-bcd routine
                temp_f                  ;for outputting binary-held data to 
                buff_4                  ;bcd. bcd-to-ascii and rs232
                buff_3                  ;is then possible
                buff_2
                buff_1
                temp_a
                temp_b
                temp_c
                temp_d
                temp_e

        endc
;*********************************************end system definitions

;*********************************************system origin
                org     0x000
                goto    start
                org     0x004
                goto    service
;*********************************************end system origin

;************************************************tables first 
powerup_table1
                addwf   pcl,same
                retlw   0x59            ;Y      ASCII char
                retlw   0x65            ;e
                retlw   0x61            ;a
                retlw   0x72            ;r
                retlw   0x20            ;       sp
                retlw   0x4D            ;M
                retlw   0x6F            ;o
                retlw   0x20            ;       sp
                retlw   0x44            ;D
                retlw   0x61            ;a
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x68            ;h
                retlw   0x72            ;r
                retlw   0x20            ;       sp
                retlw   0x6D            ;m
                retlw   0x69            ;i
                retlw   0x20            ;       sp
                retlw   0x73            ;s
                retlw   0x65            ;e
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x69            ;i
                retlw   0x6E            ;n
                retlw   0x64            ;d
                retlw   0x65            ;e
                retlw   0x78            ;x
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x46            ;F
                retlw   0x6F            ;o
                retlw   0x72            ;r
                retlw   0x63            ;c
                retlw   0x65            ;e
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp      
                retlw   0x20            ;       sp      40thar
                retlw   0x20            ;       sp      extrfor surety
                retlw   0x20            ;       sp
                retlw   0x20            ;       sp      extrfor surety
                retlw   0x20            ;       sp
;********************************************************end of tables

;*********************************************************initialisations
start
        ;clear all ram registers
                movlw   0x0C            ;start of ram
                movwf   fsr
                clrf    indf            ;$-3 to here
                incf    fsr,same
                btfss   fsr,7
                goto    $-3             ;back to clrf indf       &nbspbsp;                             
                bsf     status,rp0
        ;setup trisa, b
                movlw   00001001b
                movwf   trisa                       &nb   
                movlw   01111111b
                movwf   trisb
                bcf     status,rp0
                movlw   00000000b
                movwf   porta
                movwf   portb

;***************************************************end of initialisation

;*********************************************main loop begins
main_loop                       ;initial stuff
                call    delay_100ms
                call    rclock          ;fetch the current contents of rtc itself
                bcf     second,7        ;clear `clock halt' CH bit
                bcf     hour,7          ;am/pm:24 -> 24 hr mode
                call    wclock
                call    delay_1sec
                call    rclock
                movlw   0x12            ;ascii byte `DC2' resets compressed printing
                call    txbyte
                call    powerup_dump

main_loop1
        ;*********************** check the time advance &  retard switches
                call    rclock
                btfsc   UP_SWIT         ;switch is in, if result=LO
                goto    time_retard0    ;switch open, so drop thru & check DOWN
                btfsc   UP_SWIT
                goto    time_adv1
                call    inc_minute_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_adv1       btfsc   UP_SWIT
                goto    time_adv2
                call    inc_hour_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_adv2       btfsc   UP_SWIT
                goto    time_adv3
                call    inc_date_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_adv3       btfsc   UP_SWIT
                goto    time_adv4
                call    inc_month_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_adv4       btfsc   UP_SWIT
                goto    main_loop3
                call    inc_year_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
                goto    main_loop3

time_retard0    
                btfsc   DO_SWIT
                goto    main_loop3              ;jump out, no switch is in
                call    dec_minute_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_retard1    btfsc   DO_SWIT
                goto    time_retard2
                call    dec_hour_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_retard2    btfsc   DO_SWIT
                goto    time_retard3
                call    dec_date_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_retard3    btfsc   DO_SWIT
                goto    time_retard4
                call    dec_month_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
time_retard4    btfsc   DO_SWIT
                goto    main_loop3
                call    dec_year_bcd
                call    wclock
                call    crush_dump
                call    delay_1sec
        ;*********************** finish time advance &  retard
main_loop3      
                nop
                nop
                btfsc   REED4           ;test reed relay closure. LO=closed
                goto    main_loop4      ;open ie no TRIP

                btfss   gpflags,reed
                goto    main_loop6
                goto    main_loop1      
main_loop4      bcf     gpflags,reed
                bsf     status,rp0      ;set to bank1
                bsf     trisb,eoc       ;eoc becomes input
                bcf     status,rp0      ;set to bank0
                goto    main_loop1                     &nbspbsp;       
main_loop6      bsf     gpflags,reed
                call    inc_eeprom      ;increment eeprom regs+1
                call    read_adc        ;capture current force reading
                call    crush_dump      ;print one data dump only
                goto    main_loop1

;*********************************************main loop ends

;************************************** specific RTC ds1302 subroutines begin

;
; Write calendar clock
; per Mark K Sullivan 25.7.96
;       this routine takes ALL the seconds ---> year fregs in 16f84 and
;       writes them to the ds1302. NB that means that if you want to adjust
;       the rtc time registers, you have to do a read first (of them all).
;       The rclock routine following, reads the whole lot in `burst mode'
;       and puts the values into seconds --->year fregs

wclock  bcf     SCLK            ;negate clock line
        nop
        nop
        nop
        nop
        bcf     CLKDATA
        bsf     CLKRST          ;negate RST
        bsf     status,rp0      ;I/O dataq line set to output
        bcf     trisa,dataq
        bcf     status,rp0
        movlw   0x8E            ;write control register
        call    wbyte
        movlw   0x00            ;turn off Write Protect in rtc
        call    wbyte
        movlw   7
        movwf   timer3
        movlw   0x80            ;rtc register address for `second'
        movwf   count4
        movlw   second
        movwf   fsr
wc      bcf     CLKRST          ;assert RST
        bcf     SCLK            ;negate clock
        nop
        nop
        nop
        nop
        bsf     CLKRST          ;negate RST
        movf    count4,W

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
777久久久精品| 国产精品视频免费| 欧美色区777第一页| caoporm超碰国产精品| 成人在线一区二区三区| 成人做爰69片免费看网站| 国产黄色成人av| 成人在线视频首页| 99久久久无码国产精品| 99re66热这里只有精品3直播| www.亚洲精品| 色噜噜夜夜夜综合网| 日本高清视频一区二区| 在线精品国精品国产尤物884a| 91精品办公室少妇高潮对白| 精品视频免费在线| 日韩一区二区免费在线观看| 亚洲精品在线免费播放| 国产女人aaa级久久久级| 国产精品色在线观看| 亚洲欧美乱综合| 亚洲国产精品天堂| 美腿丝袜亚洲一区| 国产成人午夜精品5599| www.亚洲国产| 欧美日韩在线亚洲一区蜜芽| 欧美一区二区国产| 久久久久亚洲综合| 亚洲色图清纯唯美| 婷婷综合五月天| 麻豆精品一区二区av白丝在线| 国产一区在线精品| 95精品视频在线| 欧美一区在线视频| 国产视频不卡一区| 一区二区三区四区高清精品免费观看 | 在线亚洲一区观看| 欧美一区二区三区在线观看视频| 久久综合九色综合欧美98| 国产精品短视频| 午夜视频一区二区三区| 国模娜娜一区二区三区| 91欧美一区二区| 91精品国产综合久久精品| 久久久精品日韩欧美| 亚洲国产精品一区二区久久| 国产专区欧美精品| 在线欧美日韩国产| 精品毛片乱码1区2区3区| 亚洲天堂中文字幕| 麻豆精品在线看| 一本一本久久a久久精品综合麻豆| 日韩一区二区在线观看| 国产精品不卡在线| 麻豆视频一区二区| 91福利在线观看| 久久婷婷色综合| 亚洲成人综合视频| 成人蜜臀av电影| 日韩三级av在线播放| 亚洲欧美在线高清| 精品午夜久久福利影院| 91成人免费网站| 国产免费成人在线视频| 日韩av中文在线观看| 一本到不卡精品视频在线观看| 精品毛片乱码1区2区3区| 亚洲风情在线资源站| 成人va在线观看| 精品电影一区二区| 婷婷丁香激情综合| 色哟哟国产精品| 久久久久久久综合狠狠综合| 日本成人在线视频网站| 欧美最猛性xxxxx直播| 中文字幕精品一区二区三区精品| 日韩电影在线免费观看| 色就色 综合激情| 国产精品护士白丝一区av| 国产在线一区二区| 欧美一区二区成人| 亚洲五码中文字幕| 91视频你懂的| 国产精品久久久久久久久果冻传媒 | 欧美一级夜夜爽| 一区二区三区四区亚洲| 99久久99久久综合| 久久久精品蜜桃| 经典一区二区三区| 日韩视频在线永久播放| 日韩中文字幕不卡| 欧美三级一区二区| 一区二区三区不卡视频在线观看| av在线不卡网| 一区在线观看视频| 成人丝袜视频网| 国产精品欧美精品| 成人免费av在线| 一区二区中文视频| 99久久99久久久精品齐齐| 国产精品伦理一区二区| 成人动漫视频在线| 亚洲欧美另类小说视频| 色综合天天在线| 一区二区三区中文免费| 在线免费观看日本一区| 夜夜嗨av一区二区三区中文字幕| 日本精品一区二区三区高清 | 国产精品一品视频| 久久―日本道色综合久久| 国产乱对白刺激视频不卡| 久久美女艺术照精彩视频福利播放| 久久99国产精品尤物| 精品国产一区二区三区四区四 | 欧美一区二区三区免费观看视频 | 色999日韩国产欧美一区二区| 亚洲人精品午夜| 在线观看av一区| 亚洲va在线va天堂| 日韩欧美123| 国产成人亚洲综合a∨猫咪| 国产精品视频一二三区| 91色乱码一区二区三区| 亚洲电影一区二区三区| 91麻豆精品国产91久久久| 精品夜夜嗨av一区二区三区| 国产情人综合久久777777| 99精品视频中文字幕| 亚洲午夜免费视频| 日韩免费电影网站| 丁香激情综合国产| 亚洲一区二区三区在线播放| 日韩欧美一区中文| 成人深夜福利app| 一区二区三区国产精华| 欧美一二三四区在线| 国产福利一区在线| 亚洲精品视频在线看| 制服丝袜日韩国产| 国产高清精品久久久久| 亚洲综合在线免费观看| 日韩精品在线一区二区| 成人a级免费电影| 日韩电影在线观看电影| 欧美国产精品一区二区三区| 在线观看视频欧美| 国产一本一道久久香蕉| 一区二区三区**美女毛片| 欧美成人aa大片| 日本精品视频一区二区三区| 久久国产麻豆精品| 亚洲视频一区二区免费在线观看| 在线不卡免费av| 波多野洁衣一区| 免费成人结看片| 亚洲欧美一区二区三区久本道91| 69p69国产精品| 成人99免费视频| 蜜臀av国产精品久久久久 | 国产精品综合网| 亚洲伊人色欲综合网| 国产日韩精品一区二区三区| 制服丝袜日韩国产| 色哟哟一区二区在线观看| 国产乱淫av一区二区三区| 亚洲成a人v欧美综合天堂下载 | 风间由美中文字幕在线看视频国产欧美| 亚洲欧美色一区| 久久婷婷久久一区二区三区| 欧美人妇做爰xxxⅹ性高电影| 国模大尺度一区二区三区| 婷婷成人激情在线网| 亚洲色图在线视频| 国产清纯在线一区二区www| 日韩午夜激情免费电影| 在线亚洲精品福利网址导航| 国产成人精品一区二区三区四区| 日韩黄色片在线观看| 一区二区三区四区五区视频在线观看 | 国产日产欧美一区二区三区| 欧美精品亚洲二区| 91久久精品网| 色综合久久中文字幕综合网| 国产精品69久久久久水密桃 | 日韩一区二区在线观看视频| 欧美网站大全在线观看| 成人av免费网站| 国产寡妇亲子伦一区二区| 久久99热国产| 日本视频中文字幕一区二区三区| 一区二区三区蜜桃| 亚洲日本欧美天堂| 国产精品久久福利| 亚洲国产成人自拍| 国产亚洲一区二区三区在线观看 | 亚洲一区二区黄色| 亚洲精品高清在线观看| 国产精品电影院| 中文字幕日韩欧美一区二区三区| 欧美极品xxx|