Arduino Serial Vs SerialUSB

[Andrew] wonders why the SerialUSB() function on the Cortex M3-based Arduino Due is so much faster than Serial() on the Uno or Nano, and shares his observations in this short video. He sets up an experiment with a simple sketch on both boards and uses Wireshark to evaluate the results.

Data is sent in the USB packets in groups of four characters on the ATmega-based boards, but the entire string is put in a packet on the Due board. If you look under the hood, the answer is hiding in plain sight. While the Arduino family of boards connect to your computer using a USB virtual serial port, the ATmega ones have an actual serial connection on-board. For instance, on the Nano there is an FT232RL between the USB connector and the microprocessor (on an Arduino Uno board, a small ATMEGA8U2 is used instead of an FTDI chip, but the concept is the same). On the Arduino Due, the USB connects directly to the SAM3X8E processor.

This concept doesn’t apply only to Arduino boards, of course. On any serial connection between two computers, when a virtual USB device is used on both sides of the link (no actual serial signals involved), the serial baud rate is a fictional thing — data transfer speeds depends on USB alone. We are curious why the packets contain four characters in [Andrew]’s ATmega Wireshark captures — why not 1, 2, or 10? Is this something that can be controlled by the programmer, or is it fixed by the protocol and/or the FTDI chip? If you have the answer, let us know in the comments below. Continue reading “Arduino Serial Vs SerialUSB”

Adafruit Interviews The CEO Of FTDI

When it comes to electronic hobbyists and EEs, there is no company that deserves a few raised eyebrows than FTDI. They made their name with USB converter chips, namely USB to serial chips that are still very popular today. So popular, in fact, that clones of these chips are frequently found in the $2 Arduinos from China, and other very low-cost devices. A little more than a year ago, a few clever people noticed FTDI drivers were bricking these counterfeit chips by setting the USB PID to 0000. The Internet reacted to this move and FTDI quickly backed down from that position. The Windows driver was fixed, for about a year until the same shenanigans were found again.

Adafruit recently sat down with [Fred Dart], CEO of FTDI, giving us all the first facts and figures that aren’t from people frustrated with Windows’ automatically updated drivers. The most interesting information from [Fred Dart] is how FTDI first found these counterfeit chips, what FTDI chips are being counterfeited, and how many different companies are copying these chips.

The company first realized they were being cloned when they couldn’t reproduce results of a Chinese-made ‘FTDI’ USB to RS232 cable that behaved strangely. A sample of the cables were shipped to FTDI and after inspecting the chip inside, FTDI found it was a clone with a significantly different architecture than a genuine chip.

So far, the counterfeiters appear to only be counterfeiting the SSOP version of the FT232RL and occasionally the older FT232BL chip. From what FTDI has seen, there appears to be only one or two companies counterfeiting chips.

As the CEO of FTDI, [Fred] has a few insights into what can be done to stop counterfeiters in China. The most important is to trademark the logo. This isn’t just the logo for a webpage, but one that can be laser etched onto the plastic package of the chip. US Customs has been very amenable to identifying counterfeit components, and this has led to several shipments being destroyed. Legal action, however, is a bit hard in China, and FTDI is dealing with a gang that counterfeits more than FTDI chips; there’s a high likelihood this gang was responsible for the fake Prolific PL23o3 chips a few years ago.

As far as FTDI bricking counterfeit chips is concerned, [Fred Dart] wasn’t silent on the issue, he merely wasn’t asked the question and didn’t bring it up himself.

FTDI Drivers Break Fake Chips, Again

Just over a year ago, FTDI, manufacturers of the most popular USB to serial conversion chip on the market, released an update to their drivers that bricked FTDI clones. Copies of FTDI chips abound in the world of cheap consumer electronics, and if you’ve bought an Arduino for $3 from a random online seller from China, you probably have one of these fake chips somewhere in your personal stash of electronics.

After a year, we have the latest update to FTDI gate. Instead of bricking fake chips, the latest 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!”, an undocumented functionality that may break some products.

FTDI gate mk. 1 merely bricked fake and clone chips, rendering them inoperable. Because fakes and clones of these chips are extremely common in the supply chain, and because it’s very difficult to both tell them apart and ensure you’re getting genuine chips, this driver update had the possibility to break any device using one of these chips. Cooler heads eventually prevailed, FTDI backed down from their ‘intentional bricking’ stance, and Microsoft removed the driver responsible with a Windows update. Still, the potential for medical and industrial devices to fail because of a random driver update was very real.

The newest functionality to the FTDI driver released through a Windows update merely injects unwanted but predictable data into the serial stream. Having a device spit out “NON GENUINE DEVICE FOUND!” won’t necessarily break a device, but it is an undocumented feature that could cause some devices to behave oddly. Because no one really knows if they have genuine FTDI chips or not – this undocumented feature could cause problems in everything from industrial equipment to medical devices, and of course in Arduinos whose only purpose is to blink a LED.

Right now, the only option to avoid this undocumented feature is to either use Linux or turn off Windows Update. Since the latter isn’t really a great idea, be prepared constantly roll back the FTDI driver to a known good version.