Cy7c65213 Driver

0 views
Skip to first unread message

Asdrubal Dagreat

unread,
Aug 5, 2024, 7:54:48 AM8/5/24
to akfaskymath
TheCY7C65213 USB to UART serial breakout is designed to provide users with a means to access all available I/O pins on the CY7C65213 part and to provide a 6-pin UART header that is compatible with other SparkFun breakout boards. This tutorial will explain the use of the board in greater detail.

We will explain the layout of the board, proper usage of the jumpers on the board to change the I/O voltage, and use of the Cypress configuration application to change default settings on the board to meet your own needs.


At a minimum, you should be familiar with asynchronous serial communication, as that is the central function of this chip. You should also have some idea of what we mean when we talk about different logic levels, or voltages, so you know when to change the logic level for your board.


The CY7C65213 chip can be used to program an Arduino Pro or Pro Mini, just like SparkFun's other FTDI-based USB to UART chips. As a basic example for getting started with this board, we will be demonstrating this hardware connection.


Note that, unlike the other boards, you'll need to buy some kind of header to interface to the Arduino board, as no header comes pre-soldered to the CY7C65213 breakout. This affords you the option to choose the connector that best suits your purpose or to solder wires directly between the two boards.


Once the board is connected and the driver is installed (which should happen automatically on all major operating systems), no other changes are needed for the board to be used as a programming connection. Simply select the COM or TTY port in the Arduino software and proceed as normal.


We've created a special footprint just for solder jumpers to make it as easy as possible to close the jumper. Simply heat both pads and then apply the solder to the pads; a bridge should form naturally. Do not apply too much solder.


Cypress offer a downloadable configuration utility for this chip. Sadly, it is currently offered only for the Microsoft Windows platform. You'll need to download and install this utility before you can use the chip for voltages below 2V.


When you first open the utility, this is what you will see. In the lower left, you should see the utility displaying the number of Cypress USB UART boards only (other manufacturers' chips, such as FTDI, Arduino or Prolific will not be reflected in this number). Assuming your chip has shown up here, go ahead and click on the Select Target tab at the top.


This is the Select Target tab. The dropdown will list available Cypress USB UART boards, and information (probably more than you want or need) will appear in the window below it. Click the Connect button to proceed, making sure that there are no open terminal windows (such as the Arduino IDE serial port monitor) using this board at the moment first.


A new tab will appear and become automatically selected. In the lower left corner of this new tab, you can see a checkbox labeled VCCIO voltage is less than 2V. Click this checkbox, then click the Program button at the bottom of the page. The chip is now configured for use at less than 2V.


This project, in principle, is quite simple - it's two chips - a Cypress Semi CY7C65213-32LTXI and a Texas Instruments MAX3243ECRHBR. The former is a USB UART. It's pin compatible with the FTDI FT232R's QFN variant, but instead of a proprietary driver, it implements the modem class, so generic drivers provided by the OS will match it. It supports a TX and RX LED, and will be connected up to a micro-USB connector. The other chip is a 3-out/5-in RS-232 level shifter. It requires 4 capacitors to run a charge pump to generate the bipolar supply required for RS-232 signaling, but other than that (and a bypass cap), it requires nothing else.


There are two control inputs on the MAX chip - FORCEON and !FORCEOFF. The chip has some relatively sophisticated activity detection circuitry to automatically shut the chip down when invalid levels are present on the RS-232 side. While that's a nice idea in principle, we don't necessarily want to enforce connecting all of the signal lines up. So FORCEON will be pulled high. !FORCEOFF is intended to be a shutdown signal. The CY7C has a !POWER output pin which is asserted only once the device has been properly enumerated. In keeping with best practices for USB devices, we'll connect !POWER to !FORCEOFF so that the level converter is powered up only when the UART is. The MAX chip has one receive channel that has an alternate output that is always enabled. But since FORCEON is held high, it's moot, so it will be left disconnected.


That's all there is to the project electrically, but I wanted to make this into something small that could be used semi-permanently to adapt RS-232 peripherals to USB. So the intent is to design a housing that looks like a molded DB9 shell, but instead of a cable coming out of the back, it simply presents the micro-USB socket.


At the moment, the board is 1.3x0.6 inches, which won't quite fit in cable housings as they're presently designed. The hope is to be able to design a custom enclosure that has the same dimensions on the DB9 end, but tapers down to an acceptable shape ending in the USB port. Additionally, a couple of holes that can be used to install light pipes to bring the RX and TX LED indications to the surface of the case would be nice. I have zero 3D modeling skills, so that's going to be the challenging part of this project.


There's a second variant of the board that simply leaves off the RS-232 level conversion chip. That variant has a 6 pin SIP header with the standard Arduino "FTDI" pinout. You can solder a male SIP header onto it and plug it right into a breadboard, or a right-angle female SIP header and plug it into some other device with the mating header. Since this variant passes Vcc out to the target device, a couple of protective measures should be taken to protect the host and insure that the device remains within the USB specifications concerning current draw. A USB device isn't permitted to draw significant current until the host completely enumerates it, which gives the host a chance to figure out that the device would draw more current than is available. The !POWER pin noted above can be used to signal that. In our case, we can tie it to a P channel MOSFET to allow us to turn output power on and off. In addition, we can put in a solder jumper to allow us to output either 3.3 volts or 5 volts (to make 3.3v, we need to add a small LDO). We can tie the selected voltage to the CY7C65213's VCCIO pin so that the signaling is the correct voltage as well. Lastly, we will use an AP2331 current limiting switch on the output to protect the host from inrush.


I actually made this for the isolated variant, because I didn't want to complete the matrix by making an isolated RS-232 variant. What it is is simply an RS-232 level converter and a DB-9 on a board that plugs into the 10 pin connector for the TTL level variant.


It's designed to have a 5x2 .1" DIP header mounted on the bottom side of the board, and plugged into the UART board in such a way that the DB9 is facing the opposite direction of the USB-C connector.


I've updated the design to switch from micro-B connectors to C connectors. In principle, this doesn't really change the design very much at all, except to add the two CCx pull-down resistors. The board has to by physically slightly larger but it's not that big a deal.


The TTL variant has also changed to supply all 8 signals rather than just 4. There is now a 10 pin DIP header that has the same pinout as a DTE DB-9 RS-232 connector would, with pin 10 being the power supply pin. Although this is not the industry standard pinout (the so-called FTDI 6 pin connector), it's far more versatile, and you can use SIP jumpers to make any pinout you might want anyway.


I switched from using !SLEEP to using !POWER for the !FORCEOFF pin. Well, !SLEEP and !POWER sort of have opposite meanings. I had intended to use !POWER because it is an indication of the chip either being in USB suspend OR not yet being successfully enumerated. The trouble is, it's low when that happens. !SLEEP was low when in USB suspend. !POWER is high during USB suspend.


Many traditional FTDI style interfaces just connect the Vcc output pin directly up to the output, which in principle violates the USB specification, as you're not allowed to draw significant current before the host has properly enumerated the device.


The fix for this is to switch the Vcc pin on and off with a MOSFET driven by the !POWER pin of the UART. In addition to this, an AP2331 current limiting switch can be used to protect the UART and the host from inrush or other problems. Since the CY7C65213 doesn't run internally at 3.3 volts, if we want to provide 3.3 volt functionality, we'd need to add an LDO. That's actually just as well, since we want to support up to 200 mA of supply current from the Vcc pin. Because of that, we'll specify in the bus enumeration parameters that we require up to 250 mA of bus current. You can do this using Cypress Semi's configuration utility (it's part of their SDK for Windows).


The current version works fine electrically, but some of the silkscreen wound up on the wrong layer, so I've fixed that. Another minor issue is that the GPIO I chose to use for the !FORCEOFF line is defined as !SLEEP, but there's another called !POWER that's a slightly better choice. Lastly, the 10 uF cap is just a little too close to the USB connector for comfort, so it has to move just a touch North.


The first boards from OSHPark are on their way. There is on error on the boards, but it's not very important - the "Geppetto Electronics" is on the top silk layer instead of the bottom, so it's interrupted and covered by all the components. The next version will fix that.

3a8082e126
Reply all
Reply to author
Forward
0 new messages