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

Added ESP8266 support and documentation. #562

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 29 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,33 @@ The following table shows the typical pin layout used:
| SPI SCK | SCK | 13 / ICSP-3 | 52 | D13 | ICSP-3 | 15 | ICSP3 | SPI-3 |
+-----------+----------+-------------+---------+---------+-----------------+-----------+---------+---------+

+-----------+---------------+--------------------------+
| | ESP8266 | Teensy |
| +---------------+--------+--------+--------+
| | Wemos D1 mini | 2.0 | ++ 2.0 | 3.1 |
+-----------+---------------+--------+--------+--------+
| Signal | Pin | Pin | Pin | Pin |
+===========+===============+========+========+========+
| RST/Reset | D3 | 7 | 4 | 9 |
+-----------+---------------+--------+--------+--------+
| SPI SS | D8 | 0 | 20 | 10 |
+-----------+---------------+--------+--------+--------+
| SPI MOSI | D7 | 2 | 22 | 11 |
+-----------+---------------+--------+--------+--------+
| SPI MISO | D6 | 3 | 23 | 12 |
+-----------+---------------+--------+--------+--------+
| SPI SCK | D5 | 1 | 21 | 13 |
+-----------+---------------+--------+--------+--------+
+-----------+---------------+--------------------------+--------------+
| | ESP8266 | Teensy | ESP8266 |
| +---------------+--------+--------+--------+--------------+
| | Wemos D1 mini | 2.0 | ++ 2.0 | 3.1 | NodeMCU |
+-----------+---------------+--------+--------+--------+--------------+
| Signal | Pin | Pin | Pin | Pin | Pin |
+===========+===============+========+========+========+==============+
| RST/Reset | D3 | 7 | 4 | 9 | D3 |
+-----------+---------------+--------+--------+--------+--------------+
| SPI SS | D8 | 0 | 20 | 10 | D4 |
+-----------+---------------+--------+--------+--------+--------------+
| SPI MOSI | D7 | 2 | 22 | 11 | D7 |
+-----------+---------------+--------+--------+--------+--------------+
| SPI MISO | D6 | 3 | 23 | 12 | D6 |
+-----------+---------------+--------+--------+--------+--------------+
| SPI SCK | D5 | 1 | 21 | 13 | D5 |
+-----------+---------------+--------+--------+--------+--------------+

Important: If you are using an ESP8266 based board, replace the

| #define RST_PIN 9
| #define SS_PIN 10

with

| constexpr uint8_t RST_PIN = D3;
| constexpr uint8_t SS_PIN = D4;

.. [1] Configurable, typically defined as RST_PIN in sketch/program.
.. [2] Configurable, typically defined as SS_PIN in sketch/program.
Expand All @@ -177,6 +187,8 @@ The following table shows the typical pin layout used:

Important: If your micro controller supports multiple SPI interfaces, the library only uses the **default (first) SPI** of the Arduino framework.



.. _hardware:
Hardware
--------
Expand Down
5 changes: 4 additions & 1 deletion examples/AccessControl/AccessControl.ino
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@
SPI SS SDA(SS) 10 53 D10 10 10
SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <EEPROM.h> // We are going to read and write PICC's UIDs from/to EEPROM
Expand Down
3 changes: 3 additions & 0 deletions examples/ChangeUID/ChangeUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
26 changes: 16 additions & 10 deletions examples/DumpInfo/DumpInfo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,29 @@
* @license Released into the public domain.
*
* Typical pin layout used:
* -----------------------------------------------------------------------------------------
* MFRC522 Arduino Arduino Arduino Arduino Arduino
* Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro
* Signal Pin Pin Pin Pin Pin Pin
* -----------------------------------------------------------------------------------------
* RST/Reset RST 9 5 D9 RESET/ICSP-5 RST
* SPI SS SDA(SS) 10 53 D10 10 10
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
* ---------------------------------------------------------------------------------------------------
* MFRC522 Arduino Arduino Arduino Arduino Arduino ESP8266/
* Reader/PCD Uno/101 Mega Nano v3 Leonardo/Micro Pro Micro NodeMCU
* Signal Pin Pin Pin Pin Pin Pin Pin
* ---------------------------------------------------------------------------------------------------
* RST/Reset RST 9 5 D9 RESET/ICSP-5 RST D3/0
* SPI SS SDA(SS) 10 53 D10 10 10 D4/2
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16 D7/13
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14 D6/12
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15 D5/14
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN 9 // Configurable, see typical pin layout above
#define SS_PIN 10 // Configurable, see typical pin layout above
// Uncomment and comment the 2 lines above when using an ESP8266
// constexpr uint8_t RST_PIN = D3; // Configurable, see typical pin layout above
// constexpr uint8_t SS_PIN = D4; // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance

Expand Down
3 changes: 3 additions & 0 deletions examples/FixBrickedUID/FixBrickedUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/MifareClassicValueBlock/MifareClassicValueBlock.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*
*/

Expand Down
3 changes: 3 additions & 0 deletions examples/MinimalInterrupt/MinimalInterrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
4 changes: 4 additions & 0 deletions examples/Ntag216_AUTH/Ntag216_AUTH.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*
* @author GARGANTUA from RoboCreators.com & paradoxalabs.com
* @license Released into the public domain.
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/RFID-Cloner/RFID-Cloner.ino
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/ReadAndWrite/ReadAndWrite.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/ReadNUID/ReadNUID.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/ReadUidMultiReader/ReadUidMultiReader.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/firmware_check/firmware_check.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/rfid_default_keys/rfid_default_keys.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/rfid_read_personal_data/rfid_read_personal_data.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
* SPI MOSI MOSI 11 / ICSP-4 51 D11 ICSP-4 16
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*/

#include <SPI.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* SPI MISO MISO 12 / ICSP-1 50 D12 ICSP-1 14
* SPI SCK SCK 13 / ICSP-3 52 D13 ICSP-3 15
*
*
*
* For more info on the Pin Layout on specific boards, read this : https://github.com/miguelbalboa/rfid#pin-layout
*
* Hardware required:
* Arduino
* PCD (Proximity Coupling Device): NXP MFRC522 Contactless Reader IC
Expand Down