Preciso de uma mão amiga. Acredito está fazendo ou esquecendo alguma coisa!
Seguinte, estou tentando usar a lib PN5180-Library pra comunicação pn5180 com o esp32, tenho:
// ESP-32 <--> PN5180 pin mapping:
// 3.3V <--> 3.3V
// GND <--> GND
// SCLK, 18 --> SCLK
// MISO, 19 <-- MISO
// MOSI, 23 --> MOSI
// SS, 16 --> NSS (=Not SS -> active LOW)
// BUSY, 5 <-- BUSY
// Reset, 17 --> RST
void setup() {
Serial.begin(115200);
nfc.begin();
nfc.reset();
// verifica a versão
uint8_t productVersion[2];
nfc.readEEprom(PRODUCT_VERSION, productVersion, sizeof(productVersion));
if (0xff == productVersion[1]) { // if product version 255, the initialization failed
Serial.println(F("Ôpa! Falha na inicialização"));
Serial.println(F("Pressione reset para reiniciar..."));
Serial.flush();
exit(-1); // halt
}
nfc.setupRF();
}
Tenho uma tag/cartão ISO15693 para a leitura. Código na integra https://github.com/cicerosnt/pn5180-esp32
void loop() {
Serial.println(F("----------------------------------"));
Serial.print(F("Loop #"));
Serial.println(loopCnt++);
if(errorFlag) {
uint32_t irqStatus = nfc.getIRQStatus();
showIRQStatus(irqStatus);
if(0 == (RX_SOF_DET_IRQ_STAT & irqStatus)) { // tag não detectada
Serial.println(F("----------------------------------"));
Serial.println(F("nAproxime o tag/cartão para leitura!n"));
}
nfc.reset();
nfc.setupRF();
errorFlag = false;
delay(1000);
}
uint8_t uid[8];
ISO15693ErrorCode rc = nfc.getInventory(uid);
if (ISO15693_EC_OK != rc) {
Serial.print(F("Error in getInventory: "));
Serial.println(nfc.strerror(rc));
errorFlag = true;
return;
}
Serial.print(F("Inventory successful, UID="));
for (int i=0; i<8; i++) {
Serial.print(uid[7-i], HEX); // LSB is first
if (i < 2) Serial.print(":");
}
Serial.println();
delay(1500);
}
Mas simplesmente não lê, não tem resultado.
IRQ-Status 0x6: [ TX IDLE ]
----------------------------------
Aproxime o tag/cartão para leitura!
Esperava conseguir ler a tag/cartão NFC.
New contributor
C. Santos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.