-
Notifications
You must be signed in to change notification settings - Fork 34
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
QUESTION on using SoftSPI #7
Comments
You must handle CS just like hardware SPI. You can have multiple devices with different CS pins. They must all use the same SPI mode. You only need transfer(). It works like hardware transfer().
|
Hi. Thanks for getting back to me. Did what you said this morning with the transfers just like normal SPI and it worked. Got confused when looking at the example (and working late at night). Now I am trying to get it work from within a 9250 library. I declared the SoftSPI as spi in the main sketch but now getting spi not defined errors from within the library. How do I get it work? Any ideas. Here's the exact error
Thanks |
Modifying a library to work with SoftSPI may not be easy. I can't guess about the structure of your 9250 library. I really don't have time to help you convert a library from hardware SPI to SoftSPI. A first step is to add an extern statement to the library. If spi is define in your sketch like this:
You will need something like this to define spi in the library.
Good luck, sorry I don't have time to help more. |
Bill appreciate any help. Really wasn't looking for you to convert the library, I got that one. Just didn't know how to do the referencing. Think I can go from there. Thanks again UPDATE: Just to let you know I added the extern statement to the library (already did the other part of the conversion :) ) and it work perfectly. |
In looking through the code I noticed you are not setting a CS pin anyway. Am I assuming it is in effect always selected for that group of pins? Also if there is no CS function then am I assuming correctly you can only have I device attached for the set of pins selected?
Another question is I am trying to attach a 9250 to a new board and use the lib to read say the whoami register. Do I use the send/receive combo or use transfer (the first to send the addr and the second to read the data).
Thanks
Mike
The text was updated successfully, but these errors were encountered: