Using the FY6900 with an external USB to serial bridge
30 Dec 2022 - tsp
Last update 30 Dec 2022
6 mins
The following article will be a really short one. Itās about using the FY6900
function generator with an external CMOS 3.3V USB to TTL adapter to circumvent
the embedded CH340.
TL;DR: Simply use the RX/TX pins on the back.
Disclaimer: All Amazon links in this blog article are affiliate links. This pages
author profits from qualified purchases.
The problem
So whatās the problem and whatās the FY6900 anyways? The FY6900 is a cheap function generator - or
was rather cheap for about 1/4 of the price of a solid more professional
device like the SDG1032X
that Iād choose as of today when Iād buy a cheaper function generator. The FY6900
offers two channels, a whole bunch of waveforms - which is of no surprise since
itās an arbitrary waveform generator that one can also load with oneās own
custom waveforms that are then outputted via direct digital synthesis (DDS) based
on two 14 bit 250 Msps digital to analog converters. Basically itās an FPGA (in case
of the FY6900 it seems to be a Cyclone 4) that samples through a buffer that contains
the waveforms for both channels with a static offset and variable step width like
any DDS. It offers a small local display and in theory allows to provide signals
up to 60 MHz with 1 $\mu Hz$ resolution and a amplitude of up to $\pm 20V$. To be
more precise:
- Sines up to 60 MHz
- Squares up to 25 MHz
- Ramps, Triangles, Pulses, TTL/CMOS signals, etc. and arbitrary waveforms up to 10 MHz

The reality looks somewhat different but as long as one requires a reasonable hobbyist
function generator with any high impedance load - you really see clipping at $50 \Omega$
termination at amplitudes larger than $17 V$ as well as some distortion where
negative edges are longer than positive ones which is most likely caused by
providing just not enough power to the output amplifier - itās an acceptable
choice to save money. Just donāt expect to reach all of the āspecifiedā properties.
Itās also manufactured way cheaper than the above mentioned SDG1032X - so if you
want something that also feels more solid but still is an entry level device - take
the SDG1032X or a similar device.
Some of the more promising features of the function generator include:
- Programming via the USB interface. This allows one to set all options and embed
the generator into automated or scripted measurement systems as well as uploading
of arbitrary waveforms into one of 64 arbitrary waveform buffers on the device.
- Modulation - the device supports frequency and amplitude as well as phase modulation
- A noise generator that provides white noise.
- A simple frequency counter up to $100 MHz$
- A voltage controlled oscillator tuned by an external 0 to 5 V input
- Sweep support. In sweep mode it can also use an external analog voltage to
control frequency, amplitude, offset, duty cycle or phase.
- Multiple devices can be synchronized using itās sync in and out ports.
All of the features work reasonable well - especially for a cheaper device. There
have also been plenty of hacks done by the community with this device like for
example:
One can basically play and tune the device to oneās own desire.
Now all of that sounds nice as long as one doesnāt look too close at the USB
port. The USB port is realized with a CH340 USB to serial bridge internally so basically
the function generator is a serial device thatās talked to with 115200 baud like
many other devices. The problem is the CH340 bridge - this is one of the worst
to encounter since there are massive driver issues with different revisions that
are all advertised with the same device IDs to the host system - so depending on
your operating system you will not be able to use the USB port in any way.
The solution
Luckily the FY6900 is built like a hobbyist device - and so the engineers have
just routed the 3.3V RX and TX pins that are usually directed at the CH340 also
to the pin header on the back of the function generator - together with 4 TTLs ports.

The four TTL ports are documented in the manual:
A provides a TTL signal at the same phase and frequency as output channel 1
B provides a TTL signal at the same frequency but 180 degree shifted phase as output channel 1
C provides a TTL signal at the same phase and frequency as output channel 2
D provides a TTL signal at the same frequency but 180 degree shifted phase as output channel 2
The other 4 pins are:
- A ground connection
- A
+5V output. Keep in mind that the serial interface is still only 3.3V
- An RX/TX pair (3.3V CMOS levels) thatās not mentioned in the manual
So to circumvent the CH340 one can simply attach any other USB to serial interface
like a CP2102 based adapter to the RX/TX pair as well
as to GND. Just connect RX of the CP2102 to TX of the FY6900, TX of the CP2102 to RX
of the FY6900 and connect both GND pins to provide the same reference potential.
There comes one caveat with this setup: You cannot use the USB interface as long as
something is attached to the RX pin of the FY6900 due to drivers to the internal CH340
and the external logic are driving against each other. But on the other hand it solves
the problem of the FY6900 not powering down when switching off the mains switch as
long as USB is connected in case itās delivering enough power.
One can of course also use the TTL port to control the FY6900 from any microcontroller
or an Ethernet to serial bridge to give the FY6900 some Ethernet control - though
in case one needs that I still think a device like the SDG1032X would be a better
choice thatās not too expensive anyways.
Software to use
As one would expect software supplied by the manufacturer exposes only the same
functionality as the device itself, is limited to one operating system that one
usually doesnāt have installed on ones workstation and is of limited use for automation.
Luckily there are many implementations of the protocol or at least of subsets.
To mention some of them:
- The great fygen library that exposes all
functions of the FY6900 in Python (GNU LGPL)
- Iāve implemented a class that exposes all basic functions in Python
(3 clause BSD license)
This article is tagged: Measurement, Electronics