Digital Pattern Generator - Page 1
Forum section: electronics / testgear

author: slugrustle
author_rank: Frequent Contributor
timestamp: March 02, 2022, 02:28:22 am
content: I work in embedded hardware (roughly electronics that interface with a microcontroller) and am looking for something akin to a digital pattern generator to test sections of this hardware before firmware is available for the MCU (a different team does that where I work).This is more or less the desired set of capabilities:Selectable output voltage, at least 3.3V and 5V. I haven't seen a USB-based digital pattern generator that can swing 5V.6 or more PWM-capable outputs. Up to 25kHz frequency.8 or more plain digital outputs, controllable at 100µs period or finer.Programmable from a computer. Load a sequence and run it is fine; realtime / online control is not needed. Programmable realtime response to inputs is not needed.These features would be nice to have:Additional isolated digital output port.Trigger input to start sequence from other test equipment.Dedicated trigger output.Does something like this exist? I did look around, but the 5V ask is brutal for anything modern, which is typically USB based. I also looked at PLCs, but the scan time / cycle time seems a little long for this application, and the PLC digital output modules are specified oddly (only sink / only source). My best off-the-shelf option seems to be chaining low cost arbitrary waveform generators together using the trigger output from one of them and programming them over SCPI. I would love to build something like this using an appropriate MCU, level shifters, etc. but the effort involved is a lot given my day job.To give a little more detail, being able to run a sequence along the lines of:Set digital output port stateSet PWM duty cyclesDelay 100 * X µsSet digital output port stateSet PWM duty cyclesDelay 100 * X µs...ENDwould do it.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: March 02, 2022, 03:05:58 am
content: Replying to get notifications, but also to say:Sounds like a good ideaIt probably existsYou can make it yourself (even using an Arduino if you're so inclined!)EDIT:Something like thisCode:const int TRIGGER = 13;void setup() {// Signal trigger - let outboard gear know what we're up topinMode(TRIGGER, OUTPUT);digitalWrite(TRIGGER, HIGH);//Set fast PWM//PWM available on 3,5,6,9,10 and 11// A & B freq: 16MHz / 64 / 256 = 976.5625HzpinMode(3, OUTPUT);pinMode(11, OUTPUT);TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20); // fast PWMTCCR2B = _BV(CS22); // prescaler div 64OCR2A = 180; // 180/255 = 70.6%OCR2B = 50; // 50/255 = 19.6%/*Implementation of your description*///Set digital output port statepinMode(5, OUTPUT);digitalWrite(5, HIGH);//Set PWM duty cyclesOCR2A = 128; // 50%//Delay 100 * X µsdelayMicroseconds(100);//Set digital output port statedigitalWrite(5,LOW);//Set PWM duty cyclesOCR2A = 0; // 0%//Delay 100 * X µsdelayMicroseconds(100);// Signal enddigitalWrite(TRIGGER, LOW);}void loop() { /* nothing to see here */ }Ugly and untested, but just to show you what it could kind of look like.

author: tautech
author_rank: Super Contributor
timestamp: March 02, 2022, 03:56:30 am
content: These are to be released any day:https://www.eevblog.com/forum/testgear/siglent-sdg7000a-350-500-mhz-and-1-ghz-awgs-coming/Very soon we'll post lots more info on them.

author: srb1954
author_rank: Super Contributor
timestamp: March 02, 2022, 04:34:55 am
content: Quote from: slugrustle on March 02, 2022, 02:28:22 amLook at the HP 8175A Digital Pattern GeneratorDoes everything you need except the isolated digital output, which could be easily added externally with a digital isolator chip. Requires some effort to setup patterns but is very versatile and offers plenty of speed and timing precision for your application.

author: Berni
author_rank: Super Contributor
timestamp: March 02, 2022, 07:11:17 am
content: There are some arbitrary signal generators that provide digital outputs by simply sending out the individual bits that would otherwise go into the DAC. That is the way my olc Tek boat anchorworks.But seeing you only need 100us of time resolution means that any MCU could do the job. This is pretty much what i did at one point. I wanted a easy way to interface to various chips from a PC directly. Given that the age of the LPT port is over i instead hooked up a PIC to a USB to UART chip and then put some quick firmware into the PIC that talks over UART and is able to play/record the state of a 8bit port to RAM and back. That way my PC software could for example set up a SPI transfer sequence, send the buffer to the MCU, it plays it back on the pins while recording back the result, this then gets sent back over UART and the PC software decodes out the SPI data.This way all the smarts stay in the PC while the little microcontroller is simply a 8bit digital playback device (so the firmware is very simple), with a bit more work the UART interface could be made to be SCPI compliant too, but i didn't need it to be since i was the only one using it while it is hard to avoid writing some amount of software when it comes to pattern generators. The patterns tend to be too long and tedious to make by hand while often you actually want to embed some sort of data stream into that pattern.

author: nctnico
author_rank: Super Contributor
timestamp: March 02, 2022, 12:37:46 pm
content: The best bet is to find a Tektronix or Agilent logic analyser with a pattern generator module. These can be found relatively cheap. Using an AWG is not going to work well because these are not targetted at digital pattern generation so miss quite a few features (like signal groups) that are necessary for a digital pattern generator (been there, done that). Expect needing to do some scripting to create waveforms though.

author: slugrustle
author_rank: Frequent Contributor
timestamp: April 28, 2022, 01:42:25 am
content: Thanks for all the suggestions.I actually designed, laid out, and ordered my own boards with an MCU and a bunch of logic buffers on it. However, I have not had the time to solder the board or write the firmware. Meanwhile, I discovered the Measurement Computing USB CTR-08 (https://www.mccdaq.com/usb-data-acquisition/USB-CTR-Series.aspx). This looks just close enough for my immediate needs, it's off the shelf, and they've done the work on the software and API.The USB CTR-08 takes standard TTL-level logic in (works well enough with 3.3V levels) and outputs 5V-level logic. I'm pairing it with a few Gravitech MR-MINI-LEVEL-SHIFTERs (https://www.gravitech.us/mi5v3lesh.html) to interface with 3.3V systems. Here I was tempted to make my own level shifter with nice terminal blocks, wall adapter, etc., but time is a constraint, and these are close enough. I will settle for 3D printing some nice little support plates for the level shifter boards.

author: free_electron
author_rank: Super Contributor
timestamp: April 28, 2022, 03:56:57 am
content: see if you can find an old HP logic analyser with built i pattern generator. something like a 1670G but make sure it has the pattern generator option !

author: slugrustle
author_rank: Frequent Contributor
timestamp: May 01, 2022, 10:01:20 pm
content: It turns out the USB CTR-08 board from Measurement Computing won't ship before I plan to start the testing that will need a digital pattern generator, so I soldered the board I had designed. Photos, schematic, and text file outlining my pie-in-the-sky ideas for the firmware are attached.I've only done a basic initialization on the intended PIC18F45Q43 MCU, but it should be up to the task. I intentionally designed the firmware features to be implementable... perhaps next weekend I'll try to get loopback serial working. From there, it's a fairly straightforward grind.

author: nctnico
author_rank: Super Contributor
timestamp: May 01, 2022, 11:17:21 pm
content: The 3D printed cover is nice but those small transformers typically run very hot. I'd used AC/DC switching converters. These are really cheap nowadays (look for a brand called Mornsunhttps://www.mornsun-power.com/).

author: slugrustle
author_rank: Frequent Contributor
timestamp: May 02, 2022, 03:32:12 am
content: I used split bobbin AC mains transformers to reduce the AC leakage current into the circuit under test. These measured under 1µA. Even medical grade switching converters have much higher leakage current.Fortunately, the anticipated loads are low on this board.