Free Essay

Embedded Sys I2C

In:

Submitted By Tedkr
Words 280
Pages 2
I2C INTERFACING
Aim:
Program to transmit 3 bytes of data from 8051 using I2C protocol.
Program:
ORG 00H SDA EQU P3.7 ;equate P2.7 as SDA SCL EQU P3.6 ;equate P2.6 as SCL MOV R2,#03H ;create counter of 3 MOV DPTR,#MY_DATA ;store the address of the 1st data to DPTR ACALL START ;start condition
BB: CLR A ;clear accumulator MOVC A,@A+DPTR ;store the data to accumulator ACALL DATA_SENT ;sent data ACALL ACK ;check for acknowledgement JC BB ;if NAK, resent the data INC DPTR ;increment DPTR DJNZ R2,BB ;decrement counter, if 0 jump to BB ACALL STOP ;stop condition SJMP $
START: SETB SDA ;set SDA line SETB SCL ;set SCL line ACALL DELAY ;delay CLR SDA ;clear SDA line ACALL DELAY ;delay CLR SCL ;clear SCL line RET
STOP: CLR SCL ;clear SCL line CLR SDA ;clear SDA line SETB SCL ;set SCL line ACALL DELAY ;delay SETB SDA ;set SDA line ACALL DELAY ;delay CLR SCL ;clear SCL line RET
DATA_SENT:
CLR SCL ;clear SCL line MOV R3,#08H ;create a counter of 8, to transmit 8 bit data
AA: RLC A ;rotate accumulator left through carry MOV SDA,C ;transmit from MSB to LSB ACALL DELAY ;delay SETB SCL ;set SCL line ACALL DELAY ;delay CLR SCL ;clear SCL line DJNZ R3,AA ;decrement the counter, if =0 return RET
ACK: SETB SDA ;set SDA line SETB SCL ;set SCL line ACALL DELAY ;delay CLR SCL ;clear SCL line ACALL DELAY ;delay MOV C,SDA RET
DELAY: NOP ;delay subroutine NOP NOP NOP NOP RET
MY_DATA: DB 0X56,0X76,0X77 ;data to be sent are stored in rom END

******

Similar Documents

Free Essay

Monitoring Section

...project RFID is used for the Tracking purpose for stolen things. An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few predefined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. Security over the years has been a source of concern to organizations and companies. This has caused quite a significant amount of capital being budgeted for improvements on security systems, simply because it has been discovered that the access control system mechanism is an important part of an organization. One of the important security systems in building, vehicle security is door access control. The door access control is a physical security that assures the security of a building or vehicle by limiting access to the vehicle to specific people and by keeping records or goods of such entries. Physically, embedded systems ranges from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power plants. In terms of complexity embedded systems can range from very simple...

Words: 10647 - Pages: 43

Free Essay

Paper

...Full Circle THE INDEPENDENT MAGAZINE FOR THE UBUNTU LINUX COMMUNITY ISSUE #90 - October 201 4 Photo: miss_millions (Flickr.com) P R I S O N AR C H I T E C T BUILD YOUR OWN OPEN SOURCE PRISON Fu ll Ci rcle M a g a zi n e i s n e i th e r a ffi li a te d wi th , n o r e n d o rse d b y, Ca n o n i ca l Ltd . full circle magazine #90 1 contents ^ HowTo OpenConnect to Cisco p.1 4 Full Circle THE INDEPENDENT MAGAZINE FOR THE UBUNTU LINUX COMMUNITY Linux News p.04 BACK NEXT MONTH LibreOffice p.1 5 Command & Conquer p.1 2 Arduino p.25 LinuxLabs p.XX Broadcast With WCS p.1 7 Linux Labs p.28 Review p.36 My Story p.37 BACK NEXT MONTH Blender p.XX Letters p.40 Tuxidermy p.41 Q&A p.42 BACK NEXT MONTH Inkscape BACK NEXT MONTH Ubuntu Women p.XX Ubuntu Games p.44 Graphics p.22 Security p.XX The articles contained in this magazine are released under the Creative Commons Attribution-Share Alike 3.0 Unported license. This means you can adapt, copy, distribute and transmit the articles but only under the following conditions: you must attribute the work to the original author in some way (at least a name, email or URL) and to this magazine by name ('Full Circle Magazine') and the URL www.fullcirclemagazine.org (but not attribute the article(s) in any way that suggests that they endorse you or your use of the work). If you alter, transform, or build upon this work, you must distribute the resulting work under...

Words: 22047 - Pages: 89

Free Essay

Bsr 64k Command Reference Guide

...BSR 64000 Command Reference Guide Compass ID: 271820115 Version 3 Release 5.0.0 Notice Copyright © 2008 Motorola, Inc. All rights reserved No part of this publication my be reproduced in any form or by any means or used to make any derivative work (such as translation, transformation or adaptation) without written permission from Motorola, Inc. Motorola reserves the right to revise this publication and to make changes in content from time to time without obligation on the part of Motorola to provide notification of such revision or change. Motorola provides this guide without warranty of any kind, either implied or expressed, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Motorola may make improvements or changes in the product(s) described in this manual at any time. Motorola and the stylized M logo are registered trademarks of Motorola, Inc. Broadband Services Router, BSR, BSR 64000, RiverDelta, and SmartFlow are trademarks of Motorola, Inc. All other trademarks and registered trademarks are the property of their respective owners. Caring for the Environment by Recycling When you see this symbol on a Motorola product, do not dispose of the product with residential or commercial waste. Recycling your Motorola Equipment Please do not dispose of this product with your residential or commercial waste. Some countries or regions, such as the European Union, have set up systems to collect and recycle electrical...

Words: 97484 - Pages: 390

Premium Essay

Redhat

...edhat® ® Te r r y C o l l i n g s & K u r t W a l l UR ON IT OOLS IN Y T C E CD-R L TH O ED UD M Linux Solutions from the Experts at Red Hat ® ® P R E S S™ SEC Red Hat® Linux® Networking and System Administration Red Hat® Linux® Networking and System Administration Terry Collings and Kurt Wall M&T Books An imprint of Hungry Minds, Inc. Best-Selling Books G Digital Downloads G e-Books G Answer Networks e-Newsletters G Branded Web Sites G e-Learning New York, NY G Cleveland, OH G Indianapolis, IN Red Hat® Linux® Networking and System Administration Published by Hungry Minds, Inc. 909 Third Avenue New York, NY 10022 www.hungryminds.com Copyright © 2002 Hungry Minds, Inc. All rights reserved. No part of this book, including interior design, cover design, and icons, may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording, or otherwise) without the prior written permission of the publisher. Library of Congress Control Number: 2001093591 ISBN: 0-7645-3632-X Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 1O/RT/QT/QS/IN Distributed in the United States by Hungry Minds, Inc. Distributed by CDG Books Canada Inc. for Canada; by Transworld Publishers Limited in the United Kingdom; by IDG Norge Books for Norway; by IDG Sweden Books for Sweden; by IDG Books Australia Publishing Corporation Pty. Ltd. for Australia and New Zealand; by TransQuest Publishers Pte Ltd. for Singapore, Malaysia, Thailand...

Words: 220815 - Pages: 884

Free Essay

Maglev

...*3963103* [3963] – 103 T.E. (Petroleum) (Semester – I) Examination, 2011 DRILLING & PRODUCTION OPERATIONS (2003 Course) Time : 3 Hours Max. Marks : 100 Instructions : 1) Question Nos. 1 and 5 are compulsory. Out of the remaining attempt 2 questions from Section I and 2 questions from Section II. 2) Answers to the two Sections should be written in separate books. 3) Neat diagrams must be drawn wherever necessary. 4) Black figures to the right indicate full marks. 5) Use of Logarithmic Tables, Slide Rule, Mollier Charts, Electronic Pocket Calculator and Steam Tables is allowed. 6) Assume suitable data, if necessary. SECTION – I 1. What are different systems on a drilling rig ? Explain any one in detail with suitable diagramme. 18 2. a) Calculate Bottom hole pressure if well depth is 2500 m and mud weight is 1.2 gm/cc. b) Calculate mud weight if mud gradient is 0.87 psi/ft. ′ c) Calculate volume bbl/meter for drill pipe O.D. = 5′ inch and I.D. = 4.276 inch. 2 2 2 10 8 8 16 d) Draw circulation system on a drilling rig. 3. a) Discuss IADC classification of a bit in details. b) Discuss different factors affecting rate of penetration in details. 4. Write short note on : i) Coring ii) Fishing tools iii) BOP iv) Directional well P.T.O. [3963] – 103 -2- *3963103* SECTION – II 5. a) Discuss different types of casings and function of the casings in brief. b) Discuss different types of well completion techniques. 6. a) Discuss primary cementation process with...

Words: 172166 - Pages: 689