PSOC5 Pin Quirks: P15 – USB & RS232

I am in the process of creating a cable tester for multi-pin cables, low frequency, high pin count. During this process I used *every* pin available on a TQFP-100 pin CY8C5868 part. The first prototype worked, but was a pain.

As is typical for prototypes, I made several errors. The time frame was short, so I ordered the board before I did the PSOC5 code. This has worked for me in the past, because I tended to use P0 through P6 for most I/O, and never realized there were some significant issues with P12 and P15. Some are clearly explained, some are marketing explained, and some are inferred, which can lead to wrong conclusion.

The first wrong conclusion is that P12 is GPIO. It is NOT. It is SIO, and the normal rules don’t really apply to it. See my previous post. P12 is NOT hooked up to the analog bus in the PSOC5, which is NOT a problem for 99.99% of my designs.

I was surprised by the P15 gotchas. These aren’t explicitly documented, but can be inferred. If you use USB with port P15, the port is not available for certain pin configurations. This is explained/not explained in the documentation.

Every pin in a port shares the trigger level for a high set for any individual pin. This can lead to issues for you if you are not aware of that fact. If you use LVTTL as a transition trigger, you must assign all pins on that port with that trigger level. If you do this, you are NOT able to use USB on that port. If you use USB on that port, you can only assign CMOS (or maybe CMOS/LVTTL ??) on that port.

For me, every application to the present time, this did not present a problem. For the cable application, it was not good news. Fortunately for me, I am creating a new PCB, so I have moved enough signals around to allow that to happen.

P15 Tips and Tricks

If you wish to use the USB pins on P15 for either RS232 or USB, put a 33 ohm resistor in series with the port pins for USB. Also, if configuring as RS232 input, then set the RX port as “Digital Input,” “Open Drain, Drives Low,” initial value of 1 (VALUE OF 1 IS IMPORTANT!!). Never write that port to a value of 0. The TX Port set as “Digital Output,” “Strong Drive,” initial value of 1.

The resistors in series will provide some protection against shorts, but be careful. The configuration to use pull up and pull down resistors is not available on this port. You can then configure this port as USB or RS232 depending upon the project and use, and it will work well. If you only use it as RS232, you can change the serial resistors to around 250 ohms to provide decent protection for that port against shorts to the outside world on the serial communications line.

P15 can be used for analog. This makes sense as oscillators and USB are essentially analog devices.

General Port Protection Against Static

Static Electricity can and will take out CMOS parts (and many other parts). Since the PSOC5LP is CMOS, it can happen to that part. Protection diodes in the substrate offer a decent amount of protection against zaps. Once a part is soldered onto a PCB, its protection against zaps is dramatically increased.

Additionally, if you put 100 ohm resistors in series with a pin, then the port is better protected against most zaps, but not all, coming from outside on the I/O lines. The protection is significant enough to be worth doing, and generally does not affect digital I/O. Depending upon the design, it also may not affect most analog designs.

Fini

For PSOC5, only use P12 port for digital I/O. P15 can be used for analog (and USB), but can be difficult to use as digital if you need internal pull up/pull down resistors and must use the USB port.

Note that digital switching levels apply to the whole port on the PSOC5, so you can’t have side by side pins with different input switching levels. In those cases, make the individual pin analog and cheat with comparators to switch at the level you desire. In the case of P12, you can use an external voltage reference to change switching level for the entire port.

You can also use the P12 port’s VREF level configuration selection to allow the pins on that port to act as level comparators. This is described in application note number AN60580.

Enjoy!

Add a Comment

Your email address will not be published. Required fields are marked *