Pages: 1 [2]   Go Down
Author Topic: Problems with ENC28j60 and MFRC522  (Read 1108 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* 19032014271.jpg (749.47 KB, 2592x1944 - viewed 16 times.)

* 19032014273.jpg (656.53 KB, 2592x1944 - viewed 14 times.)

* 19032014274.jpg (530.16 KB, 2592x1944 - viewed 11 times.)
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
...

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

  delay(100);

  if (lastId != id)
  {

...

Thanks for your time pylon
Logged

Pages: 1 [2]   Go Up
Jump to: