SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By xl97
#182291
I have a Pro Micro board..

I realized that the SS pin on the SPI bus is NOT broken out to any I/O pins for us to use...

I find it odd that a board would be released that wont support any SPI devices?.. So there must be a way around this... no?

How can you define or use a different pin as the SS pin when using a Pro Micro as the base?

(for full disclosure, I want to use this with the USB Host Mini Shield from Circuits @ Home)

The (mini) shield was designed to be used with a Pro Mini...

The Pro Micro is basically a Leonardo, in the same footprint/size of the Pro Mini...(with the exception of the RESET pin is not in the same location.. not sure why this done?).. and the SPI bus is only partially broken out to the I/O pins

MOSI - 16
MISO - 14
SCLK - 15

SS pin is pin#17, but is not broken out.. and is hardcoded to the RX, yellow on-board led?


How do you overcome this?

Can you delcare/set pin #17 as an output.. or enable internal pull-up resistor?.. and then (somewhere) re-define the SS pin? (in the USB Host library I'm guessing this step)

Circuits @ Home says.. they are not familiar with the Pro Micro, so have not been any help.

I figured, I need to come to the source then.

Thanks!
-xl
User avatar
By Ross Robotics
#182294
Take a look at this thread and see if you can resolve your issue.
By xl97
#182304
Thanks...

I'll give it a better once over in a few minutes (now that I'm at work)


I also found this thread:
https://forum.sparkfun.com/viewtopic.php?f=32&t=34873

Its a bit over my head.. (as I dont really mess with library code much, if at all.)


This is the part I'm not really understanding:

#if defined(BOARD_PRO_MICRO) && defined(__AVR_ATmega32U4__)
// SparkFun Pro Micro pin numbers
// https://www.sparkfun.com/products/10999
#define P0 Pd2
#define P1 Pd3
#define P2 Pd1
#define P3 Pd0
#define P4 Pd4
#define P5 Pc6
#define P6 Pd7
#define P7 Pe6
#define P8 Pb4
#define P9 Pb5
#define P10 Pb6
#define P11 Pb2
#define P12 Pb3
#define P13 Pb1
#define P14 Pf7
#define P15 Pf6
#define P16 Pf5
#define P17 Pf4
#endif // SparkFun Pro Micro

I keep thinking/feeling I'm close!!! haha..

But I'm not clear what is re-defining the SS pin.. and to what?

example:
#define P17 Pf4

is P17 the pin# on the board? (17 is the SS pin on the Pro Micro).. and what is Pf4?

Thanks
-xl
By xl97
#182336
Hi codlink-

Any thoughts on the thread I linked to?

As I dont really mess with editing the library code much at all...

I'm not really clear on the proper approach?

(I dont want to 'green wire' anything, cut traces or solder wires..etc)

So the difference between the two (from what I can tell at lest)..

is either mod the USB Host library?
-or-
(and I think this is what the thread you linked is about) mod the Arduino IDE files?)

Is this summary of both approaches correct?

Would I need to do both? Or just the IDE mod? If going the IDE mod route.. this would help/solve any issues when other SPI devices are used? (MAX chips...etc)?

(really confused why they would negate the use of SPI devices with the Pro Micro?)

(I also find it odd.. that once you mention Sparkfun.. other forums refuse to help?).. its a shame, really.

Thanks!
-xl