SP1000G series Pattern generator

In this chapter, we will focus on how to simply generate a signal using the Pattern Generator section on ScanaStudio. Please note that we are not going to get into the details of how to build complex signals. If you want to know more about this subject, you can read the chapter Pattern Generator Scripts. In this section, we focus on the basic pattern generation features that are avaialble without any scripting requirements.

For your SP1000G series device, signals generation works with a Pattern Generator as follows :

  1. You add a pattern generator script in Pattern Generator section,
  2. Then, you have to click on Start Generate and Capture,
  3. ScanaStudio executes the script that builds the pattern, sends pattern data to the SP1000G device, which will generate the patern and capture logic signals while generating.

Add a pattern generator script

At the moment of writing of this document, the pre-existing scripts are :

  1. CSV importer : to build a signal from a CSV file,
  2. I2C scanner : to generate a series of I2C address calls, the purpose being to find addresses for which a device responds,
  3. PWM : to generate a PWM signal,
  4. Frequency Modulation : to generate an FM signal.

More scripts are added as requests are made or when new applications are submitted to our teams. Please don’t hesitate to share you specific application.

CSV importer pattern generator

CSV with time, display a counter

Principle

The aim is to build signals from a CSV file to be able to generate them using a capable device (like SP1000G or older SQ devices).

Create a CSV

A CSV file is close to an Excel file ; you can edit it by using Excel or a text editor, such as WordPad.

First, you need to create a CSV file, in which you fill in the signal (with in each cell a 0 or a 1) that you want to model.

  • A column represents a signal, which will be generated and displayed on a channel.
  • You can use the first line to write headers to indicate the corresponding channel for instance.
  • You can fill a column, for instance the first one, with the time you want the bits of a certain logic level to remain at that level (this is also called compressed signals, as only transitions are stored in the CSV file).

These last two points are optional. When you want to generate a signal on ScanaStudio, a user interface will asked you :

  • If you want to use the first line as headers.
  • To fill in the correspondence between a channel and a column.
  • If a column, for instance the first one, is used as a time column (an arbitrary duration will be set otherwise).

Thus, your CSV could look like one of the following two options :

  • If you used a column for time (compressed signals) : CSV with time
  • If you didn’t indicate time (raw logic signals; 1 sample per line): CSV without time

Generate the signal

  1. Launch ScanaStudio, then create a WorkSpace with your device, Step 1
  2. Pattern Generator ??? Add script ??? CSV import ??? Next, Step 2
  3. Browse your CSV file, Step 3
  4. Check the checkbox “Skip the first line (used as header)” if in your CSV file, you have written in the first line a name for each column (so not a bit), Step 4
  5. In “Select CSV file structure” :
    • Select “One or more transition per line” if you’re working with a “compressed timings” CSV file (one with a column for time) In this case, you have to fill the column time (be careful to indexing, first column is Column 0), Step 5 time
    • Select “One sample per line (fixed period per line)” if you’re using a raw CSV file (one sample per line). In this case, you have to fill the sampling period. Step 5 no time
  6. In CSV Mapping :
    • Enter on the available channels the columns you want to view, Step 6
    • Be careful to not attribute the time column to a channel (if you have one). Step 6
  7. In CSV Format :
    • Enter your column separator. The default value is a ; because it’s the most common one, but you can check by opening your CSV with a text editor,
    • Enter the separator you used for the decimals of your time column (either , or ;). If you don’t have one, you can select whichever. Step 7
  8. In Electrical choices :
    • Set the “Voltage output” in milliVolts (mV),
    • Set the “Idle State” (O or 1), which is the value taken when no signal is generated,
    • Set the “I/O type”, with open drain or push-pull. Push-pull output configuration is the most implemented type, but it depends of your use.
  9. Click on Finish.

Start generation

  1. On the top left corner, you can click on Start generate and capture. The signals will be generated and captured back (if the probes are floating or connected to high impedance inputs) Step 10
  2. Once capture is done, you can navigate through the captured samples. So, if the CSV described a binary counter pattern, you would observe signals similar to the capture below : Step 11

I2C scanner script

CSV with time, display a counter

Principle

The aim of this script is to help you scanning an I2C bus to find all valid adresses, i.e. addresses for which a device responds (with an acknowledgement). This script isn’t intended to be a fully functional I2C analyzer, but rather a simplified version that focuses on finding devices on a bus.

To summerize, in this case, Pattern Generator is used to generate a series of I2C address calls. Then, signal activity on the bus will be decoded by an I2C protocol decoder.

Generate the signal

  1. Launch ScanaStudio, then create a WorkSpace with your device (as described above)
  2. Open the Pattern Generator pannel, then click Add script and select I2C scanner from the list, then hit Next
  3. Select the channel on which you want to generate I2C signals :
    • SDA (data),
    • SCL (clock). Step 3
  4. Enter an I2C clock frequency, and check whether or not you want to skip reserved I2C addresses, Be careful to not enter a too high I2C frequency compared to the current sampling rate,
  5. When you click on Finish, ScanaStudio will suggest adding a protocol decoeder. Click yes and configure that I2C Scanner plrotocol using the same channel that you selected previously, Step 4
  6. Configure any other options related to I2C bus decoding as you would normally do when applying a decoder.

Start generation and capture bus response

  1. On the top left corner, Click on Start generate and capture,
  2. After the signals are generated and the bus response is captured, you shall be able to see decoded I2C signals as shown below: Step 10

PWM generator script

Principle

A PWM (Pulse Width Modulation) signal is used for many application, like light dimming, motor control, or servomotor diring. It’s a square signal whose duty cycle can be modified for each time period, which is constant. The PWM generator scripts allows you to use the Pattern Generator to generate suck PWM signals.

PWM in a nutshell

A PWM signal is composed of a series of pulses, on which the duty cycle of a pulse train can be modified according to your use - for instance, to set the position to be reached by the servomotor (setpoint).

PWM works with a fixed frequency; indeed, a pulse lasts a constant time period T, divided into a Ton variable period (in which PWM = 1) and a Toff period (in which PWM = 0). The duty cycle is given by the ratio Ton/T ; it corresponds to the time percentage on which the signal is at 1, compared to the time on which the signal is at 0, i.e. the proportion of Ton and Toff in the constant time period T.

Depending on your use, you could need either a fixed duty cycle or a duty cycle which varies over time. To do so, the method could be roughly summed up as “linking” your duty cycle over time to the amplitude of another signal. In other words, your duty cycle can be built thanks to the wave of your modulation signal (a sinusoidal, sawtooth or triangular signal).

Generate the signal

  1. Launch ScanaStudio, then create a WorkSpace with your device as whown earlier in this page.
  2. Open the Pattern Generator pannel and add a PWM script to the WorkSpace.
  3. Choose the channel on which you want to display your PWM signal. Step 2 bis
  4. Select the type of signal :
    • If you want a constant duty cycle during all your PWM signal, select “fixed duty cycle”,
    • If you want a duty cycle which varies over time, select modulated frequency.
  5. If you have selected “fixed duty cycle” :
    • Enter a frequency, which is the frequenCy of the PWM signal in Hz, kHz or MHz ; keep in mind that the minimum duration of a pulse (T) is given by your maximum output frequency (125MHz for a SP1000G series device),
    • Enter, in percentage, the value of the duty cycle, given by the ratio Ton/T,
    • Enter the number of cycles you want to generate, that is the number of pulses. Step 3_fixed
  6. If you have selected modulated frequency :
    • Enter a modulation type, which can be a sine, a triangle or a sawtooth wave,
    • Enter the modulation frequency in Hz, kHz or MHz, which is the frequency of your sine, a triangle or a sawtooth signal,
    • Enter the modulation phase in degrees (if unsure, leave as 0),
    • Enter the number of cycles you want to generate, that is the number of pulses,
    • Enter the carrier frequency, which is the frequency of the PWM signal in Hz, kHz or MHz ; keep in mind that the minimum duration of a pulse (T) is given by your maximum output frequency (125MHz for a SP1000G series device). Moreover, carrier frequency must be higher than modulation frequency. Step 3 mod
  7. When you click on Finish, ScanaStudio will suggest adding a protocol decoder to help you decode and visualize the PWM signals. This option can be omitted if not needed.

Start generation

  1. On the top left corner, you can click on Start generate and capture, and the PWM signals will be generated and captured back.

PWM with 30% duty cycle

Frequency Modulation script

Principle

A Frequency Modulated (FM) signal is also a square signal (as a PWM signal), whose duty cycle is constant but the frequency can be modified for each time period (one square). Here, Pattern Generator will help you to generate this signal.

Frequency modulation in a nutshell

An FM signal can be seen as a square signal whose the period T of a square can be changed over time. However, Ton (signal = 1) and Toff (signal = 0) are invariant because the duty cycle is fixed over time. Thus, if you want to modulate your signal, you have to do it by changing the time period of a square, thus by changing frequency over time.

You can note that if you make a FM signal by using a fixed frequency named f with a duty cycle D, you could obtain the same signal as with a PWM, if you did it at f frequency with a fixed duty cycle D.

Depending on your use, you could need either a fixed frequency or a frequency which varies over time. To do so, the method could be roughly summed up as “linking” your frequency over time to the frequency of another signal. In other words, your frequency can be made to vary according to your modulation signal (a sinusoidal, sawtooth or triangular signal).

Generate the signal

  1. Launch ScanaStudio, then create a WorkSpace with your device
  2. Open the Pattern Generatorpannel and Frequency Modulation script,
  3. Choose the channel on which you want to generate your signal, Step 3
  4. Select the type of signal :
    • If you want a constant frequency, so a constant duty cycle (of 50%) during all your signal, select “fixed frequency”,
    • If you want a variation in your pulses over time, select modulated frequency.
  5. If you have selected “fixed frequency” :
    • Enter a frequency, which is the frequency of the signal in Hz, kHz or MHz ; keep in mind that the minimum duration of a pulse (T) is given by your maximum output frequency (125MHz for a SP1000G series device),
    • Enter the number of cycles you want to generate, that is the number of pulses.
  6. If you have selected modulated frequency :
    • Enter a modulation type, which can be a sine, a triangle or a sawtooth wave,
    • Enter the modulation frequency in Hz, kHz or MHz, which is the frequency of your sine, a triangle or a sawtooth signal,
    • Enter the number of cycles you want to generate, that is the number of pulses,
    • Enter the modulation phase in degrees (if unsure, leave as 0). Step 4
  7. Click on Finish.

Start generation

  1. On the top left corner, you can click on Start generate and capture

Conclusion

This concludes this chapter about Pattern Generator. As described in this page, simple signals can be generated using the GUI interface, without any programming skills involved. That being said, we highly encourage you to explore all the possiblities that can be achieved using the scripting interface.