View previous topic :: View next topic |
Author |
Message |
EuniceLing
Joined: 12 Apr 2015 Posts: 3
|
RC522 interface with PIC16F887a |
Posted: Sun Apr 12, 2015 9:25 am |
|
|
hi everyone, can i directly interface RC522 with PIC16F887a? Is MAX232 needed? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sun Apr 12, 2015 9:54 am |
|
|
The RC522 is 3.3v. The answer is yes if the 887a is run at 3.3V.
If you read the RC522 datasheet you will find it uses an SPI interface, NOT RS232.
However the 887a cannot be run at full speed (20MHZ) while at 3.3V (read the 877a datasheet for more info) _________________ Google and Forum Search are some of your best tools!!!! |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Sun Apr 12, 2015 1:53 pm |
|
|
consider pic LF parts or 18fxxKxx family for better perfomance at 3v.. |
|
|
EuniceLing
Joined: 12 Apr 2015 Posts: 3
|
|
Posted: Tue Apr 21, 2015 8:43 am |
|
|
So what should I do now ? Pic18f45k22 can directly interface with mfrc522 ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Tue Apr 21, 2015 9:25 am |
|
|
You write a driver.
You get the data sheet. You make the SPI connections to the PIC's SPI connections (remember the DO line on the PIC goes to the DI line on the 522, and vice versa). You work out from the data sheet which SPI mode the chip uses, and setup the PIC's SPI to use this mode. Then you get it so you can read and write to the registers on the chip, and then set it up to do what you want.
Step by step.
Get the chip working first.
Have it setup so you can talk to it with something line RS232, makes debugging a lot easier.
Then setup the SPI, etc. etc.. |
|
|
liusse
Joined: 26 Apr 2015 Posts: 3 Location: Spain
|
|
Posted: Sun Apr 26, 2015 9:24 am |
|
|
EuniceLing wrote: | So what should I do now ? Pic18f45k22 can directly interface with mfrc522 ? |
On my website you can see an example with a PIC 16F628A
Regards. |
|
|
EuniceLing
Joined: 12 Apr 2015 Posts: 3
|
|
Posted: Mon Jun 01, 2015 10:26 am |
|
|
Hi liusse,
can you provide me the code? i can't download it from the website provided.
Thanks |
|
|
liusse
Joined: 26 Apr 2015 Posts: 3 Location: Spain
|
|
Posted: Thu Jun 04, 2015 9:19 am |
|
|
EuniceLing wrote: | Hi liusse,
can you provide me the code? i can't download it from the website provided.
Thanks |
You can download the "hex" file:
www.allm2m.com/RFID/mifare.htm
The source code is not available.
Regards! |
|
|
|