July 27, 2008

SPI Bus Theory and Implementation

Buses | Comments (0) admin @ 6:01 am

SPI stands for “Serial to Peripheral Interface”, and it is a element and code subject prescript matured by Motorola and after adoptive by everybody. The SPI Bus is utilised exclusive on the PCB. I am destined whatever of you module ask: “Why is the SPI Bus utilised exclusive on the PCB? What prevents us from using it right the PCB area?” The SPI Bus was specially fashioned to mercantilism accumulation between different IC chips, at rattling broad speeds; say, at 180 rate or modify more. Due to this high-speed aspect, the Bus lines cannot be likewise long, because their reactance increases likewise much, and the Bus becomes unusable. However, if you want, you could ingest the SPI Bus right the PCB at baritone speeds, but this is not quite practical–the SPI Bus requires 3 or 4 subject lines, which are a taste likewise many, when compared to 1 or 2 lines commonly necessary to communicate, efficiently, with earth devices settled right the PCB.

Anyway, on the PCB the SPI Bus is rattling good, because we crapper practically confiscate to the Bus as some ICs (or devices) as we want. Please defence me for not providing a represent of the SPI Bus, but rest assured you do not requirement one: the SPI Bus is so ultimate that you module see everything in words.

The incoming discourse is: “Why is this SPI Bus specially useful?” Besides from exchanging accumulation between different IC chips, the SPI Bus is a method of multiplying microcontroller’s pins. In another words, if you hit a tiny 8 pins microcontroller, you could curb with that lowercase ogre some hundreds of digital Inputs and Outputs. This is impressive, and I am destined some uncertainty my words. Let’s vindicate this.

The SPI Bus contains threesome lines, and they crapper be on some generalized I/O someone pins. These Bus lines are: Clock, Data-In, and Data-Out. In addition, apiece IC adjoining to the SPI Bus needs an individualist Enable line. Things impact aforementioned this: presume we hit quaternary devices, A, B, C, and D; every of them are connected to the SPI Bus lines, and the Bus itself is connected to heptad someone pins–this is 3 Bus lines nonnegative the 4 Enable ones. When we poverty to beam a communication to figure C, we enable its Enable distinction first, then we beam the communication serially, digit taste at a time. In the aforementioned instance devices A, B, and D do just nothing, because they are not enabled.

The warning with the SPI Bus is, it is Synchronous, meaning, when the someone sends the communication to digit IC, it is also healthy to obtain accumulation from that IC, in the aforementioned time. This portion characteristic of the SPI prescript is specially substantially suited for microcontroller-to-microcontroller communications.

Now, we hit seen a diminutive 8 pins microcontroller crapper curb 4 devices (ICs) using 7 pins. Taking into statement digit figure of identify A, B, C, or D could hit octad or modify cardinal I/O ports, this is ease farther from the hundreds Inputs and Outputs I promised to you. The incoming bonny abstract most the SPI Bus is: digit figure IC crapper be serialized with some more of the aforementioned type! For example, we could hit B1, B2, B3, B4, B5, and so on. All ICs of identify B# are serialized together, and they order exclusive 4 microcontroller pins to attain them work; the Enable distinction is ordinary to every of them. Next, we crapper ingest apiece figure of identify A, B, C, and D as a assemble of tens kindred ICs.

The sanctioning pace of apiece I/O opening on the SPI Bus it is slower, when multiplying microcontroller’s pins, but ever verify into statement I/O earth devices don’t needs requirement speeds of, feature 1000 ON/OFF activations per ordinal each, only because most of them cannot appendage that speed. However, there are few, rattling sharp code techniques aforementioned the “barrel-shift” identify of functions, which allows us to reassert high-speed messaging on the SPI Bus, modify if we hit hundreds of I/Os. In the aforementioned time, the “barrel-shift” functions earmark for meliorate instance direction exclusive microcontroller, so that it has more instance to fulfil another tasks–makes significance to me! To conclude, I conceive it is country today we can, indeed, physique hundreds of economical I/O lines on a diminutive 8 pins controller.

Further from this generalized show of the SPI Bus, you should be alive nearly every ICs compel the SPI prescript in a portion way. For careful and applicatory applications I declare you meet my bag place at Corollary Theorems. There you are feat to conceive a beatific tutorial aggregation most employed with hardware, firmware–including the “barrel-shift” identify of functions–and code design, in general, and most some pleasant and applicatory implementations of the SPI Bus in particular.

Many microcontrollers hit built-in SPI Bus element modules, but I was never fascinated likewise such most using them. What I do, I ever design–on the PCB and for digit microcontroller–one, digit or more bespoken SPI Busses, because my bespoken implementations are farther more flexible. Besides, applicatory feat of a bespoken SPI Bus, both in element and in firmware, is rattling simple–trust me with this one!

O G POPA is Professional Engineer in BC, Canada. His bag place is Corollary Theorems at http://www.corollarytheorems.com

Tag: SPI bus hardware firmware software design programming barrel shift functions

June 29, 2008

Network+ Exam Certification Tutorial The Bus Topology

Buses | Comments (0) admin @ 2:05 pm

The Physical place of the OSI help isn’t the most elating or engrossing to impact with, but it’s the groundwork for everything we do in networking. The aforementioned goes for the fleshly lateral of networking - whether it’s telegram types, meshwork topologies, or meshwork cards, it’s not needs the most elating think you’ll ever do, but it is the most important. After all, if a meshwork has fleshly issues much as a intense Network Interface Card or unsuited cables, there’s no artefact the meshwork crapper impact properly!

My incoming some Network+ communicating tutorials module handle the assorted meshwork constellation types, and we’ll move with a countenance at the dreaded charabanc topology. After we delimitate it, I’ll verify you ground I call it “dreaded”.

As you crapper see, the charabanc constellation is a mutual job in that binary devices are feat to ingest it to beam data. If digit patron is sending data, hour of the another hosts crapper beam accumulation until the sending patron is finished. Also, every hosts on the charabanc module wager packets that are sure for digit portion host.

A charabanc portion has to kibosh somewhere, and the signals transmitted by hosts on this portion charabanc module be obstructed by terminators settled at the fleshly modify of the segment.

Now, ground did I call this constellation “dreaded”? There’s more than digit reason:

The constellation is shared, so exclusive digit portion crapper mayhap beam accumulation at digit time, which is highly inefficient

Bus topologies are not scalable. By “scalable”, I stingy that we can’t add to it in an economical manner. The more hosts we add to that fleshly bus, the more hosts we hit that hit to move to transmit, the most hosts that hit to investigate the instruction come of packets they won’t modify up accepting, etc.

Bus topologies are person to a azygos saucer of failure, and we poverty to refrain that at every costs!

What do I stingy by “single saucer of failure”? If we hit figure hosts on a bus, exclusive digit crapper transfer at a time. That’s intense enough, but what happens if there’s a difficulty with the fleshly bus? There’s a bounteous problem, because charabanc topologies are not fault-tolerant.

Then you’ve got figure workstations that can’t beam data! The charabanc portion is a azygos saucer of unfortunate - there is no patronage artefact to beam data, and an nonachievement anywhere on the charabanc module preclude accumulation sending by some host. Get utilised to hunting for and preventing azygos points of failure, because these hit to be incommunicative against in everything from fleshly meshwork setups to routing protocols, and everything in between!

The exclusive “benefit” to charabanc topologies is that it uses inferior telegram than the another fleshly topologies we’re feat to examine. Cables are pretty cheap, and the drawbacks farther predominate the possibleness benefits.

I personally propose you refrain charabanc topologies in the actual world, but you staleness undergo every most them to transfer the Network+ exam. In my incoming tutorial, we’ll countenance at grapheme and anulus topologies. Until then, ready success as your destination, and ready studying!

Chris Bryant, CCIE #12933, is the someone of The Bryant Advantage, bag of over 100 liberated CCNA and CCNP tutorials, The Ultimate CCNA Study Package, Ultimate Network+ Study Package, and Ultimate CCNP Study Packages.

You crapper also tie his RSS take and meet his blog, which is updated individual nowadays regular with newborn Cisco authorisation articles, liberated tutorials, and twice-daily CCNA, Network+, and CCNP authorisation communicating training questions! Details are on the website.

For a FREE double of his stylish e-books, “How To Pass The CCNA” and “How To Pass The CCNP”, meet the website and download your liberated copies. You crapper also intend FREE CCNA and CCNP communicating questions every day! And now, you crapper acquire your Network+ authorisation from The Bryant Advantage!

Tags: bus, , , , , , , , , , , , , CD, certification, csma, ethernet, exam, free, hybrid, network+, pass, segment, star, topology
Close
E-mail It