You are here

PSOC 5LP - RS232 & ThingMagic NANO | Cypress Semiconductor

PSOC 5LP - RS232 & ThingMagic NANO

Summary: 6 Replies, Latest post by CDutko on 02 Nov 2016 05:27 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
cdutko_1797226's picture
User
4 posts

Hello all,

Currently I am working on a project to connect a 5LP PSOC (CY8C5868AXI-LP035) to a RFID reader called the ThingMagic NANO. I was curious if anyone had ever done something similar to this.

 

Mainly I am curious if my implementation of  the UART on the PSOC device is correct. I just feel as though it is so simple that I am missing something.

 

If anyone can discuss RS232 with me or specifically talk about the ThingMagic NANO (or other RFID readers) that would be great.

 

I've uploaded a picture of my setup.

I'm using the CY8CKIT-050 as my target device. I have a custom DB9 male cable that I build which connects pins 2 (Tx) and 3 (Rx) to the RFID reader. The white wire is connected from the reader's RS232TX to the PSOC's RX. The red wire si connected from the RS232RX to the PSOC's TX. The additional white and red wire connect that P7 area on the CY8CKIT-050  to the PSOC's actual pin definitions in software. The RX pin for the UART is P6_0 and TX pin for the UART is P6_6. So the wires connect accordingly. 

 

The problem is I can't connect to the RFID reader. I'm not sure if it is on my end in terms of hardware (meaning the PSOC, my wiring, etc) or if it is on the software end with ThingMagic's API or my UART implementation. I'm following the guide (http://www.corerfid.com/rfid%20shop/thingmagic/mercuryapi_programmerguid...)  to attempt to integrate these two devices. 

Thank you everyone and anyone for the help/discussion!!

user_242978793's picture
User
1030 posts

Your files are not complete please post your complete program Please.  Also I suppose that you have the jumpers set correctly on the -50 board.

user_242978793's picture
User
1030 posts

What does the serial data look like on a terminal program such a Putty?

cdutko_1797226's picture
User
4 posts

@bobgoar

I will do a debug session and I will watch what the data is and report back. Although the data may just be gibberish for both of us. I'm not sure what commands the ThingMagic NANO actually receives as they have kept the serial commands hidden. (For obvious reasons.)

I don't think that there are any jumpers on the -050 board that involve the RS232 port.

I will upload my entire project workspace to MEGA.nz and post the link here:

https://mega.nz/#!BsoU2K5K!XNxt6SOQozFq26ul0TWT-eGVMHIL50fQlxVOCjI5i0Q

I would just make it one large upload, through Cypress' attachment utility, but it is too large to do so...

 

Thank you for your interest in my project/problem.

 

cdutko_1797226's picture
User
4 posts

  ret = TMR_SR_sendTimeout(reader, msg, 0);

At the time of calling this method, the data for the first 32 bytes of the msg is the first picture. (if the editing of the post doesn't work correctly, the first image at the bottom is the data and the second image is related to the second half of this post.)

 

Featured Above is the first 32 bytes and onward of the msg that is sent over the serial port.

That method attempts to set the timeout time on the reader and it checks to see if the baud rate is correct. (Baud rate is correct and defaulted to 115200)

if (TMR_SUCCESS == ret)
    {
      /* Got a reply?  Then this is the right baud rate! */
      break;
    }

 

The next section of code that the program will attempt to enter is featured below.

 

 else if (TMR_ERROR_TIMEOUT != ret)
    {
      if (TMR_ERROR_COMM(ret))
      {
        ret = verifySearchStatus(reader);
        if (TMR_SUCCESS == ret)
        {
          goto contact;
        }
        else
        {
          return ret;
        }
      } 
      else
      {
        return ret;
      }
    }
  }

 

In the method [TMR_Status verifySearchStatus(...)]  I attempt to receive messages from the serial RFID reader.

I ,of course, receive nothing from the reader (aka my problem )

This is then when the error handler sees that RET != 0 (TMR_SUCCESS) and kicks me out of the method eventuallly so it can enter the error handling code:

//Error message
    if (TMR_SUCCESS != ret)
    {
        errx(1, "Error connecting to reader: %s\n", TMR_strerr(rp, ret));
        return 0;
    }
    else
        connected = true;

Which then the first conditional of the if statement is met and the error message resolves. Thus, ending my program.

 

I hope this information helps everyone better understand what is happening. I fear that I am doing something incorrectly ... I've been working for a solid month attempting to get these devices to talk to one another.

Any help/discussion is appreciated and I will stay active and provide as much information as I possibly can.

user_242978793's picture
User
1030 posts

As you have not given us your complete code.  I have one thing to have you try increase your heap size  to about 0x800. See if that helps.

cdutko_1797226's picture
User
4 posts

"I will upload my entire project workspace to MEGA.nz and post the link here:

https://mega.nz/#!BsoU2K5K!XNxt6SOQozFq26ul0TWT-eGVMHIL50fQlxVOCjI5i0Q

I would just make it one large upload, through Cypress' attachment utility, but it is too large to do so..."

- CDutko [01 Nov 2016 07:51 AM PDT}

You can find my entire project source here. You must have missed the link in the wall of text.

Log in to post new comments.