Skip to content

Optimize SPI transfers #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2016
Merged

Conversation

sandeepmistry
Copy link
Contributor

Combines SERCOM::writeDataSPI and SERCOM::readDataSPI() into a single SERCOM::transferDataSPI method and remove some flags checks.

Needs more testing, so far basic tests with WiFi101 and SD libraries seem ok.

cc/ @cmaglie @agdl

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b107_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Optimize SPI transfers #180
  5. Select one of the boards under SAMD Pull Request Optimize SPI transfers #180 in Tools->Board menu
  6. Compile/Upload as usual

@dlabun
Copy link

dlabun commented Nov 8, 2016

Is it possible to take the optimizations one (major) step further and introduce DMA?

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b108_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Optimize SPI transfers #180
  5. Select one of the boards under SAMD Pull Request Optimize SPI transfers #180 in Tools->Board menu
  6. Compile/Upload as usual

@sandeepmistry
Copy link
Contributor Author

@dlabun

Is it possible to take the optimizations one (major) step further and introduce DMA?

It's something to look into later, however due to the blocking nature of the current SPI.transfer(...) API's, I'm not expecting it to yield any performance gains. Also, from testing with the SD and WiFi101 libraries, almost all of the SPI transfers are byte by byte.

@AloyseTech
Copy link

Hi guys, I'm working on a DMA Helper to create dedicated DMA library (SPI, I2C, USART...). I have the SPI with DMA working. I still have issue : I can't create an DMA_SPI object in other classes. I think it is a scope issue but I don't have enough knowledge to correctly deal with this issue. ANy help would be appreciated !
Take a look at the source and Unit test here : https://github.com/aloysetech/SAMD_DMA_Helper

@dlabun
Copy link

dlabun commented Nov 16, 2016

@sandeepmistry
I certainly understand, right now I don't see an issues with writing to my SD card. I do see performance issues with the LCD and that's where I think DMA would help the community.

@AloyseTech
I'm sure I know even less about coding than you, but would certainly test out your library on the Sharp memory LCD once the library is functional.

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b110_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Optimize SPI transfers #180
  5. Select one of the boards under SAMD Pull Request Optimize SPI transfers #180 in Tools->Board menu
  6. Compile/Upload as usual

@cmaglie cmaglie merged commit e77ae8f into arduino:master Nov 17, 2016
@sandeepmistry sandeepmistry deleted the spi-transfer branch November 25, 2016 14:49
@sandeepmistry sandeepmistry added this to the Release 1.6.9 milestone Nov 28, 2016
boseji pushed a commit to go-ut/combined-ArduinoCore-samd that referenced this pull request May 30, 2020
Change references from A0 & A1 to DAC0 & DAC1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants