Sun 2017.01.22
Just jumped into the world of IoT and finding the Pico an undiscovered gem that is about to shine. Toyed with it, running through the gears, while waiting for parts to arrive for fun development.
Here in the USA to reduce an order shipping cost through Amazon Fulfillment I orderd an RFID module to interface with the Pico. [1] The module arrived Friday the 13th. Oooooh, Beware. Superstition aside, read over [2]. Seemed simple enough.
As other tutorials went without a hitch, was surprised when I kept getting:
"Uncaught Error: MFRC522 Request Error 10" which repeated ad infinitum.
in function called from system
Uncaught Error: MFRC522 Request Error 2
at line 1 col 190
...("MFRC522 Request Error "+a);a=this.r(20);return this.ra(18,...
^
in function "req" called from line 1 col 35
{this.w(26,7);return 0<this.req(38).length}
^
in function "isNewCard" called from line 1 col 17
{this.isNewCard()&&a(this.getCardSerial())}
^
in function "findCards" called from line 9 col 3
});
^
in function called from system
Uncaught Error: MFRC522 Request Error 10
<< repeat >>
What I did to troubleshoot. Unfortunately no O-Scope to assist here:
This Espruino forum reference indicated to change B2 to CS/SS/SDA B1 [3]
I also changed the second line of code [2] to reflect that:
var nfc = require("MFRC522").connect(SPI1, B1/CS/);
The supplier video [at 02:46] indicates to make sure IDE is set to 9600, and verified the Espruino IDE was set to 9600, it's default. [4b]
From that same web page, I re-checked the pinout and found the KeyeStudio PCB had silkscreen that differed from their pics at their website. The supplier image silk screen shows pin 4 as MOSI and pin 5 as MISO which are reversed from the silk screen on the boards I have.
The board that arrived - also without a silk screen rev level
Pin
1 Vcc
2 RST
3 Gnd
4 MISO
5 MOSI
6 Clk
7 NSS
8 IRQ
It's not clear in the documentation whether MISO should be wired to MISO -and- MOSI wired to MOSI. Should these be crossed as in RS232 Xmit-Recv ? hmmmm
How I first wired KeyeStudio (as the silk screen correctness is unknown) [5]
pin 4 as MISO to Pico B5 SPI1 MOSI
pin 5 as MOSI to Pico B4 SPI1 MISO
I reversed those pins and then got different error msgs:
140 0x8C
02 0x02
10 0x0A
Was hoping that I could identify a bit(s) that was/wasn't toggling here.
Off to read the spec sheet [6]
It appears that without a scope to assist in watching the clock signals, an option might be to model the MFRC522.js module [7] being careful to use new function names, so as to avoid any name collisions with, that which is already part of the Espruino build. I realize the MFRC522.js module has yet to be built out and I may be one of the few that have made an attempt with RFID. Would like to push on even if I end up with all the arrows in my back. [definition of a pioneer]
Any insight would be greatly appreciated.
Robin
Note to self: Don't accept future shipments on Friday the 13th
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sun 2017.01.22
Just jumped into the world of IoT and finding the Pico an undiscovered gem that is about to shine. Toyed with it, running through the gears, while waiting for parts to arrive for fun development.
Here in the USA to reduce an order shipping cost through Amazon Fulfillment I orderd an RFID module to interface with the Pico. [1] The module arrived Friday the 13th. Oooooh, Beware. Superstition aside, read over [2]. Seemed simple enough.
As other tutorials went without a hitch, was surprised when I kept getting:
"Uncaught Error: MFRC522 Request Error 10" which repeated ad infinitum.
<< repeat >>
What I did to troubleshoot. Unfortunately no O-Scope to assist here:
This Espruino forum reference indicated to change B2 to CS/SS/SDA B1 [3]
I also changed the second line of code [2] to reflect that:
var nfc = require("MFRC522").connect(SPI1, B1/CS/);
The supplier video [at 02:46] indicates to make sure IDE is set to 9600, and verified the Espruino IDE was set to 9600, it's default. [4b]
From that same web page, I re-checked the pinout and found the KeyeStudio PCB had silkscreen that differed from their pics at their website. The supplier image silk screen shows pin 4 as MOSI and pin 5 as MISO which are reversed from the silk screen on the boards I have.
The board that arrived - also without a silk screen rev level
Pin
1 Vcc
2 RST
3 Gnd
4 MISO
5 MOSI
6 Clk
7 NSS
8 IRQ
It's not clear in the documentation whether MISO should be wired to MISO -and- MOSI wired to MOSI. Should these be crossed as in RS232 Xmit-Recv ? hmmmm
How I first wired KeyeStudio (as the silk screen correctness is unknown) [5]
pin 4 as MISO to Pico B5 SPI1 MOSI
pin 5 as MOSI to Pico B4 SPI1 MISO
I reversed those pins and then got different error msgs:
140 0x8C
02 0x02
10 0x0A
Was hoping that I could identify a bit(s) that was/wasn't toggling here.
Off to read the spec sheet [6]
It appears that without a scope to assist in watching the clock signals, an option might be to model the MFRC522.js module [7] being careful to use new function names, so as to avoid any name collisions with, that which is already part of the Espruino build. I realize the MFRC522.js module has yet to be built out and I may be one of the few that have made an attempt with RFID. Would like to push on even if I end up with all the arrows in my back. [definition of a pioneer]
Any insight would be greatly appreciated.
Robin
Note to self: Don't accept future shipments on Friday the 13th
[1] Part order RC522
https://www.amazon.com/gp/product/B016KE9D2U/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
[2] Module MFRC522
https://www.espruino.com/MFRC522
[3] Forum post on RC522 and Pico
http://forum.espruino.com/conversations/269348/#comment12328121
[4] Supplier documentation
http://www.keyestudio.cc/h-pd-118.html
code:
http://www.keyestudio.cc/h-nd-95.html
[5] Pico pinout
https://www.espruino.com/Pico
[6] RC522 Spec Sheet
https://www.nxp.com/documents/data_sheet/MFRC522.pdf
[7] Module MFRC522.js
https://www.espruino.com/modules/MFRC522.js
[eof]