Go Down

Topic: [SOLVED] Due and SPI library and SPI pins? (Read 6 times) previous topic - next topic

Graynomad

Quote
Did you know you can configure them to be addresses that feed a built-in MUX allowing you to manage up to 15 or 16 total SPI devices

Yes, either internally MUXd for 4 devices or externally MUXd for 15 devices.

Quote
I'd like to find a way to use the CS lead that actually isn't connected to any of the Arduino pins

Ummm, using telepathy?

If you only have a single device you shouldn't need the SC pin at all unless it's used internally for some reason. I don't know what chip it is so can't tell.

Quote
Timer 1 channel 0 must be used with SPI somehow because when I use that timer to manage another function it completely disables SPI.

There should be no relationship between the two, I suspect a bug in either your code or the libraries.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

exedor

Quote
Yes, either internally MUXd for 4 devices or externally MUXd for 15 devices.

Thanks for the correction, I mean external not built-in.

Quote

Quote
I'd like to find a way to use the CS lead that actually isn't connected to any of the Arduino pins

Ummm, using telepathy?


Funny, but no.  Come on man, give me more credit than that :)

As we've covered, the most convenient way of doing this managing the CS pin myself.  Ok, done.  I'm already there but using the SPI library configures by default to use CS pin connected to pin 52.  I know there are four but as far as I can tell there are only 3 connected on the Due (4, 10, and 52.)  All of which I'm using for other purposes (or was until this happened.)  So I want to use the 4th CS pin with SPI precisely so that it is NOT being used and all of the others will be available for me to use with other things.  As it is now, I've had to remove pin 52 from use...disappointing.  Since I'm already using pin 10 to manage CS myself, I do not want my transfers using SPI library to mess with any of the other exposed pins on the Due so when I say I want to use it, I mean that I want it's use to be ignored since I can't seem to get away without using at least *something* based on the way the hardware and SPI library for the Due are implemented.

Quote

There should be no relationship between the two, I suspect a bug in either your code or the libraries.

My bet is on the libraries and no it isn't because I think my code is all Rosy just because it's my code.  It's because I've spent enough time troubleshooting this and studying the data sheet that I have good supporting evidence.

cmaglie

@exedor

this is probably a bug in the SPI library.
May you try to change the file:

hardware/arduino/sam/variants/arduino_due_x/variant.h

and replace the following (should be around line 87):

Code: [Select]

#define BOARD_SPI_DEFAULT_SS BOARD_SPI_SS2


with:

Code: [Select]

#define BOARD_SPI_DEFAULT_SS BOARD_SPI_SS3


and see if this solve your problem?
C.

exedor

AWESOME!  Yes, that solved the problem and worked GREAT!  Thank you!!

Go Up