CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RC522 interface with PIC16F887a

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
EuniceLing



Joined: 12 Apr 2015
Posts: 3

View user's profile Send private message

RC522 interface with PIC16F887a
PostPosted: Sun Apr 12, 2015 9:25 am     Reply with quote

hi everyone, can i directly interface RC522 with PIC16F887a? Is MAX232 needed?
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sun Apr 12, 2015 9:54 am     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Sun Apr 12, 2015 1:53 pm     Reply with quote

consider pic LF parts or 18fxxKxx family for better perfomance at 3v..
EuniceLing



Joined: 12 Apr 2015
Posts: 3

View user's profile Send private message

PostPosted: Tue Apr 21, 2015 8:43 am     Reply with quote

So what should I do now ? Pic18f45k22 can directly interface with mfrc522 ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Tue Apr 21, 2015 9:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Apr 26, 2015 9:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Jun 01, 2015 10:26 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Jun 04, 2015 9:19 am     Reply with quote

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

Confused The source code is not available.

Regards!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group