Jump to content
43oh

RC522 Library on Stellaris


Recommended Posts

I'm newbie in Energia

Possible this question about SPI, but library must cover this.

We connect our SPI to base_2 via command SPI.setModule(2);

My example - SPI0 - ethernet, SPI2 - RFID.

I read source code and can't found mechanism to separation SPI0 & SPI2.

Inside all libs i found only SPI....

 

Think we need add to class constructor pointer to SPI_BASE.

Link to post
Share on other sites
  • 2 months later...

https://github.com/rena2019/ This one can be adapted to Energia in like 10 minutes. It dumps the whole content of the cards. I was trying to port this to CCS with little success...

Card detected.
 ATQA: 04 00  
 UID:  83 41 EB A4 
 SAK: 8
Sector 0: 
 83 41 EB A4 8D 08 04 00 62 63 64 65 66 67 68 69 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
Sector 1: 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
...
Link to post
Share on other sites
/////////////////////////////////////////////////////////////////////
//set the pin
/////////////////////////////////////////////////////////////////////
const int chipSelectPin = PD_4;
const int NRSTPD = PD_5;


void setup() {                
  Serial.begin(38400);                 // RFID reader SOUT pin connected to Serial RX pin
  // start the SPI library:
  SPI.setModule(2);
  SPI.begin();

That's all I've changed. And I had to swap MISO & MOSI because there was an error in the pin description pic I used. I've zipped the sketch and library. I had to save the sketch in a different location, so you may have to shovel it to the right place.

Card detected.
 ATQA: 04 00  
 UID:  EB 64 D5 EC 
 SAK: 8
Sector 0: 
 EB 64 D5 EC B6 08 04 00 62 63 64 65 66 67 68 69 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
Sector 1: 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
Sector 2: 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
...
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
Sector 15: 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 

mfrc522.zip

Link to post
Share on other sites
  • 4 weeks later...

Hello!

I am also testing RC522 module.

I am OK in PICC reading.The Card response it's UID.

But,I want to interrupt request from IRQ pin to be good performance in my software.

I am writing with C.

Interrupt is not OK now.I have no idea why this happen. I write correct command to PCD.

But Interrupt does not happen.what i need?

Please help me?

 

Link to post
Share on other sites
  • 2 years later...

OppaErich,

Thanks for your great work here! I'm working to map it to an EK-TM4C129EXL - which card do you guys have this working on?

Specifically, I'm hoping to connect to BoosterPack 1 connectors - which has plenty of labeled pinouts for SPI.

Can you suggest a path forward? 

Where are the pin definitions in these projects? It appears I'd have to set const int NRSTPD = RST; - which obviously I cannot do directly.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...