Ideas to start in SPI?

Greetings Peeps....

I want to start dabbling in SPI, and am wondering where's a good place to start?

My thought is to get a MAX7221 and a couple of 7-seg LEDs a la this playground tut, since that would teach me about a few things at once, as well as being useful.

Or maybe the digital pot example?

Any thoughts?

That'd be a good start. Use basic idea of:

digitalWrite(ssPin, LOW);
digitalWrite(ssPin, HIGH);

to write to all the registers with the default SPI settings. Be sure to have decoupling caps on the MAX7221. D10 must be an output, even if you use a different pin for SS to the MAX part.

I also use direct port manipulation to go even faster:

PORTD = PORTD & B11111011; // example to clear bit 2 PORTD = PORTD | B00000100; // set bit 2

MAX7219 will work the same way and are less expensive, $1.25 at with inexpensive shipping (to the US anyway). Boffin1 is also in SA, you could PM him to see if he has shipping experience with them. I think they have displays also (smaller units) while futurlec over in Australia have larger ones available. Make sure you get common cathode 7-segment displays. 8x8 matrix you can use either common anode or common cathode, they are the same matrix with different pin orientations that you can work around.

Thanks CR....

I've got three suppliers close by, one within 5mins walking distance in fact; I'm sure one of them will have the chip.

That's convenient. 5 minutes only gets me to the parking lot at work, or maybe to the end of my street from home. I do have a dozen of the chips in my workshop upstairs at home tho - I buy some extra bits of stuff when I place orders to have some parts to experiment with.

I've got three suppliers close by....


Supplier #1 doesn't have it (or similar) on their web-site Supplier #2 doesn't have it on their web-site, but it shows a couple of surface mount ones, so I'll email to see exactly what they have Supplier #3 doesn't have a web-site (well, not a real one) and said to me on the phone "What's a digital potentiometer?"

Be sure to have decoupling caps on the MAX7221

I’m pretty sure I should know the answer to this, but what’s the diffs between the 2 capacitor symbols in the playground schematic?

Edit… I found the answer… the one with the white and black is polarised and the white bar is +ve.

So supplementary question… what do I ask for in the shop?- a polarised capacitor?


10uF are usually aluminum electrolytic caps, and polarized. Look like little cans with leads out the bottom. You can get them as non-polarized ceramic surface mount too, probably not what you want here tho. A regular, 10uF, 16V or 25V, would be fine.