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

Changing SS Pin for SPI Bluetooth Communication #3187

Closed
Suzaken opened this issue Jun 15, 2018 · 4 comments · Fixed by #8299
Closed

Changing SS Pin for SPI Bluetooth Communication #3187

Suzaken opened this issue Jun 15, 2018 · 4 comments · Fixed by #8299

Comments

@Suzaken
Copy link

Suzaken commented Jun 15, 2018

The bluetooth code that Wez made has the SPI protocol communicate using the Slave select as the B0 pin on the atmega32u4. Is there a way to change the Slave Select pin to a different I/O pin? This is the code. https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/adafruit_ble.cpp

@drashna
Copy link
Member

drashna commented Jun 15, 2018

Not sure if this would work (probably),
Add something like this to the top:

#ifndef AdafruitBleSSPin
#define AdafruitBleSSPin B0
#endif

And replace the call with:

    digitalWrite(AdafruitBleSSPin, PinLevelHigh);
    pinMode(AdafruitBleSSPin, PinDirectionOutput);

That should all it to work "normally" for the boards that use it, and should allow you to redefine the pin, if/when needed.

@Suzaken
Copy link
Author

Suzaken commented Jun 15, 2018

Thanks for the help. Tried that and it doesn't work. It's strange because that code already defines a chip select pin b4 so I don't really understand what it's using b0 for.

@drashna
Copy link
Member

drashna commented Jun 16, 2018

Unfortunately, that's about the extent of my expertise here. Sorry.

@fauxpark fauxpark mentioned this issue Mar 17, 2020
13 tasks
@fauxpark
Copy link
Member

@Suzaken so the thing with the SS pin is it's required to initially be logic high for the AVRs to stay in SPI master mode, regardless of whether you're actually using it - B0 is left floating in the Feather schematic. The real slave select pin is in fact AdafruitBleCSPin.

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

Successfully merging a pull request may close this issue.

3 participants