bandann
Posts: 24
Joined: Thu May 08, 2014 10:42 am

RC522 on CE1

Thu May 08, 2014 10:45 am

Hi guys!


Who knows, witch is the simplest way to get working the rc522 on the second SPI line, on CE1?



Thank's a lot

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: RC522 on CE1

Thu May 08, 2014 1:07 pm

Depends on what you want to do with it.

If you are interested in a vary basic python program then I have posted my solution here.

wiring: follow this diagram, for connecting to CE0, to connect to CE1 you would need to remove the connection from GPIO24 and connect it to 26 instead.
Image
Image
Doug.
Building Management Systems Engineer.

bandann
Posts: 24
Joined: Thu May 08, 2014 10:42 am

Re: RC522 on CE1

Thu May 08, 2014 3:07 pm

Hello Doug,

thank you for your answer.

My wiring is the same.

I wish to use one rc522 and one piTFT (https://learn.adafruit.com/adafruit-pit ... spberry-pi) also, both on the SPI bus, so my plan is the following:

The piTFT LCD panel remains on CE0, and i don't use the touchpanel.
Instead the touch panel i wish to use the rc522 on the free CE1.

I tired your solution, but it do nothing when i wire the rc522 to CE1, it works only on CE0.

How can i tell the software that the RFID reader is on CE1?


Thank you

bandann
Posts: 24
Joined: Thu May 08, 2014 10:42 am

Re: RC522 on CE1

Fri May 09, 2014 5:34 pm

Anyone knows how to to that?

girin
Posts: 4
Joined: Mon Dec 22, 2014 4:12 am

Re: RC522 on CE1

Mon Dec 22, 2014 4:17 am

I have the same problem. so I find clue...

http://www.raspberrypi.org/forums/viewt ... 91&t=70756
Hi,
assuncao wrote:
could you give me an example how to connect two RFID readers using SPI interface, please?
I found it: http://geraintw.blogspot.com.br/2014/01 ... ry-pi.html. I just don't know how to wire two readers.

This is the interface:
- connect the first RFID reader as listed in the Connection Diagram from the link above,
- connect the second RFID reader as listed in the Connection Diagram from the link above, but with this modification: instead of connecting the reader's NSS signal (pin 8) to RasPi GPIO signal SPI CE0 (pin 24), connect it to RasPi GPIO signal SPI CE1 (pin 26).

When your code would like to communicate with the first reader, initialize the spi bus with spi.open(0,0). For communicating with the second reader, use command spi.open(0,1).

what's mean spi.open(0,0). How can modify in above code ???

girin
Posts: 4
Joined: Mon Dec 22, 2014 4:12 am

Re: RC522 on CE1

Mon Dec 22, 2014 4:42 am

I got it.

python file : MFRC522.py 110 line

def __init__(self, dev='/dev/spidev0.0', spd=1000000): -->>>>

def __init__(self, dev='/dev/spidev0.1', spd=1000000): change ~~

very well !!

bye...

serNum = []

def __init__(self, dev='/dev/spidev0.1', spd=1000000):
spi.openSPI(device=dev,speed=spd)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(22, GPIO.OUT)
GPIO.output(self.NRSTPD, 1)
self.MFRC522_Init()

Return to “Python”