日韩床上生活一级视频|能看毛片的操逼网站|色悠悠网站在线观看视频|国产免费观看A淫色免费|国产av久久久久久久|免费A级视频美女网站黄|国产毛片av日韩小黄片|热久久免费国产视频|中文字幕无码色色|成人在线视频99久久久

機(jī)電之家資源網(wǎng)
單片機(jī)首頁|單片機(jī)基礎(chǔ)|單片機(jī)應(yīng)用|單片機(jī)開發(fā)|單片機(jī)文案|軟件資料下載|音響制作|電路圖下載 |嵌入式開發(fā)
培訓(xùn)信息
贊助商
DS1620溫度芯片與8751芯片連接代碼
DS1620溫度芯片與8751芯片連接代碼
 更新時間:2008-7-26 19:48:50  點(diǎn)擊數(shù):3
【字體: 字體顏色

;         Full Version for 87C51FA 8K Micro from -67 to 257 degrees F.
;
;                    ASSEMBLED WITH METALINKS ASM51.EXE
;
;            Project: ( Thermostat ), And DS1620 Chip Programmer.
;                   Software For Control & Use of DS1620
;                   Digital Thermometer & Thermostat I.C
;                      Microcontroller ( P87C51FA DIP )
;                           11.0592 MHz Crystal
;                            LCD = { 20 X 4 }
;                      Port connections as follows.
;               Copyright (C) 1998  B. Reynolds Electronics
;
; Micro PIN# TO    LCD  Pin#   Micro Pin# TO   DS1620   Pin#  LCD  Pin#
; p1.0  #1  ---->  db0  #7     p3.0  #10 ----> DQ       #1    GND  #1
; p1.1  #2  ---->  db1  #8     p3.1  #11 ----> CLK/CONV #2    VCC  #2
; p1.2  #3  ---->  db2  #9     p3.2  #12 ----> RST      #3    VR   #3
; p1.3  #4  ---->  db3  #10    p3.3  #13 -------------------> RS   #4
; p1.4  #5  ---->  db4  #11    p3.4  #14 -------------------> R/W  #5
; p1.5  #6  ---->  db5  #12    p3.5  #15 -------------------> E    #6
; p1.6  #7  ---->  db6  #13                    DS1620   PIN#
; p1.7  #8  ---->  db7  #14                    GND      #4
;                                              VCC      #8
; **********************************************************************
; *                    User Data Entry Buttons As Follows              *
; *                                                                    *
; * p2.0 = Up          : increment temperature setting + display.      *
; * p2.1 = Down        : decrement temperature setting + display.      *
; * p2.2 = Enter       : Enter key accepts entry goes to next function.*
; * p2.3 = Stand Alone : Sets DS1620 up for stand alone thermostat     *
; *                    ; operation.                                    *
; * p2.4 = Display     : Display high & low 1620 programmed settings.  *
; * p2.5 = Mode        : Change from ( program ) mode to ( display )   *
; *                    ; mode.                                         *
; * p2.5 is a slide switch, All others are N.O. Momentary Contact.     *
; *                                                                    *
; **********************************************************************
;
;
;
; Setup Equates Table Here, Inform Assembler of Constants

               lcd_data   equ 090h
               config     equ 38h
               entrymode  equ 6
               offcur     equ 0ch
               linecur    equ 0eh
               homecur    equ 02h
               clrdsp     equ 01h
               offdsp     equ 0ah
               ondsp      equ 0eh
               sbuf       equ 99h
               ren        equ 9ch
               ri         equ 98h
               ti         equ 99h
               lcd_rs     equ 0b3h
               lcd_rw     equ 0b4h
               lcd_e      equ 0b5h
               th_lsb     data 30h
               th_msb     data 31h
               tl_lsb     data 32h
               tl_msb     data 33h
               b          equ  0f0h
               p2         equ  0a0h
               p3         equ  0b0h
               acc        equ  0e0h
               dph        equ  83h
               dpl        equ  82h


org  0         ; Establish Reset Vector Here

Hello:
               lcall resetlcd
               lcall initlcd
             

bsp; MOV   a,#1
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   ' --**  DS1620  **-- ',0
               MOV   r4,#offcur
               lcall wrlcdcom
               MOV   a,#2
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   '     PROGRAMMER     ',0
               MOV   r4,#offcur
               lcall wrlcdcom
               MOV   a,#3
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   '                    ',0
               MOV   a,#4
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   '   { VERSION 1.0 }  ',0
               lcall big_delay2
               lcall big_delay2

comin_back:
               lcall resetlcd
               lcall initlcd
               sjmp  select
back:
               MOV   a,#2
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   '*-{ PROGRAM MODE }-*',0
               MOV   a,#3
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db   ' PRESS FUNCTION KEY ',0
               MOV   r4,#offcur
               lcall wrlcdcom

select:
               MOV   p2,#0ffh   ; setup port2 for input/ for 8031
                                ; use port0
                                ; isr routine for CPU operation
buttons:
               jnb   p2.4,isr   ; Display 1620 programmed high
                                ; & low setpoints.
               jnb   p2.5,begin1; MODE SWITCH program/display temp.
               jnb   p2.2,set1  ; Begin programming sequence for
                                ; DS1620 chip.
               jnb   p2.3,strt_conv ; issue start_convert for
                                ; stand_alone operation
               jb    p2.5,back  ; Program Mode ?
               sjmp  buttons    ; no key press ? then stay here.

set1:
               jnb   p2.2,set1  ; debounce keypress
               lcall big_delay  ;
               ljmp  up1        ; goto chip programming routine.
begin1:
               ljmp  begin      ; goto display temp routine.
isr:
               lcall isr2       ; goto fetch setpoints for
                                ; viewing routine.
               sjmp  comin_back

strt_conv:
               lcall big_delay  ; routine to setup 1620 for
                                ; stand-alone ops.
               clr   p3.2       ;
               setb  p3.0
               setb  p3.1
               MOV   a,#0ch
               lcall out_cmd
               MOV   a,#00h
               lcall out_data
               MOV   a,#0eeh
               lcall out_cmd
               lcall big_delay
               clr   p3.2
               lcall resetlcd
               lcall initlcd
               lcall prtlcd
               db    ' DS1620  PROGRAMMED ',0
               MOV   a,#2nbsp;         mov   b,#0
               lcall placecur
               lcall prtlcd
               db    'FOR STAND ALONE OPS',0
               MOV   a,#3
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db    'POWER OFF PROGRAMMER',0
               MOV   a,#4
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db    'AND REMOVE 1620 I.C.',0
               MOV   r4,#offcur
               lcall wrlcdcom

alone_only:
               sjmp  alone_only ; loop here for user to power
                                ; down device and reMOVe 1620 I.C.
                                ; from programmer.

Begin:
               lcall resetlcd   ; begin routine for display of
                                ; temperature
               lcall initlcd    ; with 1620 device located in
                                ; programmer.
                                ; We start here if the MODE
                                ; switch is in display position
               MOV   a,#1
               MOV   b,#0
               lcall placecur
               lcall prtlcd     ; Print some fancy corners
               db    '*                  *',0
               MOV   a,#4
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db    '*                  *',0
               MOV   a,#2
               MOV   b,#0
               lcall placecur
               lcall prtlcd
               db ' DS1620 TEMPERATURE ',0
               MOV   a,#3         ; set cursor on line #3
               MOV   b,#12        ; at position #12
               lcall placecur     ; place cursor routine
               lcall prtlcd       ; print routine
               db    11011111b,01000110b,0
                                  ; Data for deg F symbol.
               MOV   a,#0ffh
               lcall delay
               MOV   a,#3         ; Set location for cursor
               MOV   b,#6         ; to display current
                                  ; temperature.
               lcall placecur
               MOV   r4,#offcur   ; Turn OFF Cursor.
               lcall wrlcdcom     ; write lcd command routine

;  Here we will continously convert temp,
;  in CPU Mode for Temp Display
check_tmp:
               clr   p3.2        ; reset ds1620
               setb  p3.0        ; RXD and TXD high
               setb  p3.1

               MOV   a,#0ch      ; Load Write configuration
                                 ; byte instruction
               lcall out_cmd     ; send it to 1620
               MOV   a,#02h      ; set config byte = cpu mode,
               lcall out_data    ; send it to 1620

               MOV   a,#0eeh     ; initiate temperature conversion
               lcall out_cmd

               MOV   a,#0ffh     ; set delay time here
               lcall delay

read_tmp:
               clr   a
               MOV   a,#0aah     ; Load instruction to fetch last temp
               lcall out_cmd     ; conversion result.

        
     nbsp;      lcall in_data     ; get temp data from ds1620 ( LSB )
               MOV   r3,a        ; move ( LSB ) of temp data to Storage
                                 ; Register.
               lcall in_data     ; get temp data from ds1620 ( MSB )
               MOV   r1,a        ; move ( MSB ) of temp data to Storage
                                 ; Register.

; use data retrieved into Storage Registers, to point to
; lookup_table data to be shown on LCD.

               MOV   a,r3        ; mov conversion results to ACC
               lcall look_up     ; Fetch display data.
               MOV   a,#3        ; select lcd line #2.
               MOV   b,#6        ; start at location #7 with
                                 ; temp display.
               lcall placecur    ; place cursor at above selected
                                 ; location.
               MOV   r4,#offcur  ; kill the cursor so we dont
                                 ; have a cursor
               lcall wrlcdcom    ; being displayed.
               lcall delay       ; Delay between fetch.
               jb    p2.5,comin_back1
               ljmp  read_tmp    ; if done, go get another reading.

comin_back1:
               ljmp  comin_back; Goto program mode if switch selected

look_up:
               cjne     r1,#01h,over_32
                               ;determine if temp is above 32.
               sjmp     b0

over_32:
               ljmp     x0
st:
               ret             ; return to calling routine from here.


        ; Incredibly ( BIG ) Look-Up table begins here...........

b0:            cjne     a,#92h,b1   ; below 32 look up table
               lcall    prtlcd      ; -67 Deg F Lowest Value.
               db       '-67.0',0
               ljmp     st
b1:            cjne     a,#93h,b2
               lcall     prtlcd
               db       '-66.1',0
               ljmp     st
b2:            cjne     a,#94h,b3
               lcall     prtlcd
               db       '-65.2',0
               ljmp     st
b3:            cjne     a,#95h,b4
               lcall     prtlcd
               db       '-64.3',0
               ljmp     st
b4:            cjne     a,#96h,b5
               lcall     prtlcd
               db       '-63.4',0
               ljmp     st
b5:            cjne     a,#97h,b6
               lcall     prtlcd
               db       '-62.5',0
               ljmp     st
b6:            cjne     a,#98h,b7
               lcall     prtlcd
               db       '-61.6',0
               ljmp     st
b7:            cjne     a,#99h,b8
               lcall     prtlcd
               db       '-60.7',0
               ljmp     st
b8:            cjne     a,#9ah,b9
               lcall     prtlcd
               db       '-59.8',0
               ljmp     st
b9:            cjne     a,#9bh,b10
               lcall     prtlcd
               db       '-58.9',0
               ljmp     st
b10:           cjne     a,#9ch,b11
               lcall     prtlcd
               db       '-58.0',0
               ljmp&nbs

12下一頁  GO
  • 上一篇: LCD12864匯編語言程序例子
  • 下一篇: 軟件實現(xiàn)的看門狗原理匯編源代碼
  • 發(fā)表評論   告訴好友   打印此文  收藏此頁  關(guān)閉窗口  返回頂部
    熱點(diǎn)文章
     
    推薦文章
     
    相關(guān)文章
    網(wǎng)友評論:(只顯示最新5條。)
    關(guān)于我們 | 聯(lián)系我們 | 廣告合作 | 付款方式 | 使用幫助 | 機(jī)電之家 | 會員助手 | 免費(fèi)鏈接

    點(diǎn)擊這里給我發(fā)消息66821730(技術(shù)支持)點(diǎn)擊這里給我發(fā)消息66821730(廣告投放) 點(diǎn)擊這里給我發(fā)消息41031197(編輯) 點(diǎn)擊這里給我發(fā)消息58733127(審核)
    本站提供的機(jī)電設(shè)備,機(jī)電供求等信息由機(jī)電企業(yè)自行提供,該企業(yè)負(fù)責(zé)信息內(nèi)容的真實性、準(zhǔn)確性和合法性。
    機(jī)電之家對此不承擔(dān)任何保證責(zé)任,有侵犯您利益的地方請聯(lián)系機(jī)電之家,機(jī)電之家將及時作出處理。
    Copyright 2007 機(jī)電之家 Inc All Rights Reserved.機(jī)電之家-由機(jī)電一體化網(wǎng)更名-聲明
    電話:0571-87774297 傳真:0571-87774298
    杭州濱興科技有限公司提供技術(shù)支持

    主辦:杭州市高新區(qū)(濱江)機(jī)電一體化學(xué)會
    中國行業(yè)電子商務(wù)100強(qiáng)網(wǎng)站

    網(wǎng)站經(jīng)營許可證:浙B2-20080178-1