Nov 29, 2009

Design with microcontrollers:Final year ECE projects

  1.   ATmega644 JTAG Debugger
  2. Ultrasonic Haptic Vision (MP4, MP4, MP4)
  3. Haptic appointment manager (MP4 lots of wind and construction noise)
  4. 3D ultrasonic mouse (MP4, MP4, MP4)
  5. 3D scanner (MP4) (hackedgadgets)
  6. Gesture Recognition Based on Scratch Inputs (MP4) (uelectronics, )
  7. LED Sensor Keyboard (MP4 7Mb) (hackaday)
  8. Touchpad/Infrared Music Synthesizer (MP4)
  9. Programmable Synthesized Guitar (MP4)
  10. Der Kapellmeister (MP4)
  11. IR harp (MP4, MP4)
  12. Digital Receipts System (hackedgadgets, zedomax, uelectronics, )
  13. ODB-II Automotive data interface (hackaday, )
  14. Traction control system
  15. ACL Research: Foot Acceleration Sensor
  16. Fart Intensity Detector (MP4) (kitecrazy, hackaday, Popular Science sept09, Dvice, )
  17. Dual-Channel Mobile Surface Electromyograph (MP4)
  18. Tissue Impedance Digital Biopsy
  19. GPS Data Logger with Wireless Trigger (hackaday)
  20. Self-Adjusting Window Shade
  21. Weather Canvas (MP4)
  22. Autonomous Self-parking car (MP4, MP4)
  23. Holonomic Drive Vehicle with Stochastic Evolution
  24. Ball Picker Robot (MP4)
  25. BalanceBot (MP4)
  26. Snakearm Multiple PID motor controller (with Wiimote!) (MP4)
  27. Electric Etch (MP4, MP4)
  28. POV display (MP4) (hackaday)
  29. POV display
  30. Alarm clock with speech synthesis
  31. Blackout game
  32. ESD Foam Touch Controlled Brick Blaster
  33. NES emulator (uelectronics, )
  34. Laser Audio Transmitter
  35. Voice Tuner
  36. Wireless music player
  37. Multisensor Data Transmission
  38. Heliostat (MP4)
  39. Wii Conductor
  40. Musical Blocks
  41. Tic Tac Toe with CMOS Camera
  42. Robot Plotter
  43. PowerBox: smart AC outlet with metering and control
  44. Rhythm Ring: Interactive Rhythm Sequencer (MP4 video) (youtube and another)
  45. Trumpet MIDI Controller (MP4 video) (longer 53 Mbyte MP4 video)
  46. Air Drums (MP4 video), (MOV video) (youtube)
  47. Recorder Hero (MP4 video)
  48. Dueling Banjos (MP4 video)
  49. Intelligent wireless pedometer
  50. Networked Biometric Authentication
  51. Easy Input -head controlled mouse and keyboard interface (MP4 video1, video2)
  52. Virtual Keyboard (Circuit Cellar Magazine, issue #227, June 2009 page 14-19)
  53. 3D LED display (MOV video 60 Mbyte) (MP4 video)
  54. BordFree videogame (MP4 video)
  55. Haptic glove (MP4 video1, video2)
  56. High Speed Photography Controller
  57. 3D Maze in a Box video game (MP4 video)
  58. 3D Video Game Control (MP4 video)
  59. Multi-Player Light Cycle on Color TV (MP4 video)
  60. Gesture-driven Tetris (MP4 video)
  61. Remote Chess
  62. Data Acquisition System With Controller Area Network and SD Card
  63. Automotive On-Board Diagnostics Reader
  64. Adaptive 60 Hz Noise Cancellation (Journal of Neuroscience Methods, vol 185 (2009) pp50–55)
  65. Neural Net Helicopter (MP4 video)
  66. Accelerometer Controlled R/C Vehicle (MP4 video)
  67. Robot Arm (MP4 video)
  68. Help Quit Smoking Watch
  69. Electronic Impact Vest (MP4 video) (hacknmod) (Gizmodo)
  70. TouchSynth (MP4 video)
  71. TriWheeler robot (MP4 video) (youtube)
  72. Music Wand: Real-Time Optical Scanning of Sheet Music (MP4 video)
  73. Teaching an old clock (GE® Model 8116k) new tricks
  74. Shark Tag Microcontroller Platform
  75. Ghost Writer Robot (MP4 video)
  76. Rocket Inertial Navigation System (MP4 video)
  77. Guitar Tuner (MP4 video) (youtube)
  78. Scheme Interpreter
  79. Minigolf video game (MP4 video)
  80. Battlezone video game
  81. Laser Simon
  82. Snake Arm Glove
  83. Wiimote Crane
  84. Radio Beacon Finder
  85. Portable, color, tilt-controlled, video game (pictures 1, 2, 3, 4) (MP4-20MB)
  86. TouchPad video game (MP4-12MB)
  87. Laser Pong (mpeg: Bruce and Bryan playing) (blip.tv, gizmodo, ubergizmo, engadget )
    (NEXT no. 5: MINDBLOWERS
    , Denmark April 2008, (picture of Adrian at show, coverage in Danish newspaper)
  88. Movement to Music: A Wearable Wireless Motion Sensor system (MP4-17MB)
  89. Music-controlled Puppet (MP4-21MB)
  90. Line-following car (mpeg) (YouTube)
  91. Audio homing robot (hackedgadgets)
  92. Model retina: color tracker (mpeg)(MP4-23MB)
  93. Evolving neural robot
  94. MCU MIDI synthesizer
  95. AirJam: wearable air guitar (pictures 1, 2) (MP4-23MB)
  96. USB host controller (obsolete 476 version: USB host controller)
  97. UDP/Ethernet Controlled Temperature Regulator
  98. Dynamically reconfigurable MCU communication (local copy)
  99. Telescope controller
  100. Morse code interpreter, with speech synthesis
  101. Complex impedance analyzer
  102. uControl DVD macro-controller
  103. SD card MP3 player
  104. iPod controller
  105. USB Magnetic Mouse/Touchpad
  106. Polygraph (hacked-gadgets)
  107. Elevator Bank
  108. Pinball machine (MP4-15Mb)
  109. Guitar legend maker
  110. Braille reader
  111. Ultrasonic parking aid
  112. Retractable Alarm Clock (hackedgadgets)
  113. Autonomous Blimp (hackedgadgets)
  114. Automatic pet feeder
  115. Programmable medication scheduler
  116. CCD imager
  117. CalcParser
  118. Firefly synchronization
  119. Graphing calculator
  120. Speech recognition jukebox
  121. Speech recognition chess
  122. Sound Source Triangulation Game
  123. Touch Screen Controlled R/C Car
  124. AppleII emulator
  125. HDD analog clock with LCD touchscreen
  126. CUAUV Voltage Sniffer
  127. CUsat diagnostic board
  128. SearchBot (mpeg)
  129. RoboSweeper (mpeg, another mpeg)
  130. CoolerBot
  131. MCU/FPGA color video Game Platform (mpeg)
  132. Higher resolution color TV
  133. Color TV using two MCUs
  134. Musical Water Fountain (mpeg) (avi 20 Mbytes with sound)
  135. Two-TV video air Hockey (mpeg)
  136. Karaoke machine
  137. Dual control R/C car
  138. Guitar Synthesizer
  139. Self-powered solar data logger (Circuit Cellar magazine, issue #198, Jan 2007, page 12 , toc)
  140. Lighting control system
  141. Intelligent multimedia
  142. ADPCM voice recorder
  143. Reflow oven controller (Circuit Cellar magazine, issue #199, Feb 2007, page 46 )
  144. Ultrasonic spotlight tracker
  145. Galvanic skin response meter
  146. RFID security system (AVR design contest 2006) (Circuit Cellar magazine, issue #199, Feb 2007, page 24)(hackedgadgets)
  147. Autonomous Helicopter (mpeg) (AVR design Contest 2006 ) (hackedgadgets)
  148. Voice recognition car
  149. Speech recognition security system
  150. Morse code transmit and receive
  151. Secure LED
  152. SwingBot (mpeg)
  153. SwingBot (mpeg)
  154. Barcode scanner
  155. Soccermania video game
  156. Capacitance sensor MIDI keyboard
  157. Grillzilla wireless meat thermometer
  158. Para-para-revolution video game (mpeg)
  159. SnakeArm ultrasonic positioning control
  160. Sign language coach (mpeg)
  161. Radial ChalkBot
  162. Bicycle computer
  163. Handwriting Recognition System
  164. GPS World
  165. Video puzzle
  166. Chess Robot
  167. kaOS operating system and loader (Circuit Cellar Magazine, Issue #193 Aug 2006 page 56) (AVR design contest 2006)
  168. Keyboard mania (mpeg 19 Mbyte)
  169. Super Breakout video game (mpeg 1.9 Mbytes)
  170. Jezzball video game
  171. Duckhunt video game (mpeg 2.4 Mbytes)
  172. The Contender video game (mpeg 4.5 Mbytes)
  173. Big Red Juice Mixer (Slashdot article Monday, May 2, 2005)
  174. Color Tetris video game
  175. LightRover - light sensing robot
  176. PPP-Palm
  177. WeatherDog
  178. Virtual Pool (wmv 900 Kbytes) (Circuit Cellar Magazine, Issue #184 November 2005 )
  179. AirMouse (Circuit Cellar Magazine, Issue #191 June 2006, article)
  180. SharpShooter video game
  181. Neural net robot
  182. Wireless Electromyograph
  183. Stepper Motor Indexer & Decoder
  184. Turbidity meter
  185. Human Motion Capture
  186. Accelerometer Mouse
  187. Wireless Telemetry (avi 6 Mbytes) (HackADay Feb 16, 2006)
  188. Portable Security System
  189. Blood Pressure Monitor
  190. Missle Command video game
  191. Super Breakout video game (some images broken)
  192. Breathalyser door lock
  193. Programmable IR receiver and Connect-4 game
  194. MIDI drum controller
  195. Vocal Tuner
  196. RoboDog
  197. PC temperature control
  198. Dungeons of Doom video game
  199. Dual control RC car
  200. Solar Tracker
  201. GPS/inertial guidance
  202. Digger video game
  203. Gauntlet of uComputation
  204. CubeSat Diagnostics board
  205. Digital voice recorder
  206. ISREVER (Reversi) video game
  207. Frequency Division Multiplexing for a Multi-Sensor Wireless Telemetry System
  208. Shooting star video game
  209. Electronic Dartboard
  210. Kasubana electronic flower
  211. Bar Inventory System
  212. Voting Machine
  213. EyeSnake video game
  214. Digital Guitar tuner
  215. Automated Juice Mixer
  216. Mega32 webserver (code)
  217. Digital Stethoscope (Mpeg of display)
  218. Graduate from Cornell video game
  219. Flat Bed Scanner
  220. Non-orthogonal Plotter (mpeg)
  221. Mouse Painter
  222. Paint with mouse input
  223. Radio Controlled outlet strip
  224. Autonomous navigating robot (mpeg)
  225. Nova Strike video game
  226. Digital Compass
  227. MiniGolf video game with putter
  228. MiniGolf video game (mpeg)
  229. Programmable remote control
  230. Electr-O-Sketch (slashdot article) (Forbes article, follow the Custom Gadgets You Can't Buy link)
  231. Pong2
  232. Ultrasonic Rangefinder
  233. Mega32 Basic
  234. Music Synthesizer with Interactive TV Display
  235. Laser Morse code tutor
  236. Pump It Up audio game
  237. Guitar Tuner
  238. Beverage Monitor (slashdot article)
  239. MP3 radio
  240. Smart blinds
  241. Keypaw
  242. Home Security System
  243. Bar Code Scanner
  244. Implementation of a (31, 16) BCH code on a Microcontroller
  245. Ball Fight Video Game
  246. Breath Alcohol Tester
  247. WinAmp controller
  248. WinAmp Controller
  249. Eye-in-the-sky (mpeg of camera head)
  250. Xylophone
  251. Scorched Earth video game
  252. WonderSwan Development Cartridge
  253. Star Duel video game
  254. Big Red Map (Mpeg of engineering quad)
  255. Missle Command video game
  256. 3D gForce mouse
  257. Stationary Helicopter (mpeg)
  258. Remote control car
  259. Weather Station
  260. BlindBot
  261. Infrared Tracking System
  262. Inverted Pendulum Balancer
  263. Variable Traffic Controller
  264. MazeRunner Video Game
  265. 6502 Emulation on an Atmel Mega32
  266. Electronic Virtual Animal
  267. Arkanoid Video Game
  268. Cantneroid Video Game
  269. Digi-Level
  270. Reversi Video Game
  271. Guitar Special Effects
  272. Tap the Dance
  273. Graphing Calculator
  274. Dartboard with Video
  275. Memory Video Game
  276. Treasure of the High Seas Video Game
  277. PacMan Video Game
  278. SpaceInvaders Video Game
  279. Space Fighter Video Game
  280. Frogger Video Game
  281. MIDI synthesizer
  282. Radio Control Car
  283. Sound Effects Processor
  284. Battleship Video Game
  285. Wireless Keyboard
  286. DuckHunter Video Game
  287. MineSweeper Video Game
  288. Vehicle Performance Meter
  289. Digital Preamplifier
  290. Tetris Video Game
  291. Hockey Video Game
  292. Gray-scale Graphics: Dueling Ships
  293. Connect-4 Video Game
  294. Laser Light Show
  295. Wireless Drawing Device
  296. Laser Communications System
  297. TouchPad Drawing Board
  298. IntelliBot
  299. Sheet Music Generator
  300. TCP/IP
  301. Multi-Zone Fire Alarm System
  302. Scanning Tunneling Microscope
  303. Tic-Tac-Toe on TV
  304. Snake on TV
  305. Hard drive AVR programmer
  306. Audio Frequency Response Analyzer
  307. Line following autonomous car
  308. Safety-sensor vehicle
  309. MP3 Player
  310. MP3 Player
  311. Simon
  312. GPS AmeriMap
  313. Home security system
  314. Voice Activated Alarm Clock
  315. Russianbloc on LCD
  316. Pong on LCD
  317. Pong on oscilloscope
  318. Music Synthesizer
  319. Club Light Controller
  320. Blackjack2go
  321. Blackjack
  322. Globe
  323. Accelerometer Gmouse
  324. Postage meter
  325. Digital Hourglass
  326. Cornopoly on LCD
  327. Phone Dialer
  328. Laser Tag
  329. Robot Cricket
  330. WindCaddy
  331. Hovercraft
  332. Sound targeting
  333. Nintendo 64 to PS/2 Mouse
  334. Golf
  335. Fish: Video Controller
  336. PBX (Private Branch Exchange)
  337. Vertical Plotter
  338. X-Y Plotter
  339. Fertilizer Feedrate Controller
  340. Home Audio Control System
  341. SuperTrain Controller
  342. Digital Mirror Message Machine
  343. MP3 CD SuperJukebox
  344. Pre-emptive Operating System
  345. Wireless Internet Pager
  346. Wireless message Communicator
  347. Robot Arm
  348. Tilt Maze
  349. Ultra-Sonic Parking Assistant
  350. Cooking Coach
  351. BiLines
  352. gEECShip
  353. Graphing Calculator
  354. Web-based AVR Interface
  355. Midi Sequencer
  356. ECG monitoring system
  357. Autonomous Tank
  358. ZIP drive/Digital Camera
  359. Digital Message Machine
  360. Web-Monitored Thermostat
  361. Analog modem
  362. Robot Arm
  363. Security Entrance System
  364. Radio-controlled Truck
  365. Temperature Datalogger
  366. MP3 player
  367. Pong
  368. Snake 476
  369. Ultimate Alarm Clock
  370. Beat Tracking Strobe
  371. Guitar Special effects: The Shredder
  372. Drum machine and Sequencer
  373. Digital Thermometer
  374. Digital Oscilloscope
  375. Arbitrary Waveform Generator
  376. 8-Trak Sampler
  377. Serial-port game board
  378. Secure RSA Credit Card Transaction System
  379. Mini Area Network
  380. Autonomous Robotic Cricket
  381. Zen Touchpad
  382. Porche 911 Radio Controlled Car
  383. Autonomous Vehicle
  384. Spectrum Analyser
  385. Real-Time Guitar Tuner
  386. Whack-a-Cap
  387. CU Organizer
  388. Malay Language Learning kit
  389. Fixed point scientific calculator
  390. Etch-a-Sketch
  391. Real-time debugger
  392. VT100 Pong
  393. Home Security System
  394. Infrared Universal Remote Control
  395. Car Alarm System
  396. Hangman
  397. Simon
  398. Simon
  399. Answering Machine
  400. Thermostat
  401. BlackJack
  402. Blackjack
  403. Lego Vehicle
  404. RC car controller
  405. Sinewave Synthesizer
  406. Temperature and Pressure Control
  407. Video Frame Buffer


Oct 21, 2009

AVR delay calculator

this program generates the template code for delay for  AVR microcontrollers.The input given is the cycles or Time/sec or the clock frequency.After the entering these details the press the GO button and the code is generated which can be copied or saved.The copied or saved code can be used in the  AVR STUDIO to program the microcontroller.

click here to download the the AVR delay calculator

AVRdelayloop2

Oct 19, 2009

Final year electronic projects recommendation

Final Year Electronic Projects

It is usually the norm of students in the field of electrical, electronics, telecommunication, computer or communication of most universities and colleges to complete a final year project. Each must synthesize the theory and experimental work they learned during the first two to three years in order to complete the project. Under the supervision of their faculty supervisor, they must research, design, execute, document, and then present their work to the supervising committee.

A list of suitable topics will be offered by the university, from which preferred topics may be selected. Students sometimes will also have the opportunity to propose topics of their own devising, subject to approval for suitability.

Some of the projects which students may want to consider and get some ideas from are listed below. It usually involves the use of a microcontroller or a microprocessor in these projects. A lot of applications and ideas can be modified and build once they are familiar with circuit theory and operation.

Among the projects that one can consider is the utility metering projects which will become a norm in the near future. Hands-on of microcontroller projects will enable one to familiarise himself with the assembly language, C language and other tools that are used in the project.

Some of the final year electronic projects that one can get some ideas from are listed below.
Final Year Electronic Projects - Metering Project
Electronic meters compared to traditional mechanical solutions in use offer several additional advantages to the utility market. The metering utilities that can be replaced are gas, water and electricity meters.
Biometrics Digital Signal Processing Project
Biometrics is the technology used to analyze biological data. Its most recent application is in the area of security where the biological data of a person is used for personal identification and authentication before the person is allowed to proceed to enter a building or do any business transactions.
Bluetooth Technology
Bluetooth technology is a radio frequency short range communications technology that was created with the intention of replacing wired cables that are used to connect various portable and fixed devices. Get some reference design for your final year electronic projects here.
USB2.0 Card Reader Design Project
This project provides a reference USB2.0 Card Reader design with schematics and source codes for Compactflash, Memory Stick, Memory Stick Duo, Magic Gate, Secure Digital, MultimediaCard and SmartMedia.
X10 Home Automation Project
This project discusses the implementation of X-10 on a PIC microcontroller to create a home controller that can both send and receive X-10 signals.
Sensorless Brushless DC Motor Control Project
This project provides the application notes on the control of 3 phase sensor less brushless DC Motor.
Lighting Networking System Project
This project provides the application notes on the networking control of lighting devices using Digitally Addressable Lighting Interface Standard.
Zigbee Wireless Project
This project provides the application notes on the free frequency band wireless networking using Zigbee Standard.

Free engineering magazines

The following are some engineering free magazine available to cater for your various engineering needs :


EE Times

EE Times provides direct access to 150,000 high-level professionals involved in design/development engineering and management. EE Times is consistently chosen as the best-read and most preferred publication in the industry.

EE Times delivers business and technology news


every week to engineers and technical managers in the electronics industry. Besides reporting the news, editors analyze key industry trends and developments, put the news into perspective and predict what is likely to happen next. Opinion from leaders of government and industry is also part of the editorial fiber of the paper.


Electronic Design
Electronic Design's on-going objective is to observe and report the latest breakthroughs in EOEM technology. By providing this information Electronic Design has been the strategic partner of system designers and suppliers for the past 50 years, helping to bring them together so that they can deliver more competitive products to market faster.


Embedded System

Embedded Systems Design is a magazine for engineers, programmers and electronics hobbyists who are into using microcontroller and embedded microprocessor-based systems in their design.

This magazine provides best practices and peer guidance for Senior Systems Designers and their teams. These are the key designers responsible for defining systems, selecting the critical hardware and software components, building the systems, and integrating the hardware and firmware designs. This systems design magazine highlights the significant design methodologies, strategies and new products engineers need to gain a competitive advantage.


Electronic Products

Electronic Products reports on important developments in products and product technology. Its editorial serves as a key information source for engineers and managers.

Electronic Products focuses on the new product and product technology needs of engineers designing today's electronic equipment and systems. From cover to cover, month after month, we provide the relevant, timely product and product technology information today's engineers need to make informed buying decisions.


Test and Measurement

Test & Measurement World is the leading publication for engineers involved in electronics test, measurement, and inspection.

Test & Measurement World provides practical content and industry updates for engineers and engineering managers who are involved in using and buying equipment, software and services for test, measurement, inspection, and quality control during development, design and manufacturing or field service. 11 issues per year.

A tutorial on I2C protocol

This I2C tutorial shows you how the I2C protocol works at the physical bit level. It only discusses single master mode (a single controlling device) as this is the most common use for I2C in a small system.

I²C (pronounced I-squared-C) created by Philips Semiconductors and commonly written as 'I2C' stands for Inter-Integrated Circuit and allows communication of data between I2C devices over two wires. It sends information serially using one line for data (SDA) and one for clock (SCL).

 

i2c tutorial master and slaves diagram

Master and slave

The phillips I2C protocol defines the concept of master and slave devices. A master device is simply the device that is in charge of the bus at the present time and this device controls the clock and generates START and STOP signals. Slaves simply listen to the bus and act on controls and data that they are sent.

The master can send data to a slave or receive data from a slave - slaves do not transfer data between themselves.

Multi Master

Multi master operation is a more complex use of I2C that lets you have different controlling devices on the same bus. You only need to use this mode if you have more than one microcontroller on the bus (and you want either of them to be the bus master).

Multi master operation involves arbitration of the bus (where a master has to fight to get control of the bus) and clock synchronisation (each may a use a different clock e.g. because of separate crystal clocks for each micro).

Note: Multi master is not covered in this I2C tutorial as the more common use of I2C is to use a single bus master to control peripheral devices e.g. serial memory, ADC, RTC etc.

Data and Clock

The I2C interface uses two bi-directional lines meaning that any device could drive either line. In a single master system the master device drives the clock most of the time - the master is in charge of the clock but slaves can influence it to slow it down (See Slow Peripherals below).

The two wires must be driven as open collector/drain outputs and must be pulled high using one resistor each - this implements a 'wired AND function' - any device pulling the wire low causes all devices to see a low logic value - for high logic value all devices must stop driving the wire.

Note : If you use I2C you can not put any other (non I2C) devices on the bus as both lines are used as clock at some point (generation of START and STOP bits toggles the data line). So you can not do something clever such as keeping the clock line inactive and use the data line as a button press detector (to save pins).

You will often will find devices that you realise are I2C compatible but they are labelled as using a '2 wire interface'. The manufacturer is avoiding paying royalties by not using the words 'I2C'!

There are two wires (three if you include ground!) :

I2C Turorial: Signals definition

SDA : Serial Data
SCL : Serial Clock

I2C Turorial: end of signal definition

I2C Tutorial : Typical SDA and SCL signals

typical i2c signals

Speed

Standard clock speeds are 100kHz and 10kHz but the standard lets you use clock speeds from zero to 100kHz and a fast mode is also available (400kHz - Fast-mode). An even higher speed (3.4MHz - High-speed mode) for more demanding applications - The mid range PIC won't be up this mode yet!

Note that the low-speed mode has been omitted (10kHz) as the standard now specifies the basic system operating from 0 to 100kHz.

Slow peripherals

A slow slave device may need to stop the bus while it gathers data or services an interrupt etc. It can do this while holding the clock line (SCL) low forcing the master into the wait state. The master must then wait until SCL is released before proceeding.

Data transfer sequence

A basic Master to slave read or write sequence for I2C follows the following order:

I2C Tutorial : I2C basic command sequence.
  • 1. Send the START bit (S).
  • 2. Send the slave address (ADDR).
  • 3. Send the Read(R)-1 / Write(W)-0 bit.
  • 4. Wait for/Send an acknowledge bit (A).
  • 5. Send/Receive the data byte (8 bits) (DATA).
  • 6. Expect/Send acknowledge bit (A).
  • 7. Send the STOP bit (P).
I2C Tutorial : end of I2C basic command sequence.

Note: You can use 7 bit or 10 bit addresses.

The sequence 5 and 6 can be repeated so that a multibyte block can be read or written.

Data Transfer from master to slave

I2C Tutorial : Instruction sequence data from master to slave

i2c tutorial master to slave

A master device sends the sequence S ADDR W and then waits for an acknowledge bit (A) from the slave which the slave will only generate if its internal address matches the value sent by the master. If this happens then the master sends DATA and waits for acknowledge (A) from the slave. The master completes the byte transfer by generating a stop bit (P) (or repeated start).

Data transfer from slave to master

I2C Tutorial : Instruction sequence data from slave to master

i2c tutorial slave to master

A similar process happens when a master reads from the slave but in this case, instead of W, R is sent. After the data is transmitted from the slave to the master the master sends the acknowledge (A). If instead the master does not want any more data it must send a not-acknowledge which indicates to the slave that it should release the bus. This lets the master send the STOP or repeated START signal.

Device addresses

Each device you use on the I2C bus must have a unique address. For some devices e.g. serial memory you can set the lower address bits using input pins on the device others have a fixed internal address setting e.g. a real time clock DS1307. You can put several memory devices on the same IC bus by using a different address for each.

Note: The maximum number of devices is limited by the number of available addresses and by the total bus capacitance (maximum 400pF).

General call

The general call address is a reserved address which when output by the bus master should address all devices which should respond with an acknowledge.Its value is 0000000 (7 bits) and written by the master 0000000W. If a device does not need data from the general call it does not need to respond to it.

I2C Tutorial : Reserved addresses.

0000 000 1 START byte - for slow micros without I2C h/w
0000 001 X CBUS address - a different bus protocol
0000 010 X Reserved for different bus format
0000 011 X Reserved for future purposes
0000 1XX X Hs-mode master code
1111 1XX X Reserved for future purposes
1111 0XX X 10-bit slave addressing

I2C Tutorial : End of reserved addresses.

Most of these are not that useful for PIC microcontrollers except perhaps the START byte and 10 bit addressing.

START (S) and STOP (P) bits

START (S) and STOP (P) bits are unique signals that can be generated on the bus but only by a bus master.

Reception of a START bit by an I2C slave device resets its internal bus logic. This can be done at any time so you can force a restart if anything goes wrong even in the middle of communication.

START and STOP bits are defined as rising or falling edges on the data line while the clock line is kept high.

I2C Tutorial : text definition of START and STOP signals

START condition (S)
SCL = 1, SDA falling edge

STOP condition (P)
SCL = 1, SDA rising edge

I2C Tutorial : end of text definition of START and STOP signals

The following diagram shows the above information graphically - these are the signals you would see on the I2C bus.

I2C Tutorial : end of definition of START and STOP signals

I2C Tutorial : START (S) and STOP (P) bits.

i2c tutorial START and STOP

I2C Tutorial : end of definition of START and STOP signals

Note : In a single master system the only difference between a slave and a master is the master's ability to generate START and STOP bits. Both slave and master can control SDA and SCL.

Repeated START (Sr)

This seems like a confusing term at first as you ask yourself why bother with it as it is functionally identical to the sequence :

S ADDR (R/W) DATA A P

The only difference is that for a repeated start you can repeat the sequence starting from the stop bit (replacing the stop bit with another start bit).

S ADDR (R/W) DATA A Sr ADDR (R/W) DATA A P

and you can do this indefinitely.

Note: Reception of both S or Sr force any I2C device reset its internal bus logic so sending S or Sr is really resetting all the bus devices. This can be done at any time - it is a forced reset.

The main reason that the Sr bit exists is in a multi master configuration where the current bus master does not want to release its mastership. Using the repeated start keeps the bus busy so that no other master can grab the bus.

Because of this when used in a Single master configuration it is just a curiosity.

Data

All data blocks are composed of 8 bits. The initial block has 7 address bits followed by a direction bit (Read or Write). Following blocks have 8 data bits. Acknowledge bits are squeezed in between each block.

Each data byte is transmitted MSB first including the address byte.

To allow START and STOP bit generation by the master the data line (SDA) must not be changed while the clock (SCL) is high - it can only be changed when the clock is low.

Acknowledge

The acknowledge bit (generated by the receiving device) indicates to the transmitter that the the data transfer was ok. Note that the clock pulse for the acknowledge bit is always created by the bus master.

The acknowledge data bit is generated by either the master or slave depending on the data direction. For the master writing to a slave (W) the acknowledge is generated by the slave. For the master receiving (R) data from a slave the master generates the acknowledge bit.

I2C Tutorial : Definition of ACK bits

Acknowledge
0 volts

Not acknowledge
High volts

I2C Tutorial : End of definition of ACK bits
ACK data master --> slave

In this case the slave generates the acknowledge signal.

When a not-acknowledge is received by the bus master the transfer has failed and the master must generate a STOP or repeated START to abort the sequence.

ACK data slave --> master

In this case the master generates the acknowledge signal.

Normally the master will generate an acknowledge after it has received data but to indicate to the slave that no more data is required on the last byte transfer the master must generate a 'not-acknowledge'. This indicates to the slave that it should stop sending data. The master can then generate the STOP bit (or repeated START).

I2C Tutorial : Specifics for the 16F88
Pin configuration

To use the I2C mode in the 16F88 the SDA and SCL pins must be initialised as inputs (TRIS bit = 1) so that an open drain effect is created. By setting them as inputs they are not driving the wires and an external pull up resistor will pull the signals high.

Slave mode

The 16F88 fully implements all slave functions except general call.

The general call function does not really matter as it is quite specialised commanding all devices on the bus to use some data.

A low output is generated by driving the signal line low and changing the pin direction to an output. A high output is generated by changing the pin direction to an input so that the external resistor pulls the signal high.

In slave mode this action is done for you by the SSP module (the outputs of the register at SDA and SCL are driven low automatically - regardless of the state of the register value).

Master mode

Basically there is very limited master mode functionality.

There are two elements that are provided:

  • Interrupts
  • Pin control
16F88 Interrupts

There are two interrupts that activate on reception of either a START or STOP condition. These two interrupts are only useful in a multi master mode system where it is necessary for the non-master device to detect the start and stop conditions. So for a single master system they are of no use at all!

16F88 Pin control

Note When the SSP module is active SDA and SCL output are always set at zero regardless of the state of the register values. So all you have to do is control the port direction.

In master mode (16F88) SDA and SCL must be controlled using software.

I2C Tutorial : Specifics for 16F877A

It does it all for you!

  • Full master mode.
  • Full slave mode.
  • Full general call.

Note if you want a chip with full master and slave mode operation look for the MSSP module in a PIC chip e.g. 16F877A - then you won't need more software - just enough to drive the module.