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

SPISettings is set with wrong value for SPI clock speed #545

Closed
Rotzbua opened this issue Dec 30, 2020 · 0 comments
Closed

SPISettings is set with wrong value for SPI clock speed #545

Rotzbua opened this issue Dec 30, 2020 · 0 comments
Labels
bug 🐛 a not intended feature solved ✔️

Comments

@Rotzbua
Copy link
Collaborator

Rotzbua commented Dec 30, 2020

Step 1: Describe your environment

  • OS version: all
  • Arduino IDE version: all
  • MFRC522 Library version: 1.1.5 <= x <=1.4.7
  • Arduino device: all
  • MFRC522 device: all

Step 2: Describe the problem

Observed Results:

  • SPI clock speed is not set correctly

Expected Results:

  • Do it right.

Relevant Code:

SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4, MSBFIRST, SPI_MODE0)); // Set the settings to work with SPI bus

Introduces with commit 3c3ffa0 . There are many wrong examples with this code in the internet.

Required is:

SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode)

SPI_CLOCK_DIV4 does not represent the clock speed. Just a number (between ~0-100). So can not be used for clock.

References

Seems to be measured here: #269 (comment)

Initial #544

Reason arduino/ArduinoCore-mbed#113 (comment)

@Rotzbua Rotzbua added the bug 🐛 a not intended feature label Dec 30, 2020
Rotzbua added a commit to Rotzbua/rfid that referenced this issue Dec 30, 2020
@Rotzbua Rotzbua closed this as completed Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 a not intended feature solved ✔️
Projects
None yet
Development

No branches or pull requests

1 participant