Reference.DueExtendedSPI History

Hide minor edits - Show changes to markup

October 20, 2012, at 01:57 PM by Tom Igoe -
Changed line 41 from:
  byte res = SPI.transfer(4, 0xFF);
to:
  byte response = SPI.transfer(4, 0xFF);
Changed lines 44-45 from:

In the above, “0xFF” is sent to the SPI device on pin 4 and the data coming from MISO is saved inside the variable res. The chip selection is handled automatically by the SPI controller, the transfer command implies the following:

to:

In the above, “0xFF” is sent to the SPI device on pin 4 and the data coming from MISO is saved inside the variable response. The chip selection is handled automatically by the SPI controller, the transfer command implies the following:

Changed lines 57-60 from:

//transfer 0x00 to the device on pin 10, store byte received in res1, keep the chip selected byte res1 = SPI.transfer(10, 0×00, SPI_CONTINUE); //transfer 0x00 to the device on pin 10, store byte received in res1, deselect the chip byte res2 = SPI.transfer(10, 0×00);

to:

//transfer 0x00 to the device on pin 10, store byte received in response1, keep the chip selected byte response1 = SPI.transfer(10, 0×00, SPI_CONTINUE); //transfer 0x00 to the device on pin 10, store byte received in response2, deselect the chip byte response2 = SPI.transfer(10, 0×00);

October 19, 2012, at 10:19 PM by Scott Fitzgerald -
Changed lines 44-45 from:

In the above, “FF” is sent to the SPI device on pin 4 and the data coming from MISO is saved inside the variable res. The chip selection is handled automatically by the SPI controller, the transfer command implies the following:

to:

In the above, “0xFF” is sent to the SPI device on pin 4 and the data coming from MISO is saved inside the variable res. The chip selection is handled automatically by the SPI controller, the transfer command implies the following:

October 19, 2012, at 10:05 PM by Scott Fitzgerald -
Added lines 38-64:
Changed lines 67-68 from:

NB : once SPI.begin() is called, the declared pin will not be available as a general purpose I/O pin

to:

NB : once SPI.begin() is called, the declared pin will not be available as a general purpose I/O pin
\\

October 19, 2012, at 09:43 PM by Scott Fitzgerald -
Changed lines 3-6 from:

On the Arduino Due, it is possible for the SAM3X to automatically handle the chip selection between multiple devices sharing the SPI bus. Each device may have also different attribues such as speed and datamode.

The extended API can only be used on pins 4, 10, and 52:

to:

On the Arduino Due, the SAM3X has advanced SPI capabilities. It is possible to use these extended methods, or the AVR-based ones.

The extended API can use pins 4, 10, and 52 for CS.

Changed lines 8-11 from:

You must specify each pin you wish to use as CS for the SPI devices.

In the following example, there are two devices that share the SPI MISO, MOSI, and SCK pins, and each device runs at different clock speed. One device is attached to pin 4, the other to pin 10.

to:

You must specify each pin you wish to use as CS for the SPI devices.

It is possible for the Due to automatically handle the chip selection between multiple devices sharing the SPI bus. Each device may have also different attribues such as speed and datamode.

If using multiple devices with different CS pins, you'll need to declare those pins in setup(). In the following example, there are two devices that share the SPI MISO, MOSI, and SCK pins. One device CS is attached to pin 4, the other to pin 10.

Changed line 16 from:
  // initialize the bus for the device on pin 4
to:
  // initialize the bus for a device on pin 4
Changed lines 18-22 from:
  // Set clock divider to 21 for pin 4
  SPI.setClockDivider(4, 21); 
   // Set MODE3 for pin 4
  SPI.setDataMode(4, SPI_MODE3);
  // initialize the bus for the device on pin 10
to:
  // initialize the bus for a device on pin 10
Deleted lines 19-20:
  // Set clock divider to 84 for pin 10
  SPI.setClockDivider(10, 84);
Deleted line 20:
Added lines 23-39:
Deleted line 40:
August 26, 2012, at 02:28 AM by Scott Fitzgerald - Page creation
Added lines 1-29:

Share