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 microcontroller’s 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. Let’s 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 microcontroller’s pins, but always take into account I/O field devices don’t 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!

IBM Develops a New Graphene-Based IC With Performances on Par With Current Silicon Technology

IBM has developed what is reported to be one of the fastest graphene-based integrated circuits (IC) to date, with an overall performance that is up to 10,000 times better compared to similar devices developed previously.

IBM built the graphene-based IC as a radio frequency receiver that can perform signal amplification, filtering, and mixing. The circuit was able to process text messages without any distortion in a series of tests performed by the IBM research team.

One of the first examples of the use of graphene in electronic applications took place in 2010 when Big Blue researchers engineered a graphene device with a band gap large enough to be used in infrared (IR) detectors and emitters. This development was followed up a year later when IBM developed a graphene transistor that can operate with frequencies up to 100 GHz.

After another six months, IBM developed the first graphene-based IC circuit, which was the predecessor of the model discussed in this article. The precursor circuit served as a basic radio component called as broadband radio-frequency mixer, which processes signals by finding the difference between two high-frequency wavelengths.

Supratik Guha, director of physical sciences at IBM research, in a recent press conference said that “this is the first time that someone has shown graphene devices and circuits to perform modern wireless communication functions which so far have only been seen in silicon ICs”.

The new graphene-based ICs were also able to overcome problems such as the degradation of transistor performance with time. The solution used to solve the issue was a new manufacturing method where graphene is added in a later stage of the process in order to prevent being damaged. However, the manufacturing method developed by the IBM team still requires an expensive process to produce the high-quality graphene needed. New methods of producing high-quality graphene at lower costs are under development.

In spite of all the doubts about the potential of graphene to yield benefits in electronic applications due to the lack of an inherent band gap, IBM has invested heavily in research and the latest results show that new applications in smartphones and gadgets may soon become a reality.

Shu-Jen Han of IBM Research described the impact of this research in an IBM blog, saying that the development of the graphene-based radio frequency receivers has the potential to enhance the communication speed of wireless devices and pave the way toward new applications in consumer electronics with performances beyond what is possible to achieve with current silicon technology.

Han stated that the integration of graphene radio frequency (RF) devices into current low-cost silicon technology platforms could also spur a new wave of pervasive wireless communication, which in turn would allow the development of smart sensors, RFID tags, and similar devices to send data signals at significant distances.

The so-called “Internet-of-things”, a concept coined by Kevin Ashton back in the late 90s, would rely heavily on smart sensors and RFIDs to create an environment where objects and people would interact in an intelligent way using an internet-like backbone.

Communicating Better Productivity In Four Simple Steps

You’ve been sent to work overseas as an executive or manager. You will be responsible for the success or failure of the organization’s regional office. It is, essentially all on your shoulders. You will not be able to receive more funds, employees or any type of equipment of any type. How will you succeed, and succeed big.

Traditionally, the common answer is to push, push, threaten and get the last drop of energy from your staff. You could add intimidate as an enforcer of those actions. Will it work?

The answer is has actually been, yes, but for a very, very short while. After that the resentment, fear and general discontent will take over and you will lose people and your talent will disappear.

But this scenario, not uncommon by any means, is ripe for the most elementary solution that is begging to be heard; increase productivity.

Increasing productivity is not done by divine intervention or some magic wand, it is done by managers. In fact, it is there job. Productivity are managed by the resources that are capital, physical assets, time and brain power.

In capital, one must ask, ‘Where is our money?’. It is crucial to isolate measure and identify where the liquid assets are and should be. To concentrate the organization’s resources in productive areas is key. You may have to move and adjust the existing capital. To be clear on this point, helps lead to the next point.

Are we using our physical assets in the best way possible? Universities, for example have many large classrooms that are not in use 90% of the time. Can those rooms be used and help the productivity of the institutions? Absolutely, and that is what many of them have done to increase productivity.

Time must also be carefully scrutinized to help measure and mark where the organization needs to be at the present moment. Many managers say they spend their days doing things that when they keep an agenda and actually see in retrospect what they’ve been doing, they are shocked to see how much time they waste. Time must be carefully spent on productive tasks and making sure that the organization is following its purpose and is results oriented.

The final element is using the talents of your staff to the fullest. They need to be working where their strengths are. If not, frustration, delays and ineffectiveness are in control. To know these things, you must know your staff; talk with them, ask them and be a resource for them. It cannot be overemphasized that we are in such a dynamic era that changes can happen (internal and external) at anytime and you must be prepared to be productive.

This builds a more focused organization while it prepares them for unforeseen events that can come at any moment. Each piece of the productivity puzzle depends on the other and if you can’t get more to help you, then get more from what you have. You and your staff will have more loyalty, dedication and energy if you do.