Skip to content
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

Using SPI_1 and SPI_2 on OpenCM-904 in Arduino mode #108

Open
Roboteer1000 opened this issue Jul 16, 2022 · 0 comments
Open

Using SPI_1 and SPI_2 on OpenCM-904 in Arduino mode #108

Roboteer1000 opened this issue Jul 16, 2022 · 0 comments

Comments

@Roboteer1000
Copy link

In Arduino mode, the OpenCM-904 already has drawn out nicely 2 SPI Ports on its two headers.
In the file "SPI.h", Line 114, I saw that SPI is defined as extern SPIClass SPI;
Then in the file "SPI.cpp", Line 25, I saw that only SPI1 is used by default. So I added SPI2 on Line 26 (and commented out Line 25).

Added_SPI2_904

With this setup, I can use EITHER SPI1 or SPI2 Port fine, but I need to use BOTH SPI Ports at the same time for my project. Header pins wise, there are no problems, but software wise how should I approach this issue?

I also saw the comments on Lines 63-66 - is that relevant/workable?

image

The way multiple SPI devices are handled as shown in "Arduino Cookbook" is very different from the way ROBOTIS is handling this issue for OpenCM-904. The use of "extern SPIClass SPI" - is that really needed? Did ROBOTIS write the OpenCM-904 library so that only ONE SPI can be used at any one time?

Thank you for any pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant