Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

62 linhas
1.9KB

  1. Support has been added for the Arduino Due.
  2. You must connect your SD socket to the 6-pin "ISP connector". You must have short
  3. wires or a custom shield to run at full speed, 42 MHz.
  4. If you have problems use a lower SPI speed. You can also check for SPI
  5. errors by editing SdFatCobfig.h to enable CRC checking.
  6. You should be be able to use any digital pin for SD chip select. The default
  7. pin is SS which is pin 10 for Due.
  8. The default SPI rate is 42 MHz. You can set SD chip select and the SPI rate
  9. by calling:
  10. bool SdFat::begin(uint8_t chipSelectPin, uint8_t spiRateID);
  11. The second argument, spiRateID, sets the SCK rate and can be these symbols:
  12. SPI_FULL_SPEED - 42 MHz
  13. SPI_DIV3_SPEED - 28 MHz
  14. SPI_HALF_SPEED - 21 MHz
  15. SPI_DIV6_SPEED - 14 MHz
  16. SPI_QUARTER_SPEED 10.5 MHz
  17. SPI_EIGHTH_SPEED 5.25 MHz
  18. Large reads and writes use fast multi-block SD read/write commands. For optimal
  19. speed, use records that are a multiple of 512 bytes.
  20. Run the bench.ino example to explore large read/write speed.
  21. Replace this line:
  22. #define BUF_SIZE 100
  23. With a large size like this:
  24. #define BUF_SIZE 8192
  25. For best results the record size should be a power of two (512, 1024, 2048,
  26. 4096, 8192). In this case records will be aligned with FAT cluster boundaries.
  27. Since Due is fast, increase the test file size by editing this line:
  28. #define FILE_SIZE_MB 5
  29. Run the PrintBenchmark.ino example to compare text formatting speed of Due
  30. with AVR boards.
  31. A number of options are available to configure SPI for the Due board.
  32. You can use the standard SPI.h library by editing SdFatConfig.h and set
  33. USE_ARDUINO_SPI_LIBRARY nonzero. You must include SPI.h in your sketch.
  34. Several options can be set in Sd2Card.cpp in the USE_NATIVE_SAM3X_SPI
  35. section. These include USE_SAM3X_DMAC to control use of DMA and
  36. USE_SAM3X_BUS_MATRIX_FIX to change Bus Matrix operation. Most people
  37. will not need to change these.