SP1000G series Pattern generator

In this chapter, we will focus on how to simply generate a signal using the Pattern Generator section in 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 available 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 and sends pattern data to the SP1000G device, which will generate the pattern and capture logic signals while generating.

Add a pattern generator script

At the moment of writing 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 your 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 to be generated (a 0 or a 1).

  • A column represents a signal, which will be generated and displayed on a channel.
  • You can use the first line to write headers.
  • You can fill a “time” 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).

Alternatively, you can skip the “time” column, and consider that each line in the CSV file represents one sample time.

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 used the first line as a header, 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 the 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 :
    • Attribute a column to each channel according to your CSV file structure, 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” (0 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 on your use.
  9. Click on Finish.

Start generation

  1. On the top left corner, 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

This script aims to help you scan an I2C bus to find all valid addresses, i.e. addresses for which a device responds (with an acknowledgment). 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 summarize, 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 panel, 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 decoder. Click yes and configure that I2C Scanner protocol 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 applications, like light dimming, motor control, or servomotor during. It’s a square signal whose duty cycle can be modified for each time period, which is constant. The PWM generator scripts allow you to use the Pattern Generator to generate such PWM signals.

Generate the signal

  1. Launch ScanaStudio, then create a WorkSpace with your device as shown earlier on this page.
  2. Open the Pattern Generator panel 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 signals, select “fixed duty cycle”,
    • If you want a duty cycle that varies over time*, select a *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 an 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 it 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 an 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). In this section, we’ll cover using the Pattern Generator to generate FM signals.

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 a 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 an 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 it 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 on 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 possibilities that can be achieved using the scripting interface.