Cheap signal generator with variable squarewave rise/fall time - Page 1
Forum section: electronics / testgear

author: Yannik
author_rank: Unknown
timestamp: November 02, 2017, 09:33:20 pm
content: Hi everyone,is there a cheap (<$150, probably chinese, or used?) signal generator which has variable square wave rise/fall time? I would really appreciate any tips.Thanks!

author: rhb
author_rank: Super Contributor
timestamp: November 02, 2017, 11:09:05 pm
content: What speeds and rise times do you want? What duty cycle requirement? What voltage level? Your question is so generic it's hard to answer.One option is a low pass filter on the output with a corner frequency set at some multiple of the square wave fundamental.Another option would be to feed a ramp to an MCU DAC. That would be really cheap and easy if you don't need more than 3-5 V output.Most low cost arbitrary waveform generators should do what you want though they might be painful to program from the little reading I've done.

author: edavid
author_rank: Super Contributor
timestamp: November 03, 2017, 12:01:28 am
content: HP 8012A/B and Wavetek 801 come to mind.

author: Yannik
author_rank: Unknown
timestamp: November 03, 2017, 08:24:04 am
content: Thanks, HP 8012 is a good recommendation. I'll watch out for those. Any other tips?@rhb 3-5Vpp is fine. A variable rise/fall time between maybe 15ns and 500ms.

author: bd139
author_rank: Super Contributor
timestamp: November 03, 2017, 10:10:37 am
content: Watch out for the sliders on the 8012’s. They tend to die and are irreplaceable. Nice little boxes when they do work.

author: rhb
author_rank: Super Contributor
timestamp: November 03, 2017, 02:25:55 pm
content: An STM32F429 Discovery board and a bit of programming and packaging would give you a touchscreen unit for under US$50. You'd probably need to add an output drive stage, but it's got two 12 bit DACsAny of the ARM dev boards should give you what you're looking for. If you don't mind a USB dongle with a terminal as the control, Mecrisp forth with one of the many boards it supports would be especially easy to program.There are so many cheap OEM dev boards now I can't keep up. I know I've got some with 16 bit DACs, but can't remember which. I know that there is a 16 bit audio DAC for the Teensy. I've got one, but haven't messed with it because of some software issue which I've forgotten.

author: cdev
author_rank: Super Contributor
timestamp: November 03, 2017, 03:05:19 pm
content: I have a (very) low cost (Feeltech FY3224 AWG -as little as $45 now) and one can use CSV file to generate custom waveforms. You need to write out a CSV file containing one complete cycle of the wave form and then load it. This would be less convenient than what you might be able to dial up with a better AWG but really cheap, and still quite usable.Also, it would be scriptable so would lend itself to all sorts of automation. The software it comes with is for PCs but it runs fine under Wine. Also, there are Python tools so it can be used under any platform natively. You speak to it via a USB UART adapter it has internally.Using Python it seems you can also create waveforms on the fly- see below (have not done this yet myself, the text below is from the readme and help output for the command line tools)So, that means you can loop through any arbitrary values in scripts.I've also attached a file that contains the communications specification.All this probably also applies to the newer version.However, if you plan on getting one you really must read up on the Feeltech's shortcomings, specifically a major issue with its power supply and leakage voltage.(which is easy to work around)Otherwise you could zap your devices under test. Basically you need to attach a good ground to it and make sure it stays attached. Thats a small price to pay though.I've found the feeltech to be very useful.--------------Here is some info on the python-feeltech tools (development archive is on github):python-feeltech$ cat README.md# python-feeltechPython library for controlling FeelTech FY32xx waveform generatorsInstall with```$ sudo pip3 install feeltech```## Library usageTo create FeelTech object```>>> import feeltech>>> ft = feeltech.FeelTech("/dev/ttyUSB0")>>> ft.type()'FY3224S'```The two channels can then be accessed```>>> ft.channels()[<feeltech.Channel object at 0x7f577b11fd10>, <feeltech.Channel object at 0x7f577b11fcd0>]```and to set various parameters```>>> c.frequency(30e3)```The calls can be chained like:```>>> c.frequency(30e3).amplitude(3.3)```Or even```>>> c.frequency(1e3).waveform(feeltech.SINE).sleep(3).waveform(feeltech.SQUARE)```To upload a waveform (decaying exponential):```>>> ft.upload_waveform(2, [int(e ** (-x / 1000) * 2 ** 12) for x in range(2048)])>>> c.waveform(feeltech.ARB2)```![ds1054z-scope-display_2015-09-05_12-31-49](https://cloud.githubusercontent.com/assets/3966931/9698867/5316aea6-53ca-11e5-9fa5-effcb74e3c12.png)## Commandline tool```$ fytool -husage: fytool [-h] [--port PORT] {type,set,sweep,frequency,counter,upload} ...FeelTech FY32xx control utilitypositional arguments:{type,set,sweep,frequency,counter,upload}type display the device typeset set channel propertiessweep Perform a frequency sweepfrequency Show frequency measuredcounter Show counter valueupload upload arbitrary waveformoptional arguments:-h, --help show this help message and exit--port PORT, -p PORT serial por```To set channel 1 frequency to 1 MHz, waveform to triangle and amplitude to 1V:```$ fytool set -c 1 -f 1e6 -w triangle -a 1```![ds1054z-scope-display_2015-09-05_12-44-45](https://cloud.githubusercontent.com/assets/3966931/9698904/188551be-53cc-11e5-9e44-564130314562.png)Reading the internal frequency counter```$ fytool frequency1000010$ fytool counter545269```To perform a loagrithmic sweep from 1 kHz to 10 kHz, with period of 1 second and lasting for total of 50 seconds:```fytool sweep -s 1e3 -e 10e3 --period 1 --time 50 --type log --waveform square```## TUIThere is also a curses interface to control the device```$ fytui /dev/ttyUSB0```![ds1054z-scope-display_2015-09-05_12-55-57](https://cloud.githubusercontent.com/assets/3966931/9698935/ae043a7e-53cd-11e5-8dc2-c09d6f370b9c.png)!(https://cloud.githubusercontent.com/assets/3966931/9698931/a54afdfa-53cd-11e5-9791-76b25dc3e66f.png)There is a bunch of keyboard shortcuts:```m -- take frequency measurementn -- take counter measurementw -- focus waveformf -- focus frequencyd -- focus duty cyclea -- focus amplitudeq -- exit+/s -- increments selected digit-/x -- decremenets selected digit```For `w/f/d/a` if the control is already focused, it focuses its counterpart in the other channel.

author: rhb
author_rank: Super Contributor
timestamp: November 03, 2017, 06:30:06 pm
content: Quote from: cdev on November 03, 2017, 03:05:19 pmThank you! That's very useful as it's a easy way to load a saved scope trace into the AWG. I'd have never looked at one of those.

author: cdev
author_rank: Super Contributor
timestamp: November 03, 2017, 06:34:30 pm
content: I am going to upload an example of an arbitrary waveform file that I found somewhere (probably here in the big Feeltech thread) this is 10 cycles of a sine wave. This is an xls file, actually, and will give you an example of the file format.