Author Topic: Digital Pattern Generator  (Read 1639 times)

0 Members and 1 Guest are viewing this topic.

Offline slugrustleTopic starter

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Digital Pattern Generator
« on: March 02, 2022, 02:28:22 am »
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 state
  • Set PWM duty cycles
  • Delay 100 * X µs
  • Set digital output port state
  • Set PWM duty cycles
  • Delay 100 * X µs
  • ...
  • END

would do it.
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Digital Pattern Generator
« Reply #1 on: March 02, 2022, 03:05:58 am »
Replying to get notifications, but also to say:

  • Sounds like a good idea
  • It probably exists
  • You can make it yourself (even using an Arduino if you're so inclined!)

EDIT:
Something like this
Code: [Select]
const int TRIGGER = 13;

void setup() {
    // Signal trigger - let outboard gear know what we're up to
    pinMode(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.5625Hz
    pinMode(3, OUTPUT);
    pinMode(11, OUTPUT);
    TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20); // fast PWM
    TCCR2B = _BV(CS22); // prescaler div 64
    OCR2A = 180; // 180/255 = 70.6%
    OCR2B = 50;  //  50/255 = 19.6%
    /*
    Implementation of your description
    */
    //Set digital output port state
    pinMode(5, OUTPUT);
    digitalWrite(5, HIGH);
    //Set PWM duty cycles
    OCR2A = 128; // 50%
    //Delay 100 * X µs
    delayMicroseconds(100);
    //Set digital output port state
    digitalWrite(5,LOW);
    //Set PWM duty cycles
    OCR2A = 0; // 0%
    //Delay 100 * X µs
    delayMicroseconds(100);

    // Signal end
    digitalWrite(TRIGGER, LOW);
}

void loop() { /* nothing to see here */ }

Ugly and untested, but just to show you what it could kind of look like.
« Last Edit: March 02, 2022, 03:25:25 am by alexanderbrevig »
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 28393
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Digital Pattern Generator
« Reply #2 on: March 02, 2022, 03:56:30 am »
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.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1092
  • Country: nz
  • Retired Electronics Design Engineer
Re: Digital Pattern Generator
« Reply #3 on: March 02, 2022, 04:34:55 am »
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).

Does something like this exist?  I did look around, but the 5V ask is brutal for anything modern, which is typically USB based.
Look at the HP 8175A Digital Pattern Generator

Does 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.
 

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4957
  • Country: si
Re: Digital Pattern Generator
« Reply #4 on: March 02, 2022, 07:11:17 am »
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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Digital Pattern Generator
« Reply #5 on: March 02, 2022, 12:37:46 pm »
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.
« Last Edit: March 02, 2022, 12:46:18 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline slugrustleTopic starter

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Digital Pattern Generator
« Reply #6 on: April 28, 2022, 01:42:25 am »
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.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Digital Pattern Generator
« Reply #7 on: April 28, 2022, 03:56:57 am »
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 !
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline slugrustleTopic starter

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Digital Pattern Generator
« Reply #8 on: May 01, 2022, 10:01:20 pm »
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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Digital Pattern Generator
« Reply #9 on: May 01, 2022, 11:17:21 pm »
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 Mornsun https://www.mornsun-power.com/ ).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline slugrustleTopic starter

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Digital Pattern Generator
« Reply #10 on: May 02, 2022, 03:32:12 am »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf