arduino / arduino/ArduinoCore-sam
Additional SPI Interfaces using USART: SPI1, SPI2, etc.
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
This is mainly intended for Arduino Due, but I assume other boards could benefit from this also.
It seems that most if not all USARTs can be used in SPI Master mode, so with the Arduino Due, interfaces SPI1 & SPI2 can easily be provided via USART0 and USART1
The functionality is not so beneficial to the 328/Uno or 2560/Mega boards, due to limited interfaces and pins broken out on the board.
I would say some of the benefits are as follows:
- Uses main female headers for SPI instead of icsp header to make Due more similar to Uno, Mega, etc.
- Uses same type of male connecting wires/pins as used with Uno, Mega etc
- Addresses problems with SPI devices that either don't play nice with other devices or sensitive/high speed devices like radio components that require very short leads
- Reduced complexity with no need for additional Software SPI libraries
- All of the above contribute to making the Due easier to interact with and more user friendly
These are some of the issues that I encountered when I first purchased a Due, since everything was so different, including a 3.3v vs 5v system, and I ended up leaving the Due on the shelf for quite a while.
The change requirements appear to be fairly minimal, with only a few lines in 4 files needing to change in my implementation. I've put together some (rough) POC code for Arduino: https://github.com/TMRh20/Arduino
I thought it best to ask if this would be considered for implementation before finalizing the code, including an additional SPI interface, and making a pull request.
The code is based on my [SPI_UART](https://github.com/TMRh20/Sketches/tree/master/SPI_UART) driver for AVR/328, Mega & Due
Also a mandatory thanks to everybody that maintains these libraries, its been a blast using them so far!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the rough proof-of-concept in the linked TMRh20/Arduino repository and the SPI_UART driver for AVR/328, Mega, and Due. Trace how USART0 and USART1 could expose SPI1 and SPI2 in ArduinoCore-sam. Done means the additional SPI interfaces work on Arduino Due without requiring a separate Software SPI library.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100