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 :
- You add a pattern generator script in
Pattern Generator
section, - Then, you have to click on
Start Generate and Capture
, 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.
At the moment of writing this document, the pre-existing scripts are :
- CSV importer : to build a signal from a CSV file,
- I2C scanner : to generate a series of I2C address calls, the purpose being to find addresses for which a device responds,
- PWM : to generate a PWM signal,
- 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
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):
- If you didn’t indicate time (raw logic signals; 1 sample per line):
Generate the signal
- Launch
ScanaStudio
, then create a WorkSpace with your device, Pattern Generator
->Add script
-> CSV import ->Next
,- Browse your CSV file,
- Check the checkbox “*Skip the first line (used as header)” if, in your CSV file, you have used the first line as a header,
- 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),
- 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.
- 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),
- In CSV Mapping :
- Attribute a column to each channel according to your CSV file structure,
- Be careful to not attribute the time column to a channel (if you have one).
- Attribute a column to each channel according to your CSV file structure,
- 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.
- Enter your column separator. The default value is a
- 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.
- Click on
Finish
.
Start generation
- 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) - 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:
I2C scanner script
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
- Launch
ScanaStudio
, then create a WorkSpace with your device (as described above) - Open the
Pattern Generator
panel, then clickAdd script
and select I2C scanner from the list, then hitNext
- Select the channel on which you want to generate I2C signals :
- SDA (data),
- SCL (clock).
- 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,
- 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,
- Configure any other options related to I2C bus decoding as you would normally do when applying a decoder.
Start generation and capture bus response
- On the top left corner, Click on
Start generate and capture
, - After the signals are generated and the bus response is captured, you shall be able to see decoded I2C signals as shown below:
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
- Launch
ScanaStudio
, then create a WorkSpace with your device as shown earlier on this page. - Open the
Pattern Generator
panel and add a PWM script to the WorkSpace. - Choose the channel on which you want to display your PWM signal.
- 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.
- 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.
- 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.
- 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
- On the top left corner, you can click on
Start generate and capture
, and the PWM signals will be generated and captured back.
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
- Launch
ScanaStudio
, then create a WorkSpace with your device - Open the
Pattern Generator
pannel and Frequency Modulation script, - Choose the channel on which you want to generate your signal,
- 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.
- 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.
- 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).
- Click on
Finish
.
Start generation
- 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.