SPI Bus: Theory and Implementation
SPI stands for Serial to Peripheral Interface, and it is a hardware and firmware communications protocol developed by Motorola and later adopted by everybody. The SPI Bus is used only on the PCB. I am certain some of you will ask: Why is the SPI Bus used only on the PCB? What prevents us from using it outside the PCB area? The SPI Bus was specially designed to exchange data between various IC chips, at very high speeds; say, at 180 MHz or even more. Due to this high-speed aspect, the Bus lines cannot be too long, because their reactance increases too much, and the Bus becomes unusable. However, if you want, you could use the SPI Bus outside the PCB at low speeds, but this is not quite practical--the SPI Bus requires 3 or 4 communications lines, which are a bit too many, when compared to 1 or 2 lines usually needed to communicate, efficiently, with field devices located outside the PCB.
Anyway, on the PCB the SPI Bus is very good, because we can practically attach to the Bus as many ICs (or devices) as we want. Please excuse me for not providing a picture of the SPI Bus, but rest assured you do not need one: the SPI Bus is so simple that you will understand everything in words.
The next question is: Why is this SPI Bus particularly useful? Besides from exchanging data between various IC chips, the SPI Bus is a method of multiplying microcontrollers pins. In other words, if you have a tiny 8 pins microcontroller, you could control with that little monster few hundreds of digital Inputs and Outputs. This is impressive, and I am certain many doubt my words. Lets explain this.
The SPI Bus contains three lines, and they can be on any general I/O controller pins. These Bus lines are: Clock, Data-In, and Data-Out. In addition, each IC connected to the SPI Bus needs an individual Enable line. Things work like this: suppose we have four devices, A, B, C, and D; all of them are wired to the SPI Bus lines, and the Bus itself is wired to seven controller pins--this is 3 Bus lines plus the 4 Enable ones. When we want to send a message to device C, we enable its Enable line first, then we send the message serially, one bit at a time. In the same time devices A, B, and D do exactly nothing, because they are not enabled.
The beauty with the SPI Bus is, it is Synchronous, meaning, when the controller sends the message to one IC, it is also able to receive data from that IC, in the same time. This particular aspect of the SPI protocol is particularly well suited for microcontroller-to-microcontroller communications.
Now, we have seen a small 8 pins microcontroller can control 4 devices (ICs) using 7 pins. Taking into account one device of type A, B, C, or D could have eight or even sixteen I/O ports, this is still far from the hundreds Inputs and Outputs I promised to you. The next beautiful thing about the SPI Bus is: one device IC can be serialized with many more of the same type! For example, we could have B1, B2, B3, B4, B5, and so on. All ICs of type B# are serialized together, and they require only 4 microcontroller pins to make them work; the Enable line is common to all of them. Next, we can use each device of type A, B, C, and D as a group of tens similar ICs.
The enabling speed of each I/O port on the SPI Bus it is slower, when multiplying microcontrollers pins, but always take into account I/O field devices dont necessarily need speeds of, say 1000 ON/OFF activations per second each, simply because most of them cannot handle that speed. However, there are few, very smart firmware techniques like the barrel-shift type of functions, which allows us to maintain high-speed messaging on the SPI Bus, even if we have hundreds of I/Os. In the same time, the barrel-shift functions allow for better time management inside microcontroller, so that it has more time to execute other tasks--makes sense to me! To conclude, I believe it is clear now we can, indeed, build hundreds of efficient I/O lines on a small 8 pins controller.
Further from this general presentation of the SPI Bus, you should be aware almost all ICs implement the SPI protocol in a particular way. For detailed and practical applications I suggest you visit my home site at Corollary Theorems. There you are going to discover a good tutorial book about working with hardware, firmware--including the barrel-shift type of functions--and software design, in general, and about few nice and practical implementations of the SPI Bus in particular.
Many microcontrollers have built-in SPI Bus hardware modules, but I was never interested too much about using them. What I do, I always design--on the PCB and for one microcontroller--one, two or more custom SPI Busses, because my custom implementations are far more flexible. Besides, practical implementation of a custom SPI Bus, both in hardware and in firmware, is really simple--trust me with this one!
O G POPA is Professional Engineer in BC, Canada. His home site is Corollary Theorems at http://www.corollarytheorems.com
Premature Eyaculation TreatmentPremature Ejaculation Fixes
What Penis Enlargement Pills Work
Penis Exercizes
Erection Help
Do Penis Exercise Work
Penis Stretcher Cheap
Pills For Bigger Hips
Exercises How To Enlarge My Penis Without Pills
Penis Stretching
Cfnm Measuring
How To Make Front Penis Big
Increase Soft Penis Size
Penis Enlargment Naturally
Impotence Natural Treatment
Penis Erection Video
Natural Penis Enlarge Methods
Natural Penis Growth From Home
Their Sexual Performance
Penis Growth Excersizes
Effective Treatment For Erectile Dysfunction Vacuum Device
Penis Exercise Growth
How To Increase Penis Size Naturally
Penis Enlargerment Pills
Fix Bent Penis
Penis Enlarger Workout
Sexual Dysfunction Does
Average Penis Size
Cock Ball Stretching
How To Correctly Measure A Penis
Enhancement Libido Male
Penile Balloning Method
Tip On Preventing Premature Ejaculation
Exercising Your Penis
Penis Enlargement Photos
Arm Length And Penis Size
How To Make Penis Larger Harder
Best Thing For Premature Ejaculation
Tips To A Larger Penis
Penis Enlargment Tools Drugs Products
Big Penis Enlargement
Ejaculation Fda Premature
Penis Enlargement Ingredient
Sizgenetics Reviews
Top Rated Penis Elargment Pills
Adult Male Enhancment
Male Enhancement Products In Canada
Discount Penis Enlargement Pill
Impotence Reason
Increase The Size Of My Penis Through Exercise
How To Enlarge Your Penis Instructional Video
Fixing A Bent Penis
How To Get A Bigger Penis Using Pills
Penis Jelq
How To Make A Penis Thicker An Harder
Cream For Erectile Dysfunction
Enlarge Penis Video
Herbal Remedies For Men
Ejaculation Premature Stop Ways
Ancient Penis Techniques
Penis Enlargement Photos
Erectile Dysfunction Articles
How To Make Your Penis Growth Without Increase Blood To It
Enlarge Penis Girth
Enlarge Penis Health
Hard Erection On Demand
Best Male With Big Penis
Jelqing Workout
Natural Erection Enhancement
Lower My Libido
Pennis Pill
Penis Enlarge Tips
Increase Sperm Production
Tips How To Get A Longer Penis
Growth Penis Pill Work
Natural Penile Enlargement
Big Enlargement Penis
Penis Enlargement Tips And Exercises
Fastest Penis Enlargement Pill
Best Way Increase Penis Size
How To End Premature Ejaculation
Semen Increasing Medicine
Dysfunction New Sexual York
Impotence Causes
Penis Enlargement Before And After Results
Male Stamina
Enhancement Penis Pill
Penis Size Want Woman
Ancient Penis Exercises
Male Health Penis Information
Penis Enlargement Pills Have Side Effects
Chicago Penis Enhancement Pills
Penis Enlargement Pills Ingredients
Penis Enlargement Articles
Penis Enlargement Site
Enhancement Male Patch
Jelqing Info
How Do You Make Your Dick Larger Naturally
Penis Lengthening Streching
Premature Ejaculation Advice
Naturally Making Your Penis Bigger
Impotency Male Pill
How To Do Penis Enlargment Exersize
Enhancement Male Rating
Sexual Performance Or
Remedies For Erectile Dysfunction
Erectile Dysfunction Impotence
Jelq Instructions
Herbal Male Enhancements
Herbs For Male Enhancement
Penis Stretcher Cheap
Dealing Impotence
Erection Drug
Penis Patch Newsweek
Mild Sexual Dysfunction
How Can I Enlarge My Penis
Things That Make Penis Bigger
Impotence Definition
Erectile Dysfunction Meds Cheap
Ejaculation Premature Prevent Ways
Can A Penis Get Bigger Naturally
Extra Male Enhancement
Penis Size Calculator
Male Enhance
More Semen Volume
Penile Enlargment Pills
Make Your Penis Bigger Uk
Natural Way To Enhance Penis Growth
New Impotence Treatment
Make Your Dick Bigger
How To Get Your Penis Bigger Naturally
Increase Size Of Your Penis
Penis Enlargement Permanent Pill
Books For Penis Exercises
Arab Penis Enlargement Techniques
Increase Your Penis Size Without Drugs
Penis Enlargement Review
Dick Enlargement Excersices
Penis Enlargement Natural
Average Male Penis Size
Penis Length Calculator
Cock Size Issues
Traction Penis Enlargement
How To Make You Penis Thick
Natural Erectile Dysfunction Remedy
Jelq Exercises Milking
Natural Penis Enlargement Methods
Make Your Penis Longer
Penile Lengthening
How To Naturally Make You Penis Bigger
Exercise Technique To Increase Your Penis
Articles For Penis Enlargement
Natural Ways To Grow Penis
Penis Enlargement Pill Comparison
Video Jelqing
Penis Enlargment Information
Methods Of Controlling Premature Ejaculation
How To Make Penis Big Naturally
How To Make Your Penis Bigger Without Products
How To Enlarge The Penis Without Pills
Enlarge Penis Naturally
Tips On How To Enlarge Your Penis
How Do I Use My Hand To Make My Penis Longer
Erection Enlargements
Naturally Make Your Penis Bigger
Real Penis Growth Pills
Enhancing Penis
Whats The Best Penis Enlargement
Male Enhancement Vitamins
Increase Ejaculation Without Pills
How To Measure The Length Of Your Penis
How To Make Your Penis Bigger Natuarally
Measuring Penis
Male Penis Enlargement Pill
Penis Enlargement Injection
Add Inches Workouts
Erectile Dysfunction Curvature
Male Enhancement Patch
Buy Herbal Virility
How To Get Your Penis Bigger Natural
Erectile Dysfunction Therapies
Permanent Growth From Male Enhancement Pills
Penis Enlargement Exercises By Hand
Sexual Dysfunction Detected
How To Make Ur Penis Naturally Thicker
Permanent Penis Enlargement Penis
Best Pills For Penis Enlargment
Penis Enlargement Steroid
Most Sexual Dysfunction
How To Grow A Larger Penis Without Supplements
Penis Enlargement Info
New Male Enhancement Drugs
Basic Jelq
Jelq Video
How Make Penis Bigger
Increase Male Sex Drive
Dick Enlarge
Penis Size Race
Penis Size And Women
Best Methods For Enlargement
Erectile Dysfunction Causes Erectile Dysfunction
Facts About Penis Pills
Girth Increasing Penis
Hanging Device For Penis Enlargement
Maintaining Control During Ejaculation
Improve Male Sex Drive
Male Libido Falls
Enlargement Penis Pill Review Top
Enlargement Pill For The Penis
Cure For Premature Ejaculation
How To Get A Bigger Penis Without Pills
Enlargement Herbal Penile
Approved Penis Enlargement Pills
New Male Enhancement Drugs
Curved Penis Cure
Exercizes To Increase Penis Size
Buy Something To Make My Dick Bigger
How To Make My Penis Larger
Penis Growth Devices
How To Have Penis For Longer Time Without Any Pills
Review Rating Penis Enlargement Pills
Enlargement Penis Patch
Penis Excersizes
How Do I Make My Penis Bigger With Exersise
Secrets On How To Make Penis Longer
Penis Enlargement Operation
Enlargement Fact Penis
Avg Penis Size
Increase Semen Production
Manually Increase Penis Size
Penis Enlargement Pill Australia
Ejaculation Control Manual
Erect Penis Diagram For Health
Cock Size Penis Size Woman Want
Penis Exercises To Make It Bigger
How To Increase Penis Size Without Taking Pills
Get A Bigger Penis Excerise
How To Grow Penis Size
Penis Enlargment Workout
Man Health Penis
How To Increase Male Stamina
Best Products To Increase Blood Flow To The Penis
Testosterone Deficiency And Male Libido
Exercise To Get Your Penis Long Fast
Penis Workout
Sexual Performance
Penis Nutrition To Increase The Amount Of Ejaculate
Averge Penis Size
How To Make Your Penis Bigger Yourself
Good Jelqing
Natural Way To Stop Premature Ejaculation
Strech My Penis
Buy Erectile Dysfunction Pills
Best Penis Enlargment Pills
Big Als Natural Penis Enhancement
Dank Herbal Virility
How To Make Your Penis Grow No Pills
Extra Penile Enhancement
How To Get Large Penis Naturally
Dysfunction Erectile Erection
Enlarge Penis Without Pills
Grow Larger Penis
Maximum Sexual Performance
Make Your Penis Muscles Bigger
Www Penis Enlargement
Are There Any Fda Approved Penis Enlargement Pills
Mens Penis Enlargement Drug
Techniques To Prevent Premature Ejaculation
Supplements That Make Your Dick Grow
Penis Pills That Make Big Veins
Prevent Sexual Dysfunction
How To Grow Penis Bigger At Home
Penis Enlargement Without Pills
Best Penis Enlargment Pills
Penis Size Pictures
Is There A Way To Naturally Increase Your Penis Size
Make Penis Bigger Exercise
Premature Ejaculation Causes Prevention
Most Effective Penis Enlargement Pills
Male Enhancer
Penis Growth Pill Rankings
Penis Enlargment Procedures
Stretch Your Penis At Home
How To Produce More Cum
Thick Penis Exercise
Penile Tissue Expander
Fatter Penis Enlargement
Number 1 Penis Enlargement Pills
Penis Enlargement Excersizes
Penis Enlargment Tecniques
Erectile Dysfunction Medicine
Penius Enhancer
Penis Erection Exercises
Increase Penis Size Without Pills
Man Premature Ejaculation
Thick Penis Exercise
Penis Mens
A Way To Get A Bigger Dick With Out Pills
Male Enhancements For Prematureejectulations
Best Penis Growth Pill
Male Enhancement Forum
How To Make Penis Larger Without Pill
Dysfunction Erectile Natural Treatment
Big Can Get Penis
How To Naturally Increase Your Penis Length
How To Keep The Penis Hard
Natural Male Enlargement
Manifest Sexual Dysfunction
Understand Sexual Dysfunction
Premature Ejaculation Herbal
How To Increase Your Penile Size
Herbal Penis Enlargment
Double Length Of Penis
Rate Penis Enlargement Pills
Increase Pennis Size
How To Naturally Increase Penis
Enhance Penis Size
Penis Power Enlarge Patches Results Views
Enlargement Penis Pill Study
How To Increase Size Of Your Penis
Adult Products
The Best Penis Enlargement Pill
Inability To Keep An Erection
Kann Herbal Virility
Excersizes To Enlarge Penis
Penis Enlargement Herbs
Hanging Weights To Penis
Get A Bigger Penis In 72 Hours
Ways To Make Your Penis Get Bigger Naturally
Male Enhancements Herbs
How To Increase The Size Of Penis Without Pills
Expend Penis Enlargment Pills
How To Enlarge Penis Size
Erectile Dysfunction Support
Penis Growth By Yourself
Top Rated Penis Pumps
Does Cock Size Matter
Ways To Increase Penis Size Without Pills
How To Make Your Penis Larger Naturally
Penis Enlargement Pills India
Proven Supplements For Erections
Diagrams Of Penis Growth During Puberty
How To Increase The Thickness Of A Penis
Home Remedies To Make Your Penis Larger
Natural Penis Enhancer
Are Penis Enlargement Pills Work
Penis Pump
Does Jelqing
Produce More Semen Amplify
Penis Extension Stretching Products
How To Get Your Dick Bigger
Best Penis Exercises
Dysfunction Erectile Natural Treatment
Penis Health Grow
Arbeitet Herbal Virility
Erection Harder
Homeopathy Medicine For Enlargement Penis
Tips On Making Your Penis Bigger And Stronger
Jelqing Help
Increase Penis Size Easily Without Pills
Bigger Penis Techniques Without Pills
Penis Size Increase
How To Have Bigger Erections
How Do Get A Bigger Penis Naturally
How Do Get A Bigger Penis Naturally
Cause Sexual Dysfunction
Penis Growth And Development
How To Make My Penis Larger With Exercises
Natural Enhancement Penis Enlargement
How Too Get Larger Penis
Way To Make Penis Larger
Health Mens Health Penis
Pennis Enlarge
Erect Penis Enlargement
Stretch Your Penis At Home
Most Sexual Dysfunction
How To Create More Semen
How To Enlarge The Penis
Enlarge Penis Pill Without
Review Penis Pills
Male Libido They
Natural Penis Enhancements
Enhancement Expand Male
Penis Erection Device
Penis Growth Info
Enlarge My Penis
Penile Enhancements
Disfunction Erection
Does Penile Enlargement Exist
Penile Lengthening Procedure
Pills To Enlarge Your Penis
Physical Ways To Enlarge Your Penis
Impotence Natural Treatment
Herbs That Increase Penis Size
Countiue Jelqing
Make Stronger Penis
Enlarging Penis Workouts
What Is The Best Penis Enlarger
How To Get A Monster Penis
How To Increase Width Of Penis