基于單片機的紅外門進控制系統設計與制作:我們所做的創新實驗項目“基于單片機的紅外門控系統”已基本完成,現將其工作原理簡要說明。該系統主要分為兩大部分:一是紅外傳感器部分。二是單片機計數顯示控制部分。基本電路圖如下:其中紅外傳感器部分我們采用紅外對管實現,紅外對管平行放置,平常處于接收狀態,經比較器輸出低電平,當有人經過時,紅外線被擋住,接收管接收不到紅外線,經比較器輸出高電平。這樣,當有人經過時便會產生一個電平的跳變。單片機控制部分主要是通過外部兩個中斷判斷是否有人經過,如果有人經過,由于電平跳變的產生,進入中斷服務程序,這里我們采用了兩對紅外傳感器接到兩個外部中斷口,中斷0作為入口,實現加1操作,中斷1作為出口,實現減1操作。另外,我們通過P0口控制室內燈的亮暗,當寄存器計數值為0時,熄燈,不為0時,燈亮。顯示部分,采用兩位數碼管動態顯示,如有必要,可以很方便的擴展為四位計數。精益求精!在實驗過程中,我們走了非常多的彎路,做出來的東西根本不是自己想要的,我們本想做成室內只有一個門的進出計數,原理已清楚,即在門的兩邊放置兩對紅外對管,進出時,擋住兩對對管的順序不同,因此,可判斷是進入還是出去,從而實現加減計數,編程時,可分別在兩個中斷服務程序的入口置標志位,根據標志位判斷進出,詳細內容在程序部分。理論如此,但在實際過程中,還是發現實現不了上述功能,我們初步判定認為是程序掌握得不夠好,相信隨著自己對單片機了解的深入,應該會做出更好的 (因為我們是臨時學的單片機),程序的具體內容如下: $MOD52 ORG 0000H LJMP MAIN ORG 0003H LJMP 0100H ORG 0013H LJMP 0150H ORG 0050HMAIN: CLR A MOV 30H , A ;初始化緩存區 MOV 31H , A MOV 32H , A MOV 33H , A MOV R6 , A MOV R7 , A SETB EA SETB EX0 SETB EX1 SETB IT0 SETB IT1 SETB PX1NEXT1: ACALL HEXTOBCDD ;調用數制轉換子程序 ACALL DISPLAY ;調用顯示子程序 LJMP NEXT1 ORG 0100H ;中斷0服務程序 LCALL DELY mov 70h,#2 djnz 70h,next JBC F0,NEXT SETB F0 CLR P0.0 LCALL DELY0 SETB P0.0 MOV A , R7 ADD A , #1 MOV R7, A MOV A , R6 ADDC A , #0 MOV R6 , A CJNE R6 , #07H , NEXT CLR A MOV R6 , A MOV R7 , ANEXT: RETI ORG 0150H ;中斷1服務程序 LCALL DELY mov 70h,#2 djnz 70h,next2 JBC F0,NEXT2 SETB F0 CLR P0.0 LCALL DELY0 SETB P0.0 CLR C MOV A , R7 SUBB A , #1 MOV R7, A MOV A , R6 SUBB A , #0 MOV R6 , A CJNE R6 , #07H , NEXT2 CLR A MOV R6 , A MOV R7 , ANEXT2: RETI ORG 0200HHEXTOBCDD:MOV A , R6 ;由十六進制轉化為十進制 push ACC MOV A , R7 push ACC MOV A , R2 push ACC CLR A MOV R3 , A MOV R4 , A MOV R5 , A MOV R2 , #10HHB3: MOV A , R7 ;將十六進制中最高位移入進位位中 RLC A MOV R7 , A MOV A , R6 RLC A MOV R6 , A MOV A , R5 ;每位數加上本身相當于將這個數乘以2 ADDC A , R5 DA A MOV R5 , A MOV A , R4 ADDC A , R4 DA A ;十進制調整 MOV R4 , A MOV A , R3 ADDC A , R3 DJNZ R2 , HB3 POP ACC MOV R2 , A POP ACC MOV R7 , A POP ACC MOV R6 , A RET ORG 0250HDISPLAY: MOV R0 , #30H MOV A , R5 ANL A , #0FH MOV @R0 , A MOV A , R5 SWAP A ANL A , #0FH INC R0 MOV @R0 , A MOV A , R4 ANL A , #0FH INC R0 MOV @R0 , A MOV A , R4 SWAP A ANL A , #0FH INC R0 MOV @R0 , A MOV R0 , #30H MOV R2 , #11111110BAGAIN: MOV A , R2 MOV P2 , A MOV A , @R0 MOV DPTR , #TAB MOVC A , @A+DPTR MOV P1 , A ACALL DELAY INC R0 MOV A , R2 RL A MOV R2 , A JB ACC.4 , AGAIN RETTAB: DB 03FH , 06H , 5BH , 4FH , 66H , 6DH , 7DH , 07H , 7FH , 6FH ;七段碼表DELY: MOV R1,#80D1: MOV R2,#100 DJNZ R2,$ DJNZ R1,D1 RET DELAY: MOV TMOD , #01H ;延時子程序 MOV TL0 , #0FEH MOV TH0 , #0FEH SETB TR0WAIT: JNB TF0 , WAIT CLR TF0 CLR TR0 RETDELY0: MOV R1, #200D3: MOV R2,#250 DJNZ R2,$ DJNZ R1,D3 RET END 該系統實際應用廣泛。可用在生產線上產品數量統計、公交車智能計數問候(需添加語音芯片)、超市內人數統計等公共場合。另外,添加串口通信部分便可實現與PC數據交換的功能。 由于,實驗簡化了,剩下不少零件和資金,所以我們又做了兩項其他的實驗。
上傳時間: 2013-12-22
上傳用戶:tangsiyun
T2作為波特率控制UART_RXD 是硬中斷0或1口,如果能進入中斷,說明該線有一個起始位產生,進入中斷后調用下面的接收程序。退出硬中斷之前還需要將硬中斷標志重新復位。UART_TXD 是任何其它IO即可。UART_SEND: push IE push DPH push DPL push PSW push 00H push ACC CLR EA SETB UART_TXD ;START BIT MOV R0,A CLR TR2 ;TR2置1,計數器2啟動,時間計數啟動。 MOV A,RCAP2L;計數器2重新裝載值 MOV TL2,A ;置計數器2初值 ;T2需要重新裝載 MOV A,DPH MOV A,RCAP2H MOV TH2,A MOV A,R0 SETB TR2 ;TR2置1,計數器 JNB TF2,$ CLR TF2 JNB TF2,$ CLR TF2
上傳時間: 2014-01-12
上傳用戶:二十八號
很多不同的廠家生產各種型號的計算機,它們運行完全不同的操作系統,但TCP.IP協議族允許它們互相進行通信。這一點很讓人感到吃驚,因為它的作用已遠遠超出了起初的設想。T C P / I P起源于6 0年代末美國政府資助的一個分組交換網絡研究項目,到9 0年代已發展成為計算機之間最常應用的組網形式。它是一個真正的開放系統,因為協議族的定義及其多種實現可以不用花錢或花很少的錢就可以公開地得到。它成為被稱作“全球互聯網”或“因特網(Internet)”的基礎,該廣域網(WA N)已包含超過1 0 0萬臺遍布世界各地的計算機。本章主要對T C P / I P協議族進行概述,其目的是為本書其余章節提供充分的背景知識。 TCP.IP協議 縮略語 ACK (ACKnowledgment) TCP首部中的確認標志 API (Application Programming Interface) 應用編程接口 ARP (Address Resolution Protocol) 地址解析協議 ARPANET(Defense Advanced Research Project Agency NETwork) (美國)國防部遠景研究規劃局 AS (Autonomous System) 自治系統 ASCII (American Standard Code for Information Interchange) 美國信息交換標準碼 ASN.1 (Abstract Syntax Notation One) 抽象語法記法1 BER (Basic Encoding Rule) 基本編碼規則 BGP (Border Gateway Protocol) 邊界網關協議 BIND (Berkeley Internet Name Domain) 伯克利I n t e r n e t域名 BOOTP (BOOTstrap Protocol) 引導程序協議 BPF (BSD Packet Filter) BSD 分組過濾器 CIDR (Classless InterDomain Routing) 無類型域間選路 CIX (Commercial Internet Exchange) 商業互聯網交換 CLNP (ConnectionLess Network Protocol) 無連接網絡協議 CRC (Cyclic Redundancy Check) 循環冗余檢驗 CSLIP (Compressed SLIP) 壓縮的S L I P CSMA (Carrier Sense Multiple Access) 載波偵聽多路存取 DCE (Data Circuit-terminating Equipment) 數據電路端接設備 DDN (Defense Data Network) 國防數據網 DF (Don’t Fragment) IP首部中的不分片標志 DHCP (Dynamic Host Configuration Protocol) 動態主機配置協議 DLPI (Data Link Provider Interface) 數據鏈路提供者接口 DNS (Domain Name System) 域名系統 DSAP (Destination Service Access Point) 目的服務訪問點 DSLAM (DSL Access Multiplexer) 數字用戶線接入復用器 DSSS (Direct Sequence Spread Spectrum) 直接序列擴頻 DTS (Distributed Time Service) 分布式時間服務 DVMRP (Distance Vector Multicast Routing Protocol) 距離向量多播選路協議 EBONE (European IP BackbONE) 歐洲I P主干網 EOL (End of Option List) 選項清單結束 EGP (External Gateway Protocol) 外部網關協議 EIA (Electronic Industries Association) 美國電子工業協會 FCS (Frame Check Sequence) 幀檢驗序列 FDDI (Fiber Distributed Data Interface) 光纖分布式數據接口 FIFO (First In, First Out) 先進先出 FIN (FINish) TCP首部中的結束標志 FQDN (Full Qualified Domain Name) 完全合格的域名 FTP (File Transfer Protocol) 文件傳送協議 HDLC (High-level Data Link Control) 高級數據鏈路控制 HELLO 選路協議 IAB (Internet Architecture Board) Internet體系結構委員會 IANA (Internet Assigned Numbers Authority) Internet號分配機構 ICMP (Internet Control Message Protocol) Internet控制報文協議 IDRP (InterDomain Routing Protocol) 域間選路協議 IEEE (Institute of Electrical and Electronics Engineering) (美國)電氣與電子工程師協會 IEN (Internet Experiment Notes) 互聯網試驗注釋 IESG (Internet Engineering Steering Group) Internet工程指導小組 IETF (Internet Engineering Task Force) Internet工程專門小組 IGMP (Internet Group Management Protocol) Internet組管理協議 IGP (Interior Gateway Protocol) 內部網關協議 IMAP (Internet Message Access Protocol) Internet報文存取協議 IP (Internet Protocol) 網際協議 I RTF (Internet Research Task Force) Internet研究專門小組 IS-IS (Intermediate System to Intermediate System Protocol) 中間系統到中間系統協議 ISN (Initial Sequence Number) 初始序號 ISO (International Organization for Standardization) 國際標準化組織 ISOC (Internet SOCiety) Internet協會 LAN (Local Area Network) 局域網 LBX (Low Bandwidth X) 低帶寬X LCP (Link Control Protocol) 鏈路控制協議 LFN (Long Fat Net) 長肥網絡 LIFO (Last In, First Out) 后進先出 LLC (Logical Link Control) 邏輯鏈路控制 LSRR (Loose Source and Record Route) 寬松的源站及記錄路由 MBONE (Multicast Backbone On the InterNEt) Internet上的多播主干網 MIB (Management Information Base) 管理信息庫 MILNET (MILitary NETwork) 軍用網 MIME (Multipurpose Internet Mail Extensions) 通用I n t e r n e t郵件擴充 MSL (Maximum Segment Lifetime) 報文段最大生存時間 MSS (Maximum Segment Size) 最大報文段長度 M TA (Message Transfer Agent) 報文傳送代理 MTU (Maximum Transmission Unit) 最大傳輸單元 NCP (Network Control Protocol) 網絡控制協議 NFS (Network File System) 網絡文件系統 NIC (Network Information Center) 網絡信息中心 NIT (Network Interface Tap) 網絡接口栓(S u n公司的一個程序) NNTP (Network News Transfer Protocol) 網絡新聞傳送協議 NOAO (National Optical Astronomy Observatories) 國家光學天文臺 NOP (No Operation) 無操作 NSFNET (National Science Foundation NETwork) 國家科學基金網絡 NSI (NASA Science Internet) (美國)國家宇航局I n t e r n e t NTP (Network Time Protocol) 網絡時間協議 NVT (Network Virtual Terminal) 網絡虛擬終端 OSF (Open Software Foudation) 開放軟件基金 OSI (Open Systems Interconnection) 開放系統互連 OSPF (Open Shortest Path First) 開放最短通路優先 PAWS (Protection Against Wrapped Sequence number) 防止回繞的序號 PDU (Protocol Data Unit) 協議數據單元 POSIX (Portable Operating System Interface) 可移植操作系統接口 PPP (Point-to-Point Protocol) 點對點協議 PSH (push) TCP首部中的急迫標志 RARP (Reverse Address Resolution Protocol) 逆地址解析協議 RFC (Request For Comments) Internet的文檔,其中的少部分成為標準文檔 RIP (Routing Information Protocol) 路由信息協議 RPC (Remote Procedure Call) 遠程過程調用 RR (Resource Record) 資源記錄 RST (ReSeT) TCP首部中的復位標志 RTO (Retransmission Time Out) 重傳超時 RTT (Round-Trip Time) 往返時間 SACK (Selective ACKnowledgment) 有選擇的確認 SLIP (Serial Line Internet Protocol) 串行線路I n t e r n e t協議 SMI (Structure of Management Information) 管理信息結構 SMTP (Simple Mail Transfer Protocol) 簡單郵件傳送協議 SNMP (Simple Network Management Protocol) 簡單網絡管理協議 SSAP (Source Service Access Point) 源服務訪問點 SSRR (Strict Source and Record Route) 嚴格的源站及記錄路由 SWS (Silly Window Syndrome) 糊涂窗口綜合癥 SYN (SYNchronous) TCP首部中的同步序號標志 TCP (Transmission Control Protocol) 傳輸控制協議 TFTP (Trivial File Transfer Protocol) 簡單文件傳送協議 TLI (Transport Layer Interface) 運輸層接口 TTL (Ti m e - To-Live) 生存時間或壽命 TUBA (TCP and UDP with Bigger Addresses) 具有更長地址的T C P和U D P Telnet 遠程終端協議 UA (User Agent) 用戶代理 UDP (User Datagram Protocol) 用戶數據報協議 URG (URGent) TCP首部中的緊急指針標志 UTC (Coordinated Universal Time) 協調的統一時間 UUCP (Unix-to-Unix CoPy) Unix到U n i x的復制 WAN (Wide Area Network) 廣域網 WWW (World Wide Web) 萬維網 XDR (eXternal Data Representation) 外部數據表示 XID (transaction ID) 事務標識符 XTI (X/Open Transport Layer Interface) X/ O p e n運輸層接口
上傳時間: 2013-11-13
上傳用戶:tdyoung
This example shows how to update at regulate period the WWDG counter using theEarly Wakeup interrupt (EWI). The WWDG timeout is set to 262ms, refresh window set to 41h and the EWI isenabled. When the WWDG counter reaches 40h the EWI is generated and in the WWDGISR the counter is refreshed to prevent a WWDG reset and led connected to PC.07is toggled.The EXTI line9 is connected to PB.09 pin and configured to generate an interrupton falling edge.In the NVIC, EXTI line9 to 5 interrupt vector is enabled with priority equal to 0and the WWDG interrupt vector is enabled with priority equal to 1 (EXTI IT > WWDG IT). The EXTI Line9 will be used to simulate a software failure: once the EXTI line9event occurs (by pressing Key push-button on EVAL board) the correspondent interruptis served, in the ISR the led connected to PC.07 is turned off and the EXTI line9pending bit is not cleared. So the CPU will execute indefinitely EXTI line9 ISR andthe WWDG ISR will never be entered(WWDG counter not updated). As result, when theWWDG counter falls to 3Fh the WWDG reset occurs.If the EXTI line9 event don抰 occurs the WWDG counter is indefinitely refreshed inthe WWDG ISR which prevent from WWDG reset. If the WWDG reset is generated, after resuming from reset a led connected to PC.06is turned on. In this example the system is clocked by the HSE(8MHz).
上傳時間: 2013-11-11
上傳用戶:gundamwzc
Accurate measurement of the third order intercept pointfor low distortion IC products such as the LT5514 requirescertain precautions to be observed in the test setup andtesting procedure. The LT5514 linearity performance ishigh enough to push the test equipment and test set-up totheir limits. A method for accurate measurement of thirdorder intermodulation products, IM3, with standard testequipment is outlined below.It is also important to correctly interpret the LT5514specification with respect to ROUT, and the impact ofdemo-board transmission-line termination loss whenevaluating the linearity performance, as explained in theLT5514 Datasheet and in Note 1 of this document.
上傳時間: 2013-11-14
上傳用戶:l254587896
無線方式下的數據業務打包規范,中文翻譯版!手邊書,非常實用!看懂此文和相關的其它規范,就能在最深層次上理解WAP push、短信承載等技術的原理。
上傳時間: 2014-01-04
上傳用戶:zhuoying119
ATmega8 taillight circuitAn assembly language program that generates 5 different static patterns with switching from pattern-to-pattern controlled by the depression of one push-button switch (S2).
標簽: taillight circuitAn generates different
上傳時間: 2014-01-12
上傳用戶:wanghui2438
ATmega8 taillight circuitA more complex C program that implements different flashing patterns under the control of both the push buttons and potentiometer. Use your imagination to come up with some novel ideas here. Remember however that more marks are to be awarded for the quality of the code than for the novelness of the patterns.
標簽: implements taillight different circuitA
上傳時間: 2013-11-27
上傳用戶:zhuimenghuadie
手機發送端消息的通信模塊,包括短信,WAP push等功能
上傳時間: 2015-04-08
上傳用戶:wab1981
wappush-c實現 注意,短信應當以二進制格式發送(SMPP和CMPP里,編碼為0x04) 短信內容,WAP push是使用1條或者多條短信來發的,如果內容超過了140個字節,就必須分多條發送,規則如下: 0B05040B8423F00003B3 02 01 B30601AE02056A0045C60C03 6865726F2E7478736D732E636F6D 0001 037465737474657374746573747465737474657374746573747465737474657374746573747465737474657374746573747465737474657374746573747465737474657374746573747465737474657374746573747465737474657374746573747465 02是指共有兩條短信 01是指這是第一條 這里是URL地址(hero.txsms.com),注意不要有http:// 0001為URL結束標志 描述文字開始,注意:utf編碼。 0B05040B8423F00003B3 02 02 737474657374746573747465737474657374746573747465737474657374746573747465737474657374000101 02是指共有兩條短信 02是指這是第一條 繼續上條未完內容 請參考example.c中的例子
標簽: wappush-c
上傳時間: 2013-12-26
上傳用戶:電子世界