Abdellazizhammami / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Add support for more than one SPI bus #774

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What change would like to see?
Atmega 1280s, 2560s support multiple SPI buses and it would be very handy to be 
able to use them.

Why?
I'm on the arducopter team and in the APM2 hardware we use one SPI bus for the 
dataflash, and another for the MPU6000 (sensor that provides 3d accelerometer, 
gyro and magnetometer) and barometer.  

Would this cause any incompatibilities with previous versions?  If so, how can 
these be mitigated?
Yes, it might in that I believe you lose a serial port if you use it as an SPI. 
 This means we might need to be smart about whether one of the serial ports 
(Serial3?) or SPI2 exists because both couldn't be used at the same time.

Original issue reported on code.google.com by rmackay...@gmail.com on 5 Jan 2012 at 7:11

GoogleCodeExporter commented 8 years ago
If you don't call Serial3.begin(), the pins should be free for other purposes, 
including SPI.  So I think we could have Serial3 and SPI1 objects, and just 
require you to call begin() on whichever of the two you want to use.  Do you 
want to submit a patch for this?

Original comment by dmel...@gmail.com on 9 Jan 2012 at 8:30

GoogleCodeExporter commented 8 years ago
I would also love to see this happen.  I am in dire need of being able to use 
both the ethernet shield and another SPI device at the same time.  From what 
I've heard, the chip on the Arduino ethernet shield doesn't like to let go of 
the SPI bus even when it is no longer selected, which leads to issues.  

Thanks!

Chris

Original comment by chriskon...@gmail.com on 3 Feb 2012 at 2:14