- ATmega644 JTAG Debugger
- Ultrasonic Haptic Vision (MP4, MP4, MP4)
- Haptic appointment manager (MP4 lots of wind and construction noise)
- 3D ultrasonic mouse (MP4, MP4, MP4)
- 3D scanner (MP4) (hackedgadgets)
- Gesture Recognition Based on Scratch Inputs (MP4) (uelectronics, )
- LED Sensor Keyboard (MP4 7Mb) (hackaday)
- Touchpad/Infrared Music Synthesizer (MP4)
- Programmable Synthesized Guitar (MP4)
- Der Kapellmeister (MP4)
- IR harp (MP4, MP4)
- Digital Receipts System (hackedgadgets, zedomax, uelectronics, )
- ODB-II Automotive data interface (hackaday, )
- Traction control system
- ACL Research: Foot Acceleration Sensor
- Fart Intensity Detector (MP4) (kitecrazy, hackaday, Popular Science sept09, Dvice, )
- Dual-Channel Mobile Surface Electromyograph (MP4)
- Tissue Impedance Digital Biopsy
- GPS Data Logger with Wireless Trigger (hackaday)
- Self-Adjusting Window Shade
- Weather Canvas (MP4)
- Autonomous Self-parking car (MP4, MP4)
- Holonomic Drive Vehicle with Stochastic Evolution
- Ball Picker Robot (MP4)
- BalanceBot (MP4)
- Snakearm Multiple PID motor controller (with Wiimote!) (MP4)
- Electric Etch (MP4, MP4)
- POV display (MP4) (hackaday)
- POV display
- Alarm clock with speech synthesis
- Blackout game
- ESD Foam Touch Controlled Brick Blaster
- NES emulator (uelectronics, )
- Laser Audio Transmitter
- Voice Tuner
- Wireless music player
- Multisensor Data Transmission
- Heliostat (MP4)
- Wii Conductor
- Musical Blocks
- Tic Tac Toe with CMOS Camera
- Robot Plotter
- PowerBox: smart AC outlet with metering and control
- Rhythm Ring: Interactive Rhythm Sequencer (MP4 video) (youtube and another)
- Trumpet MIDI Controller (MP4 video) (longer 53 Mbyte MP4 video)
- Air Drums (MP4 video), (MOV video) (youtube)
- Recorder Hero (MP4 video)
- Dueling Banjos (MP4 video)
- Intelligent wireless pedometer
- Networked Biometric Authentication
- Easy Input -head controlled mouse and keyboard interface (MP4 video1, video2)
- Virtual Keyboard (Circuit Cellar Magazine, issue #227, June 2009 page 14-19)
- 3D LED display (MOV video 60 Mbyte) (MP4 video)
- BordFree videogame (MP4 video)
- Haptic glove (MP4 video1, video2)
- High Speed Photography Controller
- 3D Maze in a Box video game (MP4 video)
- 3D Video Game Control (MP4 video)
- Multi-Player Light Cycle on Color TV (MP4 video)
- Gesture-driven Tetris (MP4 video)
- Remote Chess
- Data Acquisition System With Controller Area Network and SD Card
- Automotive On-Board Diagnostics Reader
- Adaptive 60 Hz Noise Cancellation (Journal of Neuroscience Methods, vol 185 (2009) pp50–55)
- Neural Net Helicopter (MP4 video)
- Accelerometer Controlled R/C Vehicle (MP4 video)
- Robot Arm (MP4 video)
- Help Quit Smoking Watch
- Electronic Impact Vest (MP4 video) (hacknmod) (Gizmodo)
- TouchSynth (MP4 video)
- TriWheeler robot (MP4 video) (youtube)
- Music Wand: Real-Time Optical Scanning of Sheet Music (MP4 video)
- Teaching an old clock (GE® Model 8116k) new tricks
- Shark Tag Microcontroller Platform
- Ghost Writer Robot (MP4 video)
- Rocket Inertial Navigation System (MP4 video)
- Guitar Tuner (MP4 video) (youtube)
- Scheme Interpreter
- Minigolf video game (MP4 video)
- Battlezone video game
- Laser Simon
- Snake Arm Glove
- Wiimote Crane
- Radio Beacon Finder
- Portable, color, tilt-controlled, video game (pictures 1, 2, 3, 4) (MP4-20MB)
- TouchPad video game (MP4-12MB)
- 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) - Movement to Music: A Wearable Wireless Motion Sensor system (MP4-17MB)
- Music-controlled Puppet (MP4-21MB)
- Line-following car (mpeg) (YouTube)
- Audio homing robot (hackedgadgets)
- Model retina: color tracker (mpeg)(MP4-23MB)
- Evolving neural robot
- MCU MIDI synthesizer
- AirJam: wearable air guitar (pictures 1, 2) (MP4-23MB)
- USB host controller (obsolete 476 version: USB host controller)
- UDP/Ethernet Controlled Temperature Regulator
- Dynamically reconfigurable MCU communication (local copy)
- Telescope controller
- Morse code interpreter, with speech synthesis
- Complex impedance analyzer
- uControl DVD macro-controller
- SD card MP3 player
- iPod controller
- USB Magnetic Mouse/Touchpad
- Polygraph (hacked-gadgets)
- Elevator Bank
- Pinball machine (MP4-15Mb)
- Guitar legend maker
- Braille reader
- Ultrasonic parking aid
- Retractable Alarm Clock (hackedgadgets)
- Autonomous Blimp (hackedgadgets)
- Automatic pet feeder
- Programmable medication scheduler
- CCD imager
- CalcParser
- Firefly synchronization
- Graphing calculator
- Speech recognition jukebox
- Speech recognition chess
- Sound Source Triangulation Game
- Touch Screen Controlled R/C Car
- AppleII emulator
- HDD analog clock with LCD touchscreen
- CUAUV Voltage Sniffer
- CUsat diagnostic board
- SearchBot (mpeg)
- RoboSweeper (mpeg, another mpeg)
- CoolerBot
- MCU/FPGA color video Game Platform (mpeg)
- Higher resolution color TV
- Color TV using two MCUs
- Musical Water Fountain (mpeg) (avi 20 Mbytes with sound)
- Two-TV video air Hockey (mpeg)
- Karaoke machine
- Dual control R/C car
- Guitar Synthesizer
- Self-powered solar data logger (Circuit Cellar magazine, issue #198, Jan 2007, page 12 , toc)
- Lighting control system
- Intelligent multimedia
- ADPCM voice recorder
- Reflow oven controller (Circuit Cellar magazine, issue #199, Feb 2007, page 46 )
- Ultrasonic spotlight tracker
- Galvanic skin response meter
- RFID security system (AVR design contest 2006) (Circuit Cellar magazine, issue #199, Feb 2007, page 24)(hackedgadgets)
- Autonomous Helicopter (mpeg) (AVR design Contest 2006 ) (hackedgadgets)
- Voice recognition car
- Speech recognition security system
- Morse code transmit and receive
- Secure LED
- SwingBot (mpeg)
- SwingBot (mpeg)
- Barcode scanner
- Soccermania video game
- Capacitance sensor MIDI keyboard
- Grillzilla wireless meat thermometer
- Para-para-revolution video game (mpeg)
- SnakeArm ultrasonic positioning control
- Sign language coach (mpeg)
- Radial ChalkBot
- Bicycle computer
- Handwriting Recognition System
- GPS World
- Video puzzle
- Chess Robot
- kaOS operating system and loader (Circuit Cellar Magazine, Issue #193 Aug 2006 page 56) (AVR design contest 2006)
- Keyboard mania (mpeg 19 Mbyte)
- Super Breakout video game (mpeg 1.9 Mbytes)
- Jezzball video game
- Duckhunt video game (mpeg 2.4 Mbytes)
- The Contender video game (mpeg 4.5 Mbytes)
- Big Red Juice Mixer (Slashdot article Monday, May 2, 2005)
- Color Tetris video game
- LightRover - light sensing robot
- PPP-Palm
- WeatherDog
- Virtual Pool (wmv 900 Kbytes) (Circuit Cellar Magazine, Issue #184 November 2005 )
- AirMouse (Circuit Cellar Magazine, Issue #191 June 2006, article)
- SharpShooter video game
- Neural net robot
- Wireless Electromyograph
- Stepper Motor Indexer & Decoder
- Turbidity meter
- Human Motion Capture
- Accelerometer Mouse
- Wireless Telemetry (avi 6 Mbytes) (HackADay Feb 16, 2006)
- Portable Security System
- Blood Pressure Monitor
- Missle Command video game
- Super Breakout video game (some images broken)
- Breathalyser door lock
- Programmable IR receiver and Connect-4 game
- MIDI drum controller
- Vocal Tuner
- RoboDog
- PC temperature control
- Dungeons of Doom video game
- Dual control RC car
- Solar Tracker
- GPS/inertial guidance
- Digger video game
- Gauntlet of uComputation
- CubeSat Diagnostics board
- Digital voice recorder
- ISREVER (Reversi) video game
- Frequency Division Multiplexing for a Multi-Sensor Wireless Telemetry System
- Shooting star video game
- Electronic Dartboard
- Kasubana electronic flower
- Bar Inventory System
- Voting Machine
- EyeSnake video game
- Digital Guitar tuner
- Automated Juice Mixer
- Mega32 webserver (code)
- Digital Stethoscope (Mpeg of display)
- Graduate from Cornell video game
- Flat Bed Scanner
- Non-orthogonal Plotter (mpeg)
- Mouse Painter
- Paint with mouse input
- Radio Controlled outlet strip
- Autonomous navigating robot (mpeg)
- Nova Strike video game
- Digital Compass
- MiniGolf video game with putter
- MiniGolf video game (mpeg)
- Programmable remote control
- Electr-O-Sketch (slashdot article) (Forbes article, follow the Custom Gadgets You Can't Buy link)
- Pong2
- Ultrasonic Rangefinder
- Mega32 Basic
- Music Synthesizer with Interactive TV Display
- Laser Morse code tutor
- Pump It Up audio game
- Guitar Tuner
- Beverage Monitor (slashdot article)
- MP3 radio
- Smart blinds
- Keypaw
- Home Security System
- Bar Code Scanner
- Implementation of a (31, 16) BCH code on a Microcontroller
- Ball Fight Video Game
- Breath Alcohol Tester
- WinAmp controller
- WinAmp Controller
- Eye-in-the-sky (mpeg of camera head)
- Xylophone
- Scorched Earth video game
- WonderSwan Development Cartridge
- Star Duel video game
- Big Red Map (Mpeg of engineering quad)
- Missle Command video game
- 3D gForce mouse
- Stationary Helicopter (mpeg)
- Remote control car
- Weather Station
- BlindBot
- Infrared Tracking System
- Inverted Pendulum Balancer
- Variable Traffic Controller
- MazeRunner Video Game
- 6502 Emulation on an Atmel Mega32
- Electronic Virtual Animal
- Arkanoid Video Game
- Cantneroid Video Game
- Digi-Level
- Reversi Video Game
- Guitar Special Effects
- Tap the Dance
- Graphing Calculator
- Dartboard with Video
- Memory Video Game
- Treasure of the High Seas Video Game
- PacMan Video Game
- SpaceInvaders Video Game
- Space Fighter Video Game
- Frogger Video Game
- MIDI synthesizer
- Radio Control Car
- Sound Effects Processor
- Battleship Video Game
- Wireless Keyboard
- DuckHunter Video Game
- MineSweeper Video Game
- Vehicle Performance Meter
- Digital Preamplifier
- Tetris Video Game
- Hockey Video Game
- Gray-scale Graphics: Dueling Ships
- Connect-4 Video Game
- Laser Light Show
- Wireless Drawing Device
- Laser Communications System
- TouchPad Drawing Board
- IntelliBot
- Sheet Music Generator
- TCP/IP
- Multi-Zone Fire Alarm System
- Scanning Tunneling Microscope
- Tic-Tac-Toe on TV
- Snake on TV
- Hard drive AVR programmer
- Audio Frequency Response Analyzer
- Line following autonomous car
- Safety-sensor vehicle
- MP3 Player
- MP3 Player
- Simon
- GPS AmeriMap
- Home security system
- Voice Activated Alarm Clock
- Russianbloc on LCD
- Pong on LCD
- Pong on oscilloscope
- Music Synthesizer
- Club Light Controller
- Blackjack2go
- Blackjack
- Globe
- Accelerometer Gmouse
- Postage meter
- Digital Hourglass
- Cornopoly on LCD
- Phone Dialer
- Laser Tag
- Robot Cricket
- WindCaddy
- Hovercraft
- Sound targeting
- Nintendo 64 to PS/2 Mouse
- Golf
- Fish: Video Controller
- PBX (Private Branch Exchange)
- Vertical Plotter
- X-Y Plotter
- Fertilizer Feedrate Controller
- Home Audio Control System
- SuperTrain Controller
- Digital Mirror Message Machine
- MP3 CD SuperJukebox
- Pre-emptive Operating System
- Wireless Internet Pager
- Wireless message Communicator
- Robot Arm
- Tilt Maze
- Ultra-Sonic Parking Assistant
- Cooking Coach
- BiLines
- gEECShip
- Graphing Calculator
- Web-based AVR Interface
- Midi Sequencer
- ECG monitoring system
- Autonomous Tank
- ZIP drive/Digital Camera
- Digital Message Machine
- Web-Monitored Thermostat
- Analog modem
- Robot Arm
- Security Entrance System
- Radio-controlled Truck
- Temperature Datalogger
- MP3 player
- Pong
- Snake 476
- Ultimate Alarm Clock
- Beat Tracking Strobe
- Guitar Special effects: The Shredder
- Drum machine and Sequencer
- Digital Thermometer
- Digital Oscilloscope
- Arbitrary Waveform Generator
- 8-Trak Sampler
- Serial-port game board
- Secure RSA Credit Card Transaction System
- Mini Area Network
- Autonomous Robotic Cricket
- Zen Touchpad
- Porche 911 Radio Controlled Car
- Autonomous Vehicle
- Spectrum Analyser
- Real-Time Guitar Tuner
- Whack-a-Cap
- CU Organizer
- Malay Language Learning kit
- Fixed point scientific calculator
- Etch-a-Sketch
- Real-time debugger
- VT100 Pong
- Home Security System
- Infrared Universal Remote Control
- Car Alarm System
- Hangman
- Simon
- Simon
- Answering Machine
- Thermostat
- BlackJack
- Blackjack
- Lego Vehicle
- RC car controller
- Sinewave Synthesizer
- Temperature and Pressure Control
- Video Frame Buffer
Nov 29, 2009
Design with microcontrollers:Final year ECE projects
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.
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).
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
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
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
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 : 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.