Go Down

Topic: Problems with ENC28j60 and MFRC522 (Read 1 time) previous topic - next topic

pylon

Does it still stop at the same line of code? It doesn't work is not a very detailed information.

CBX

Yes, same problem...

I'm testing another MRFC522 library, https://github.com/ljos/MFRC522 , it happens the exact same thing, and I was thinking, might it be a timing issue?

Since the program is always searching for a new rfid tag, the SPI buffer doesn't have the ENC28J60 data for long and might not have time to send it, what do you think?

Thanks

pylon

Quote
Since the program is always searching for a new rfid tag, the SPI buffer doesn't have the ENC28J60 data for long and might not have time to send it, what do you think?


Which buffer? The SPI library doesn't use buffers.

Can you make a picture where I can see all connections?

CBX

I thought that SPI had a buffer...

A few more pictures in attachment...

MFRC522 module pinout:
(left to right)
3.3v - red
RST - orange
GND - black
IRQ - NC
MISO - yellow
MOSI - blue
SCK - white
SDA (CS) - orange

ENC28J60 module pinout:
(left to right)
VCC - red
Int - NC
MISO - yellow
MOSI - green
CLK - purple
CS - orange
RST - NC
GND - black

pylon

Try connecting the RST pin of the RFID module to Vcc, if it's left floating it might block the bus any time (going to power down mode).

CBX

The RFID module has a 10k pullup on the RST line

pylon

How do you know that? You never posted a schematic of the board. Do you share that information with us?

CBX

I don't have the schematic, I've just check it with the multimeter

CBX

I've solved the problem, I've added a 100ms delay after the last call to a function from the mfrc522 library and it worked

Code: [Select]
...

  id += String(mfrc522.uid.uidByte[i], HEX);
  }

  delay(100);

  if (lastId != id)
  {

...


Thanks for your time pylon

Go Up