This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TRF7960 EVM Communication Problem

Other Parts Discussed in Thread: TRF7960, TRF7970A

I have a TI TRF7960 EVM RFID Reader. I would integrate this reader into an own C# Program. I did read the whole documentation. I sent commands to the reader with the .net SerialPort Class. I can open the port and I can read and write with the .net SerialPort, but nothing happens. Must I use a special DLL like CP210xManufacturing.dll?  Can I only use the .net SerialPort Class?

 

Here is my Code:

 

            SerialPort() _serialPort = new SerialPort();

           

            //Set properties
            _serialPort.PortName = "COM21";
            _serialPort.BaudRate = 9600;
            _serialPort.Parity = Parity.None;
            _serialPort.DataBits = 8;
            _serialPort.StopBits = StopBits.One;
            _serialPort.Handshake = Handshake.None;
            _serialPort.ReadTimeout = -1;
            _serialPort.WriteTimeout = -1;
           

            //Open port
            _serialPort.Open(); 

           

            byte[] WriteToReader = new byte[12];
           

            //Send Command RegisterWrite 01 0C 00 03 04 10 00 21 01 02 00 00 (ISO 15693)
            WriteToReader[0] = 0x01;
            WriteToReader[1] = 0x0C;
            WriteToReader[2] = 0x00;
            WriteToReader[3] = 0x03;
            WriteToReader[4] = 0x04;
            WriteToReader[5] = 0x10;
            WriteToReader[6] = 0x00;
            WriteToReader[7] = 0x21;
            WriteToReader[8] = 0x01;
            WriteToReader[9] = 0x02;
            WriteToReader[10] = 0x00;
            WriteToReader[11] = 0x00;

           

            //Write to SerialPort 

           _serialPort.Write(WriteToReader, 0, WriteToReader.Length);

 

            //Read from SerialPort

            byte[] bReaderLength = new byte[_serialPort.BytesToRead];
            _serialPort.Read(bReaderLength, 0, _serialPort.BytesToRead);

 

I open the port. Then you see I send the Command but I get no response from the SerialPort. BytesToRead are 0.

 

What is wrong?

 

Thank you.

Florian

 

 

 

  • Florian -

    you may want to try raising the baud rate to 115200.

  • I set the baud rate to 115200. Now, I get as answer one byte. And that is '48' == 0. I think that is not the solution. What can I do else?

  • Florian -

    not sure yet - seems like you might have COM port setup issues yet to deal with...maybe the timeout on your COM is too low?

    You can always use our GUI to check that out and make sure you actually have good COM connection to start out with and then move on to COM port emulator like what you are doing here.

    i just used COM port emulator here on my end - this is what you should be sending (i think you are) and what should be coming back...

    <-010C00030410002101020000
    ->010C00030410002101020000#0D#0ARegister write request.#0D#0A
    <-010B000304142601000000
    ->010B000304142601000000#0D#0AISO 15693 Inventory request.#0D#0A
    ->[A85AC2E5D2C407E0,7F]
    S: ===> Text data end <===

    let me know if this helps or not - should be something simple, just need to find it.

  • I played with the timeouts. The same answer '48' == 0. I have no idea what the problem is.

  • Florian -

    you have verified the HW is good with our GUI or other COM Port "packet builder" program? this will indicate which way to go...

    BTW - what is the HW setup? Is this just our EVM or your design? If it is our EVM, did you load the USB driver (CP2102) and try it out with the GUI first to make sure the COM was working on the PC?

    thanks!

  • I have tested the reader with the TI GUI. And all works fine. We have the original EVM, no own design.

  • Florian -

    sorry you are still having trouble, but good news that HW might be OK. So, let's concentrate on your host side. what are the details behind that setup? With the USB driver loaded, the EMV should enumerate as a standard COM port - so if this is regular PC running windows, have you had a look into the device manager or rebooted to clear any errors that might be remaining on the COM port from previous attempts at usage?

    thanks!   

  • I get the EMV as a standard com port on my windows xp machine. An error did not occur. I have more EVMs. I changed the serial number of the evm, that I can use more on one pc. It is strange. With the TI GUI it works fine. So maybe something is wrong with the C# code by the connection... ?

  • Florian -

    Perhaps it seems there is an issue - i am not a C# expert, but i did find this link which seems straightforward explanation of how to use COM port and a delegate for the reception of data. Maybe have a look and see if this helps you out.

    http://www.c-sharpcorner.com/uploadfile/eclipsed4utoo/serialportcommunication12082008111137am/serialportcommunication.aspx 

  •  I have a c# program which works like that in the link.

    Has the EVM a standard answer? What tool can I use to send some commands to the reader, except the TI gui.

  • Florian -

    I have used Docklight, http://www.docklight.de/ and this COM port emulator successfully http://www.aggsoft.com/com-port-emulator.htm with the TRF7960EVM.

    The ISO15693 Host commands document is good guide to start with for sending all the host commands to the reader.

    http://www.ti.com/litv/pdf/sloa141

    You can also use the test tab in the GUI for same sort of packet building.

    First Command to send might be best to send initiate comms

    13:53:23.726 --> 0108000304FF0000
    13:53:23.835 <-- 0108000304FF0000
    TRF7960 EVM

    then set protocol (for ISO15693)

    13:54:30.843 --> 010C00030410002101020000
    13:54:30.968 <-- 010C00030410002101020000
    Register write request.

    then a single slot inventory request

    13:57:15.873 --> 010B000304142601000000
    13:57:16.092 <-- 010B000304142601000000
    ISO 15693 Inventory request.
    [40333608000007E0,5B]

    or a sixteen slot inventory request

    13:57:29.296 <-- 010B000304140601000000
    ISO 15693 Inventory request.
    [40333608000007E0,53]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]
    [,40]

  • Hi  Josh,

    I have exactly the same problem as Florian, I have created an application in .net C# on a Window 7 PC, to test the operation before porting to Arm processor running the Micro Framework, all very straight forward, The port settings are being set as suggested, the port opens and closes. The only time I get zero bytes returned is if I close the application without closing the port then I have to reset the card. I am trying to set up a simplified system ( in the first instance), reading one type of card (in single slot mode) using ISO 15693.

    The board works with the TI GUI, I can read and write to a range of ISO 15693, ISO 14443A cards,

    The port on the PC works, I can communicate with numerous other devices. The port will open and stay open but when I try with the first command sent to the board that you have suggested i.e.

    First Command to send might be best to send initiate comms

    13:53:23.726 --> 0108000304FF0000
    13:53:23.835 <-- 0108000304FF0000
    TRF7960 EVM

    I receive just one byte returned - 0x30.

    This is exactly the response that Florian receives, I don't think it is anything to do with .net or the opening of the serialPort.

    As far as my code is concerned:

    I set the port parameter.

    I open the port.

    I send the first command.

    Is this the correct method of operatation - should I send some other command to twitch some parameter or other on the board? I must also comment on the fact that I am completely new to RFID, but not to byte protocols.

    Having looked at the code in the TI GUi, there is so much bit bashing going on it will take me a month of Sundays to drag my way through it. As I no longer use VS6 and it will not install on my Windows 7 PC I have a problem opening the complet GUI project to trawl through the code.

    But It strikes me that there may be some other initialisation command needed before sending as you suggested 'First Command'. Is this possibly the case?

    I would really appreciate some help here, If you have any suggestions I would be extreemly grateful.

    all the best

    Erwin

  • Hi Josh,

    Would it be possible for you to build a simplified project in any language that will show the basic opeation using ISO 15693 to comunicate with the env board:

    1. open  a port
    2. send the first command, and other commands if you like.
    3. receive a reply, in the correct format.
    4. write and read a byte stream to the card.

    Then post the exe and source code on this forum.

    I could then use this code to evaluate/convert the negative results of my efforts to talk to the board, I can't see where it's the fault of the environment or language used. I only require a simple program to prove diprove what I am doing is valid.

    Thanks for your help

    Erwin

     

  • Erwin -

    I have several examples other than the TRF7960EVM GUI. Maybe two or three in VB6, the others are in LabView.

    Let me know which one you want.

    You can also use terminal program like teraterm or docklight if you like.

    Since you have verified that the TRF7960EVM is OK and the port you are using is OK...i think logically the answer must be that your SW or your setup/handling of the port is still not ok.

    Below are strings that can be used with the EVM, first one is example of where you are getting hung up - perhaps using a serial port monitor program will help you TS this. if you are getting 0x30, this is a 0 in ASCII, and this is first character you should get back, maybe you are stopping on this first half byte of 0x01 (which is SOF).

    0108000304FF0000 //initiate comms

    answer will be echo:

    0108000304FF0000
    TRF7960 EVM

    Serial Port Monitor (between TRF7960EVM and GUI) reveals this ==>

    
    

    Port opened by process "RFIDread_REVA_EVM.exe" (PID: 4852)

    Request: 3/15/2011 6:08:55 PM.23964 (+47.7203 seconds)

    30 31 30 38 30 30 30 33 30 34 46 46 30 30 30 30 0108000304FF0000

    Answer: 3/15/2011 6:08:55 PM.38064 (+0.1406 seconds)

    30 31 30 38 30 30 30 33 30 34 46 46 30 30 30 30 0108000304FF0000 0D 0A 54 52 46 37 39 36 30 20 45 56 4D 20 0D 0A ..TRF7960 EVM ..

    Port closed

     Then you can send other commands and expect echoes like above from the FW. 

    GET VERSION:

    Port opened by process "RFIDread_REVA_EVM.exe" (PID: 4852)

    Request: 3/15/2011 6:10:22 PM.07064 (+87.6903 seconds)

    30 31 30 38 30 30 30 33 30 34 46 45 30 30 30 30 0108000304FE0000

    Answer: 3/15/2011 6:10:22 PM.21164 (+0.1406 seconds)

    30 31 30 38 30 30 30 33 30 34 46 45 30 30 30 30 0108000304FE0000 0D 0A 46 69 72 6D 77 61 72 65 20 56 65 72 73 69 ..Firmware Versi 6F 6E 20 31 31 2E 32 33 2E 32 30 30 39 5F 4C 45 on 11.23.2009_LE 44 5F 43 6F 6E 74 72 6F 6C 20 0D 0A D_Control ..

    SET ISO15693 PROTOCOL (HIGH DATA RATE)

    
    

    Request: 3/15/2011 6:12:29 PM.83864 (+126.6269 seconds)

    30 31 30 43 30 30 30 33 30 34 31 30 30 30 32 31 010C000304100021 30 31 30 32 30 30 30 30 01020000

    Answer: 3/15/2011 6:12:29 PM.96364 (+0.1250 seconds)

    30 31 30 43 30 30 30 33 30 34 31 30 30 30 32 31 010C000304100021 30 31 30 32 30 30 30 30 0D 0A 52 65 67 69 73 74 01020000..Regist 65 72 20 77 72 69 74 65 20 72 65 71 75 65 73 74 er write request 2E 0D 0A ...

    Request: 3/15/2011 6:12:29 PM.96364 (+0.0000 seconds)

    30 31 30 39 30 30 30 33 30 34 46 30 30 30 30 30 0109000304F00000 30 30 00

    Answer: 3/15/2011 6:12:29 PM.08864 (+0.1250 seconds)

    30 31 30 39 30 30 30 33 30 34 46 30 30 30 30 30 0109000304F00000 30 30 0D 0A 00..

    Request: 3/15/2011 6:12:29 PM.08864 (+0.0000 seconds)

    30 31 30 39 30 30 30 33 30 34 46 31 46 46 30 30 0109000304F1FF00 30 30 00

    Answer: 3/15/2011 6:12:30 PM.22864 (+0.1406 seconds)

    30 31 30 39 30 30 30 33 30 34 46 31 46 46 30 30 0109000304F1FF00 30 30 0D 0A 00..


    010B000304142601000000 - ISO15693 INVENTORY (1 SLOT)(ASK, HIGH DATA RATE, NO AFI)
     
    
    

    equest: 3/15/2011 6:16:23 PM.89164 (+19.6253 seconds)

    30 31 30 42 30 30 30 33 30 34 31 34 32 36 30 31 010B000304142601 30 30 30 30 30 30 000000

    Answer: 3/15/2011 6:16:23 PM.03164 (+0.1406 seconds)

    30 31 30 42 30 30 30 33 30 34 31 34 32 36 30 31 010B000304142601 30 30 30 30 30 30 0D 0A 49 53 4F 20 31 35 36 39 000000..ISO 1569 33 20 49 6E 76 65 6E 74 6F 72 79 20 72 65 71 75 3 Inventory requ 65 73 74 2E 0D 0A 5B 35 36 32 39 33 35 30 32 30 est...[562935020 30 30 30 30 37 45 30 2C 37 45 5D 00007E0,7E]


    010B000304140601000000 - ISO15693 INVENTORY (16 SLOTS)(ASK, HIGH DATA RATE, NO AFI)
    Tag is in slot 6
     
    
    

    Request: 3/15/2011 6:16:58 PM.84464 (+2.9844 seconds)

    30 31 30 42 30 30 30 33 30 34 31 34 30 36 30 31 010B000304140601 30 30 30 30 30 30 000000

    Answer: 3/15/2011 6:16:58 PM.00164 (+0.1563 seconds)

    30 31 30 42 30 30 30 33 30 34 31 34 30 36 30 31 010B000304140601 30 30 30 30 30 30 0D 0A 49 53 4F 20 31 35 36 39 000000..ISO 1569 33 20 49 6E 76 65 6E 74 6F 72 79 20 72 65 71 75 3 Inventory requ 65 73 74 2E 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 est...[,40]..[,4 30 5D 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 30 5D 0]..[,40]..[,40] 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 30 5D 0D 0A ..[,40]..[,40].. 5B 35 36 32 39 33 35 30 32 30 30 30 30 30 37 45 [56293502000007E 30 2C 37 45 5D 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 0,7E]..[,40]..[, 34 30 5D 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 30 40]..[,40]..[,40 5D 0D 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 30 5D 0D ]..[,40]..[,40]. 0A 5B 2C 34 30 5D 0D 0A 5B 2C 34 30 5D 0D 0A 5B .[,40]..[,40]..[ 2C 34 30 5D 0D 0A ,40]..

  • Hi Jiosh,

    If they are simple examples, I'll take  a VB6 and  a Labview one, alternatively just a vb6   one. What I was hoping for was a straight open port , write /read, with no chance that there could be a probblem at either end.

    cheers

    erwin

    Look forward to reading the  code.!

  • Erwin -

    Please find TRF7960EVM LV sub-vi's and VB6 examples attached.

    6685.TRF7960EVM Demo Source.zip

    6153.TRF7960EVM Utility.zip

    8105.TRF7960LabView_2009.zip 

  • Hi Josh,

    Thank's for the programs you sent through, looking a the vb6 program caused an epiphany:

    It appears that writing to the ENV can only be performed using ASCII ( unless there is a switch that can change the input format). Where the protocol states that an input byte is 0x00 or 0x0A etc.. one naturally assumes this is one byte as either hex, char, first wrong assumptions.

    That input of  '0x00' is only accepted if it is made up from char  '0' + char '0',  similarily input of 0x0A must be made up from char '0' + char 'A', each character being one byte, so what one would assume to be a single byte of 0x0A need in fact to be made up from two bytes 0x30 + 0x41, giving a string of '0A'.

    For example to send   0108000304FF0000 I initially thought it meant 0x01,0x08,0x00,0x03,0x04,0xFF,0x00,0x00, looks simple - in actual fact what it requires is 0x30,0x31,0x30,0x38,0x30,0x30,0x30,0x33,0x30,0x34,0x46,0x46,0x30,0x30,0x30,0x30.

    I still have a few other problems such as the response being cut short, so that a return message that is supposed to end with 'Register write request' will actually be 'Register write req', where the tail end of the message is missing.

    Is it possible that a message will be lost if there is a delay in reading, i.e. if the message came through in three or four sections then by having a delay between reading three times  and reading the fourth time, the fourth message fragment is lost?

    Thank's for all your help, I actually need to move on to more urgent stuff for the next few week so have to leave this stuff on the back burner (could you suggest to TI that they clarify their documentation regarding their misleading documentation when representing ascii as hex).

    all the best

    erwin

    PS did Florian solve the problem, didn't notice any subsequent posts, as we were both using the same environment and had the same problem, it would be an idea to compare notes.

  • Erwin -

    Sorry for the misunderstanding - i suppose i assumed that you understood that the actual RS-232 interface always is in ASCII as this is in fact how computers talk to one another. We use the hex representation to make it easier to read. Good point though, we should add some note to our host commands and EVM user document to make this clear for folks who are not looking at the firmware, too.

    The other issues you are having i may have a clue for you as LabView is kind enough to report bytes at port for retrieval, so i would think here that you are somehow not allowing all of them to come in and they are still in buffer, thus subsequent reads of the port are then offset accordingly. If you have a mechanism for looking at # of bytes at the port, and then getting all of them, then this should solve that problem.

    I also did not see any other posts from Florian, either - i hope he is OK.

    JDW

     

  • Hi Josh, I was reading this thread and I downloaded these utilities you posted here and had success with the "6153.TRF7960EVM-Utility.zip" app trying to do what I've been struggling to do.  Do you have the source code for it?  As it is, it's just an installable utility.


    Basically what I have here is a Motion F5V tablet with a built in TRF7960 RFID reader.  I'm trying to read MiFare Classic 1K media, ISO14443A.  I'm using C# but have no problem reading then translating from VB.  Basically, your Utility app is the only one I've found that that seems to interact with the reader on this tablet as I'd expect, so I'd lke to see how it was don so I can replicate it and ultimately read a Sector from the media.

    Your help would be greatly appreciated!

     

    Thanks in advance,

    Matt

  • Hello Josh,

    I have been using TRF7970A EVM for a while in order to make some tests but i have problems and therefore i tried alternative way to set up a communication between Tx and Rx (i.e., i used a terminal program) coz the GUI provided is hanging while i sent a file(such as 707580 bytes )  and the transmission time is long. On the other hand the receiving side is having the file imcomplete (received file is 6825 bytes which is supposed to be 707580). My observation is that: when the Tx stop transmitting the Rx is stopping at the same time. but it should last a little bit more to receive the file completely.

    My question is : i want to sent a randomely generated data sequences to be send from Tx to Rx and i con not achieve that neither via EVM GUI nor via terminal programs.!!
    Could you please show me a way .(I would appriciate if you could lead me achieve that by sending ASCII commands) using evm GUI or a term progrm.


    Kind Regards

    OKCU 

  • Dear josh,

    Is that possible to get the mentioned codes samples?

    I try to open port and sent initial commands and than sent serial data packets from one TRF7970A reader to another ... 

    e-mail: bilal_okcu76@hotmail.com


    Thanks

    Okcu 

  • does TI sell this kind of power amplifier for TRF7960 EVM, Sloc 132?

    I need to make antenna that has a reading range of 1m. Is this possible if i use trf7960EVM + power amplifier?

    Thank you. 

  • Alvin - 

    no - we do not sell them - we publish them as references - if you want a finished, amplified reader - then i would suggest that you have a look at devices from companies like Feig Electronics - they also sell off the shelf antennas which will help you get that sort of range with our ISO15693 tags. 

  • Hi @all.

    I don't know if anyone is still reading this thread. Since I was looking for a solution now, I thought a response might be useful for other programmers. The example Florian Gross wrote was not 100% correct. He obviously thought, he had to send a byte array with hex values. I thought the same when I read all this. After being unsuccessful and getting desperate, I tried to send the command by simply converting the string into a byte array. And here we go. It works.

    My solution looks like that:

    1. Open serial port

    serialPort.PortName = "COM4";
    serialPort.BaudRate = 115200;
    serialPort.Parity = Parity.None;
    serialPort.DataBits = 8;
    serialPort.StopBits = StopBits.One;
    serialPort.Handshake = Handshake.None;
    serialPort.ReadTimeout = 5000;
    serialPort.WriteTimeout = 5000;
    serialPort.DataReceived += serialPort_DataReceived;
    serialPort.Open();

    2. Send command

    string cmd = "0108000304FF0000"

    byte[] cmdBuffer = Encoding.ASCII.GetBytes(cmd);

    serialPort.Write(cmdBuffer, 0, cmdBuffer.Length);

    There are a couple of samples on how to receive the data from rs232.

    I don't knwo if my solution is correct, but i works for me.

    thanx

    Timo