- Netduino Forums
- → Viewing Profile: Posts: Ckiszka
Community Stats
- Group Members
- Active Posts 14
- Profile Views 5414
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Friends
Ckiszka hasn't added any friends yet.
Posts I've Made
In Topic: Parallax RFID Reader
03 March 2011 - 08:45 PM
In Topic: Parallax RFID Reader
03 March 2011 - 07:43 PM
That will cause a problem.
You are using D0 as the "outPin" and also trying to use COM1 (which requires exclusive use of pins D0 and D1). So when the program tries to open up the serial port it can't...because D0 is already taken by "outPin".
Try changing your outPin to another pin (D2 through D13 are good).
Chris
Thanks! That fixed the error on the Port.Open.
Now I am not getting a "SerialPort_DataReceived" event. How does the program read data in from the RFID if the pinOut does not go to D0 or D1 and it is never assign an event handler or function in code?
In Topic: Parallax RFID Reader
03 March 2011 - 07:11 PM
Hi Ckiszka,
Can you zip up your project and attach it to this thread?
Also, what serial port are you using? Make sure that you create your serial port object before trying to use it. Otherwise you might be trying to open an "empty" serial port.
Also, be sure that you're not using the pins from that serial port for something else...
Chris
I appreciate your help!
I assume pin D0 is the defacto COM1 port? In code, when setting up the SerialPort, I do not see a specified pin assignment. I am using D0.
Project Code
In Topic: Parallax RFID Reader
03 March 2011 - 05:48 PM
Also, make sure that you put your "Read" code in a loop if you need to wait for all 12 bytes.
For instance:
int count = 0; while (count < 12) { try { count += SerialPort.Read(buf, count, 12 - count); } catch (Exception ex) { // if we get a timeout, go ahead and break free from the while loop. break; } }
I am not even getting that far. I am using example two
public void EnableReader() { if (!SerialPort.IsOpen) SerialPort.Open(); //Bombs Here RFIDOut.Write(false); ReaderEnabled = true; }
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::ReservePin [IP: 0000] ####
#### System.IO.Ports.SerialPort::HandlePinReservations [IP: 003a] ####
#### System.IO.Ports.SerialPort::Open [IP: 001d] ####
#### BottleStats.ParalaxRFID::EnableReader [IP: 0013] ####
#### BottleStats.ParalaxRFID::.ctor [IP: 0067] ####
#### BottleStats.ParalaxRFID::.ctor [IP: 0016] ####
#### BottleStats.Program::InitializeSensors [IP: 0024] ####
#### BottleStats.Program::Main [IP: 0004] ####
A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.SPOT.Hardware.dll
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message:
#### System.IO.Ports.SerialPort::HandlePinReservations [IP: 0093] ####
#### System.IO.Ports.SerialPort::Open [IP: 001d] ####
#### BottleStats.ParalaxRFID::EnableReader [IP: 0013] ####
#### BottleStats.ParalaxRFID::.ctor [IP: 0067] ####
#### BottleStats.ParalaxRFID::.ctor [IP: 0016] ####
#### BottleStats.Program::InitializeSensors [IP: 0024] ####
#### BottleStats.Program::Main [IP: 0004] ####
In Topic: Parallax RFID Reader
03 March 2011 - 08:56 AM
I bookmarked this page sometime ago and ordered the Parallax RFID reader. I have two programs using both the examples above. I cannot get any of them to work. I am not sure what I am doing wrong.
Here is my setup:
Here is the First Example, error:
Second example, error:
- Netduino Forums
- → Viewing Profile: Posts: Ckiszka
- Privacy Policy