Microchip PIC16F1454

 

 

To add USB to your next project you most likely would opt for a dedicated chip, something from FTDI or Silabs, the traditional players on the market. These parts are a little expensive and there are some issues associated with them, like Silabs chips mounting package. This project was originally PIC18F14K50-based done a long time ago. Microchip introduced PIC16F145X chips with self-tuning from USB bus functionality a few years after that. have redone it to the minimalistic design but never had time to finish it until now. Using PIC16F1454 instead of PIC18F14K50 doesn't require a crystal and crystal associated capacitors and the chip itself is less expensive, around $1.10 for small quantities. It is also available in a 14 pin DIL package. Plus, the benefit of using PIC here is the ability to provide your own VID, PID, serial number, and product description for USB bus enumeration. The firmware is based on Low Pin Count USB demo from Microchip Libraries for Applications with a few additions:

  • Added Tx and Rx LED functionality
  • Provided 6MHz reference clock out on RA4 pin to use with other devices

The USB to serial converter design outlined below. It is self-explainable. Even though PIC16F1454 does have internal 3.3V VREG using the external one is required to make the logic levels compatible with 3.3V circuitry. The purpose of weak pull-up resistor R4 is to prevent RC5/TX pin voltage level from floating when adapter is not connected to any device. And yes, PIC16F1454 got week pull-ups but not for this pin unfortunately. It is not required if converter is being part of embedded design.

The firmware and project files in Eagle format are available in GitHub repository. Microchip MPLAP X IDE and XC8 compiler required to re-build it but already compiled .hex file is also there. PIC16F145X chips belong to Microchip midrange devices category with non-standard ICSPDAT/ICSPCLK pins location and in theory can be programmed with PICkit 2 or PICkit 3 programmers. At some point Microchip decided to stop updating the device file for those programmers before the PIC16F145X introduction. There is a workaround and I have successfully programmed them using an updated device file, see Updating the list of PICkit devices. Another option would be, if you need a few hundred of them, order from Microchip Direct already programmed. It is slightly more expensive but save you time programming them. Even if you decided to use the traditional FTDI chip but want to program your own VID and PID - it is better to have to already preprogrammed PICs.

 

There is also SMD version of this adapter available using PIC in SOIC-14 package.



Prolific PL2303SA/GL

As far as I remember, Prolific was one of the first USB chips manufactures altogether with FTDI. Prolific slogan says "Technology for tomorrow" but it looks like for those 20+ years the Taiwanese company have not succeeded much like FTDI Chip and Silabs did, and major electronic components distributors like Mouser and DigiKey do not stock them. PL2303SA is low component count USB to serial converter chip in SOP-8 package. It is a decent chip if you manage to get the real one. Yes, there are a plenty of clones floating around and Prolific at some point made a questionable decision to provide an update for their own VCP driver that bricked all Prolific clones, the way FTDI Chip did. You can still find the discussion on Internet how to fix Prolific driver 'Code 10 error', see the picture.

The first PL2303SA chip I got on AliExpress was a fake. It didn't have Prolific logo on it. It was working when sending text messages back and force, but real fun happens when I tried to program STM32 ARM processor using built-in bootloader. It turned out that the fake chip randomly inserted zero bytes in the output stream forcing the bootloader quit on me. I was attracted to PL2303SA originally because of simplistic schematic design. It does not require any crystals and VREGs.

 

The on-chip voltage regulator allows the PL2303SA to use the USB bus power or be powered by an external power source. The datasheet doesn't specify how much current allowed to draw from built-in voltage regulator but I was using it a few times to power an external circuitry. It doesn't have Integrated termination resistors though but if the adapter plunging in into USB host directly, they are not required. Different vendors sell them on AliExpress for $0.60 in a small quantities. Beware of fakes! At least, Prolific logo should be present.

Here is USB Device Viewer ouput...

Prolific recently introduced a new "USB to UART GL" line of chips. In particular, PL2303GL is pin-compatible with PL2303SA but has termination resistors integrated in silicon. Another feature is to ability to program USB device descriptors using the utility provided. Not available on AliExpress yet! The project files are here.

 

WCH CH330N and CH340N

I was always asking myself, if those guys are capable of making clones why not to come with something genuine? Apparently CH330/CH340 line from WCH is the case. The CH330N is USB to serial converter in SOP-8 package. For a few years CH330N chip was on its own but looks like now they are re-branding it as CH340N and making part of CH340 chips line. I got the both CH330N and CH340N adapters assembled and found no difference. Here is CH330N English-language datasheet. I am willing to bet that all CH3330/340 chips are based on the same core as CH552 USB chip. And company website particular hinting on it grouping it all on the same page. CH552 is MCS-51-based chip with USB peripheral, see the architecture depicted below.

 

 

The chip is simple but doesn't have internal 3.3V VREG to make the signal compatible with low-voltage circuitry when self-powered but has crystal-less internal oscillator. The schematic of adapter is shown below. As you can see the LDO VREG is here to provide 3.3V level output.

The CH330N and CH340N chips are available on AliExpress for $0.40. The project files are here.

 

 

 

Another issue - inexpensive USB to serial adapters available on AliExpress. One things is common for them - they do not have LDO VREG in a lousy attempt to save a few cents on circuitry design. The one device I got deploys two diodes in serial to get the voltage drop around 1.3V with the resulting 3.7V voltage. It is still a little bit over for 3.3V-based circuitry. The others have something similar, like low-voltage Zener diodes.

 
     

Even though it works, whoever done it never read The Art of Electronics by Horowitz and Hill :)



FTDI FT230XS

 

I know, I know, FTDI is the first choice for application like that. Unsurprisingly, there are many people picking up FTDI chip for their next project. And yet the chips are expensive, which is the reason why some folks are looking for alternative. And, as well as Prolific, FTDI released VCP driver updates intentionally disabled the clone chips. However, instead of bricking fake chips, the FTDI drivers will inject garbage data into a circuit. Connecting a fake FTDI serial chip to a computer running the latest Windows driver will output NON GENUINE DEVICE FOUND!”. How nice!

FT230XS is another low component count USB to serial converter outfitted in SSOP-16 package. The first incarnation of FT230X chips got a nasty bug when the chip inadvertently goes into suspend mode triggered by certain byte sequences. Yes, even FTDI is prone to bugs like that! Here is the schematic:

Note, that FT230X doesn't have Integrated termination resistors incorporated and you will need that if connecting to the USB host with the cable. In adapter schematic above, the CBUS1 and CBUS2 have been configured as TXLED# and RXLED# to drive Rx/Tx LEDs. You have to use FTDI FTProg utility to configure CBUS1/CBUS2 functions to make it work. The project files are here.