Main Site Documentation

FEZ Panda II and MiFare Reader Help


#1

I work on a project uses MiFare Reader (SMX1300). i have many problems :’(

  1. I can not response card reader (it connected over rs232 shield). (it works when it connected to pc)
  2. They sent me SDK but for Windows Mobile and Windows. I couldn’t convert some code to net micro framework.
  3. my brain is stoped to work :frowning:
    so i need help.
    many thans to who will may help me,
    Judasis

PS. i checked cables, and i have 3 cable sets and a rs232 gender changer.
i can send the code(sdk) who interest…


#2
  1. Please post the code that you are using to read the serial port. Make it as small as possible.
  2. OK. Ask a question about a specific problem you are having.
  3. Take a deep breath… exhale…

We are here to help each other, but you have to ask specific questions.


#3
  1. Welcome to the forum! :slight_smile:

#4

Yeah… I have to improve my foreplay… ;D


#5

Thank you :slight_smile:
This is code that i stuck… because byte(port.ReadByte()); is for C# (not in netMF).
(I would like to send whole code but is little bit long ???

private bool get_response(out byte[] MyBuffer, out byte Count)
        {
            MyBuffer = new byte[24];
            int i;
            Count = 0;

            //Get First 4 byte from the device, this includes command and length information of data.
            for (i = 0; i < 4; i++)
            {

                try
                {
                    MyBuffer[i] = (byte)port.ReadByte();
                }
                catch (Exception)  //catch (Exception ee)
                {
                    return false;
                } // //Exception_Text = ee.ToString();  

            }

            if (MyBuffer[2] > 20) //Mybuffer[2] represents length of data+checksum. This can not be greater than 20.
                return false;

            //Get Remaining data
            for (i = 0; i < MyBuffer[2]; i++)
            {
                try
                {
                    MyBuffer[i + 4] = (byte)port.ReadByte();
                }
                catch (Exception)  //catch (Exception ee)
                {
                    return false;
                }
            }
            Count = MyBuffer[2];
            Count += 4;

            return true;

        }

#6

I am assuming you have a question about reading a serial port?

Have you read the Beginners E-Book in the Downloads & Tutorials section? Section 17.1 is a start.

http://www.ghielectronics.com/downloads/FEZ/Beginners%20guide%20to%20NETMF.pdf


#7

Have a look at this code. It has the bit in to read the serial port in the P1D class. Adapt it for Mifare.

http://code.tinyclr.com/project/366/priority1design-rfid-reader-driver/

I suggest Debug.Print what you get in on the serial port on the Panda so you can see what’s happening on the port.

Are you sure you are using the correct serial port? I think the serial shield uses COM1.


#8

I had a quick look at the data sheet.

That module has two outputs:

Pin 8: UART TX
Pin 13: RS232 TX

If you connect pin 8 directly to the RX pin of the Panda, you don’t need the RS232 shield or adapter.

Maybe you should also try to cross the TX and RX lines between your module and the RS232 Shield.


#9

Hi realiser and all friends,
i have panda ii, fez touch, fez connect shield, rs232 shield and smx1300 mirfare oem module. i am new on mf. i wanted to use rs232 shield because it is easy way (i think). the mifare oem module uses 9-12 volt. this was problem for me, because of that i decided to use rs232 shield… i agree with you that i can connect directly to panda ii (i read some article) but i don’t know how :’(. if you have any suggest i will follow.
i made new rs232 cable. it didn’t work. rs232 sends data (tx led blinked) but mifare didn’t answer (rs232 rx led stay off).

any suggestion ?!
thank you all,
judasis


#10

First try doing a loop back on the RS323 shield. Wire Rx to Tx. Write a small program to send and receive data. This will allow you to verify the operation of the shield.

If the loopback does not work, post the small program you used.

If it works, then you have a problem with the cabling or your program.


#11

Hi Mike,
Thank you for your help. i found the problem; is cable. i did loop back and i got response. so i have to check my cable and pinout of rs232 cable.
i have a question: if i replace only pins tx and rx on rs232 cable, may it work?
or should i search for another solution?
judasis

Ps. both rs232 shield and smx1300 mifare oem module have female connector! can you map the pinout?


#12

Do you have the datasheets, it should be there.


#13

Yes i am reading now
link is: http://www.sonmicro.com/en/downloads/Mifare/ds_SM130.pdf

i wonder how i could directly connect to panda ii. if i will find a way it will be perfect for me.

judasis


#14

It communicates using UART and I2C protocols. Read “Serial Interfaces” in the Beginners Guide:

http://www.ghielectronics.com/downloads/FEZ/Beginners%20guide%20to%20NETMF.pdf

We also have a lot of examples that use various devices with this protocols on Wiki and Code sites.


#15

Are you using just the module or the module with the Eval kit?

The module on its own is pure 5V TTL UART - so don’t use it with the RS232 shield.

Connect pin 11 (Rx) on the module to pin D39 (COM2 - TXD) on the Panda II.
Connect pin 12 (Tx) on the module to pin D37 (COM2 - RXD) on the Panda II.

Open COM2 at 19200 baud.

Start by reading the firmware version - command 0x81.

Good luck!


#16

Hi realiser,
i think it is imposible to use D39 and D37 pins, because i have FEZ Touch that is connected to Panda II.

thanks,
judasis


#17

Finally i found the problem.
i connected mifare reader to panda ii directly. it didn’t work again. i decided to use 9 volt for panda ii. and it worked!. the problem was voltage between mifare reader and panda ii (mifare uses 5 volt and works COM1). Finally, Fez Panda II is perfect! :wink:
this problem is solved…

thank you all who tried to help me…
judasis