phaseform 3 Posted February 9, 2014 Share Posted February 9, 2014 I've been trying to get this library to work with my Stellaris, which has proved a bit of a challenge for a beginner like myself.. I edited Mfrc522.cpp where I changed Mfrc522::Mfrc522(int chipSelectPin, int NRSTPD) { pinMode(chipSelectPin, OUTPUT); _chipSelectPin = chipSelectPin; pinMode(NRSTPD, OUTPUT); digitalWrite(NRSTPD, HIGH); _NRSTPD = NRSTPD; } to Mfrc522::Mfrc522(int chipSelectPin, int NRSTPD) { _chipSelectPin = chipSelectPin; _NRSTPD = NRSTPD; } and moved pinMode(chipSelectPin, OUTPUT); pinMode(NRSTPD, OUTPUT); digitalWrite(NRSTPD, HIGH); to setup (void) of the sketch.NERDGASM! only took about 10 hrs, but I have a card read! fk yeah!For my setup I've set int chipSelectPin = 2; //SDA on reader - connected to pin2 aka CS(2) int NRSTPD = 17; // aka PF_0 I've found out that Mfrc522 Mfrc522(chipSelectPin,NRSTDP); doesnt match Mfrc522.cpp, where the variable NRSTPD is used, so I changed NRSTDP to NRSTPD in the sketch.here is my working code: /* Example file for communicating with the NFRC522. The program prints the card data. Created by Eelco Rouw - Originally adapted by Grant Gibson. Modified by phaseform for use with the Stellaris */ // pin mapping for SPI(2) on the Stellaris (also tiva??) using Rei Vilo's pinmap // SDA - CS(2) -> PB_5 = pin 2 as an integer // SCK - SCK(2) -> PB_4 // Mosi - MOSI(2) -> PB_7 // Miso - MISO(2) -> PB_6 // IRQ - Not connected // GND - GND // RST - reset -> PF_0 // VCC - +3.3V = pin 1 #include <Mfrc522.h> #include <SPI.h> int chipSelectPin = 2; //SDA on reader - connected to pin2 aka CS(2) int NRSTPD = 17; //aka PF_0 Mfrc522 Mfrc522(chipSelectPin, NRSTPD); //changed NRSTDP to NRSTPD unsigned char serNum[5]; void setup() { Serial.begin(9600); // using serial port 1 (USB) SPI.setModule(2); // using SPI module 2... pinMode(chipSelectPin, OUTPUT); //moved this here from Mfrc522.cpp digitalWrite(chipSelectPin, LOW); pinMode(NRSTPD, OUTPUT); //moved this here from Mfrc522.cpp digitalWrite(NRSTPD, HIGH); //moved this here from Mfrc522.cpp pinMode(BLUE_LED, OUTPUT); pinMode(RED_LED, OUTPUT); Mfrc522.Init(); } void loop() { unsigned char i,tmp; unsigned char status; unsigned char str[MAX_LEN]; unsigned char RC_size; unsigned char blockAddr; String mynum = ""; status = Mfrc522.Request(PICC_REQIDL, str); if (status == MI_OK) { Serial.println("Card detected"); Serial.print(str[0],BIN); Serial.print(" , "); Serial.print(str[1],BIN); Serial.println(" "); digitalWrite(BLUE_LED, HIGH); delay(1000); digitalWrite(BLUE_LED, LOW); } else{ digitalWrite(RED_LED, HIGH); Serial.println("no dice here"); delay(1000); digitalWrite(RED_LED, LOW); } status = Mfrc522.Anticoll(str); memcpy(serNum, str, 5); if (status == MI_OK) { digitalWrite(BLUE_LED, HIGH); delay(1000); digitalWrite(BLUE_LED, LOW); Serial.println("The card's number is : "); Serial.print(serNum[0]); Serial.print(" , "); Serial.print(serNum[1],BIN); Serial.print(" , "); Serial.print(serNum[2],BIN); Serial.print(" , "); Serial.print(serNum[3],BIN); Serial.print(" , "); Serial.print(serNum[4],BIN); Serial.println(" "); // Should really check all pairs, but for now we'll just use the first if(serNum[0] == 29) { Serial.println("Hello Eelco"); digitalWrite(BLUE_LED, HIGH); delay(1000); digitalWrite(BLUE_LED, LOW); } delay(1000); } else{ digitalWrite(RED_LED, HIGH); Serial.println("no dice"); delay(1000); digitalWrite(RED_LED, LOW); } Mfrc522.Halt(); } Quote Link to post Share on other sites
phaseform 3 Posted February 9, 2014 Author Share Posted February 9, 2014 Heres the Library I modified to work with the Stellaris, not sure how that affects the MSP430 Mfrc522_Stellaris.zip bluehash 1 Quote Link to post Share on other sites
Kotdnz 0 Posted March 11, 2014 Share Posted March 11, 2014 Hello, i'm new user here. How can i download this lib? Quote Link to post Share on other sites
Thorvard 14 Posted March 13, 2014 Share Posted March 13, 2014 I have the same problem, it seems that the permission to download attachments is granted when you made a specific amount of postings to the forum. i think you need about 3-5 postings.Well its hard for a beginner to post or reply something meaningful with the limited knowledge of a beginner. regards, Nick Quote Link to post Share on other sites
dubnet 238 Posted March 14, 2014 Share Posted March 14, 2014 @Thorvard @ Happy to have both of you on the forum. Please post a reply and you will be one closer to the requirement. Quote Link to post Share on other sites
energia 485 Posted March 14, 2014 Share Posted March 14, 2014 @@bluehash, do users indeed have to have a certain amount of posts to be able to download files? Is that something we can turn off? Quote Link to post Share on other sites
vladn 3 Posted March 15, 2014 Share Posted March 15, 2014 @@bluehash, do users indeed have to have a certain amount of posts to be able to download files? Is that something we can turn off? Same question here... Quote Link to post Share on other sites
vladn 3 Posted March 15, 2014 Share Posted March 15, 2014 I have the same problem, it seems that the permission to download attachments is granted when you made a specific amount of postings to the forum. i think you need about 3-5 postings. Well its hard for a beginner to post or reply something meaningful with the limited knowledge of a beginner. I totally agree. While I am not new to SW/HW work, I just started using the Tiva-C Launchpad and have very little to share yet. Let's try "increasing" my post count to 3-5 , and see what happens... Quote Link to post Share on other sites
vladn 3 Posted March 15, 2014 Share Posted March 15, 2014 Interesting, the downloadable files in the "code vault" forum section are accessible. But the ones in the energia section are not Quote Link to post Share on other sites
vladn 3 Posted March 15, 2014 Share Posted March 15, 2014 i think you need about 3-5 postings Nope, 5 posts did not work. I give up... Quote Link to post Share on other sites
Thorvard 14 Posted March 15, 2014 Share Posted March 15, 2014 Me neither, when i archive enough posts to download attachments i'll let you know. Quote Link to post Share on other sites
bluehash 1,581 Posted March 15, 2014 Share Posted March 15, 2014 Sorry Guys.. All four forum sites went through an upgrade yesterday. Let me check and get back. Quote Link to post Share on other sites
bluehash 1,581 Posted March 15, 2014 Share Posted March 15, 2014 @@bluehash, do users indeed have to have a certain amount of posts to be able to download files? Is that something we can turn off? Same question here... I totally agree. While I am not new to SW/HW work, I just started using the Tiva-C Launchpad and have very little to share yet. Let's try "increasing" my post count to 3-5 , and see what happens... Interesting, the downloadable files in the "code vault" forum section are accessible. But the ones in the energia section are not Nope, 5 posts did not work. I give up... Me neither, when i archive enough posts to download attachments i'll let you know. Sorry for the trouble everyone. It has been fixed. Please double check and let me know. Again apologies. Thorvard and vladn 2 Quote Link to post Share on other sites
Thorvard 14 Posted March 15, 2014 Share Posted March 15, 2014 i am able to download attachments now, thanks! Quote Link to post Share on other sites
Kotdnz 0 Posted March 18, 2014 Share Posted March 18, 2014 Thanks! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.