Whats the difference between RS232, USART, UART, Serial, USB, CAN, SPI, I2C, JTAG, and 1-Wire protocols..?

First of all, lets clear up some confusion: **They’re not all protocols.** UART and USART are hardware modules that let you implement other serial protocols.

USART modules (Universal synchronous and asynchronous **receiver-transmitter**) are exactly as the name implies – its a module that Transmits and Receives serial data, so you don’t have to bit bang every time you want to implement a common serial protocol.

UART modules (Universal asynchronous **receiver-transmitter**) are exactly the same of USART modules, except they can’t handle* Asynchronous* (clockless) serial protocols.

As seen in the diagram above, serial communications broadly fall into one of two categories: Synchronous and Asynchronous. Here’s a table broadly classifying the most common serial protocols. Does this mean that all the protocols below implement a USART/UART module on an embedded system? Yes and No. You could probably implement most of the common protocols on a UART/USART module, but most embedded systems already come with specialized hardware (peripheral) to support the most common serial protocols, such as I2C, JTAG, USB, Etc, so you don’t have to worry about all the nitty-gritty of implementing the protocol, (as you would if you were to bit-bang the protocol), and they can run independently in the background on your device, so you’re application is free to continue processing until the peripheral needs more data.

How’s that for 10,000 Ft? If you have more questions, leave them in the comments below, with “serial” in the message (so i can filter them among the spam).

Cereal, from 10,000 ft..

]]>I never understood Eigenvectors. They were a piece of mathematical magic my sophomore year, and would have remained so if two of my classes this quarter had not queried my understanding of them.

Lets start with Linear Transforms

A linear transform or linear mapping simply takes in a vector, and translates it by some function. It can also map vectors between different spaces (R2 -> R3, etc) but lets keep it simple to start with.

Suppose we have a vector

Plotting it in Matlab would look something like:

figure plotVector([1;1]);

But what if we wanted to rotate that same vector 90° CCW? That’s where linear transformations come into play. Suppose (referencing Wikipedia) we knew that multiplying some matrix, A by our vector, would do precisely that.

Verification:

u = [1;1]; A = [ 0 -1; 1 0]; v = A*u >> v = [-1; 1] plotVector([u v]);

Hooray!

Lets try something a little more interesting – with three random vectors:

u = randi(10, [2,3]); rng(100); plotVector(u); waitforbuttonpress; %Rotate 90 CCW A = [0 -1; 1 0]; v = A*u; rng(100); plotVector(v);

Which results in vectors

Some linear transformations aren’t quite as predictable. In fact, if we arbitrarily chose a linear transformation such as the resulting transformation is different for each vector! Lets see what this means:

The small vector in the middle rotating CCW is the input vector, u. The larger vector on the outside is the mapped vector v = A*u. As you can see, the transformation depends on the input vector.

There are four important positions (vectors) in this animation – They occur when the *input* vector aligns with the *output* vector (either directly or in opposite potions).

These special positions (vectors) are called Eigenvectors! Also, notice the proportional difference in size between the input and output vectors; this is the Eigenvalue of each Eigenvector. Watch the animation again and notice where they show up. (Cheat sheet)

Now that we have an intuitive idea of what Eigenvectors and Eigenvalues are, lets look at the formal definition.

When any vector whose transformed output is a scalar multiple of the input, you have an Eigenvector. The scalar multiple is called the Eigenvalue. Simple, really.

Now there’s one more important thing to notice here – the eigenvalues / eigenvectors aren’t the source of the transformation matrix. Instead, the transformation matrix (or really any matrix – depending on how you look at it) is what determines the eigenvalues and eigenvectors. That is, they are properties of the matrix. *Blue* and *soft* could be the properties of a ball, but blue and soft don’t define a ball.

As for the math – ill leave that up to you. If you have any simple practical applications of eigenvalues / eigenvectors, i’d love to hear about them. Leave them in the comments below!

Matlab functions: LinearTransformation

]]>For our introduction to digital logic class (CPE 133 – ie. VHDL) we had to make a final project to demonstrate the last day of class. My lab partner and I decided to make a digital clock, which we called E*lRelojDeAusLey* or The Clock of Aus[tin and Stan]ley. I only managed to find one picture, but if I run into it again, i’ll be sure to take more.

Enjoy!

LED Matrix Addressing. Blue columns were originally going to be part of the design so that messages could be scrolled across the display, however available IO on the board had different ideas in mind.

]]>

When I started thinking about making a blog, the engineer in me had the intention of making a blog from the ground up. *After all,* I know enough PHP, databases seem simple enough; why not use it as an excuse to get more familiar with web development? Besides, who wants their blog to be ‘just another WordPress site’?

Short answer: I’m reinventing the wheel.

Long answer: I actually did start to develop a new blogging application. I used CodeIgniter on a Vagrant deployed development environment, and wrote a small application that would store and retrieve posts. But good isn’t good enough. I wanted a WYSIWYG editor. Done. I needed a dynamic menu. Done.. well, sort of.. I also wanted it to be mobile friendly (*responsive – * to borrow the buzzword). Hello H5BP and Bootstrap. At this point, my little program isn’t so simple. In fact, it looks like any other blogging platform; except that mine doesn’t look good (I’m an engineer, not an artist – but I still require perfection). Besides, I have other projects I want to work on that will teach me the same thing. Solution: WordPress.