Loading...
Pages: [1]   Go Down
Author Topic: Ideas to start in SPI?  (Read 273 times)
0 Members and 1 Guest are viewing this topic.
Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: March 04, 2013, 12:54:09 pm by JimboZA » Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 17031
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That'd be a good start.
Use basic idea of:
Code:
digitalWrite(ssPin, LOW);
SPI.transfer(MAX7221register);
SPI.transfer(dataByte);
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 www.taydaelectronics.com 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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 17031
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

And....

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?"
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
« Last Edit: March 08, 2013, 03:51:38 am by JimboZA » Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 269
Posts: 17031
Available for Design & Build services
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Pages: [1]   Go Up
Print
 
Jump to: