Sample Patterns Explained
Using spreadsheet data entry to create test patterns allows several conveniences:
- A familiar standard interface
- Quick creation of simple patterns by copy and paste
- Analog voltages can be a function of real time by using equations
- Simplify and customize protocol data entry with sheet/cell referencing (e. g. SPI EXAMPLE)
The initial library supplied with each Validator 1 includes the following:
These files as well as new ones are always available for download from the Sample Patterns Zip File on the Support page.
The patterns listed above will be explained in more detail below.
Data Entry Blank Sheet
Data must be transferred by USB communication to the Validator in a particular format. This format can be achieved by starting with one of the supplied sample pattern worksheets, editing it, and saving as a new spreadsheet file as well as in CSV format. The CSV file must be selected for download by the host software, Validator1 ost. The worksheet, “Data Entry Blank Sheet”, is available for starting a new pattern from scratch.
An explanation of the file editing follows and is also presented in the User Guide:
- Setup data is a onetime entry in line 7.
- If time is used in formulas or for debugging, cell D16 must hold the correct Line Clock frequency.
The Line Clock frequency is calculated in cell D16 per the equation:
=IF(A7=0,(24000000/(IF(B7 = 0,1000000,B7))),(H7/(IF(B7 = 0,1000000,B7))))
Formula explanation:
If A7 = 0, the internal clock is selected, then the Line Clock frequency is 24Mhz divided by B7.
If A7 not equal 0, the Line Clock frequency is set by the contents of cell H7* divided by B7.
If B7 = 0, the divisor is 1,000,000.
* Cell H7 requires manual entry of the external clock frequency if the Ext Clk is selected by A7 = 1.
- After line 17, the host program reads in only lines that have a Line Number. If the Line Number cell in Column A is blank, any further data in that row is ignored. This allows annotation or other uses.
- Line Numbers must be sequential. They can be manually entered or use an equation such as the current Line Number equals the last Line Number plus one.
- For Labels entered in Column B, the Host program stores the Line Number in a memory whose address is one of the 15 possible labels, L1 through L15. Labels are an indirect reference to the Jump destination. If a Label appears more than once in Column B, only the last Line Number for which the Label appears will be kept. If a Jump specifies a nonexistent Label in Column B, the jump will still occur and it will go to Line Number 1.
- Elapsed time is calculated and shown in Column D. The formula uses another IF function:
=IF($D$16=0, 0, (C19*(1/$D$16)+D18))
Formula Explanation:
If the frequency entered is Zero, the calculated elapsed time will be zero. Otherwise the elapsed time is the number of clocks (column C) times the period of the Line Clock added to the elapsed time of the last step. Elapsed time is not used by the host program. Column D exists to allow making DAC voltages a function of time and it also allows coordinating the pattern with the time scale of a scope or analyzer.
- DAC voltages may be specified simply as a voltage, for example 5.5 or -3, or the voltage could be calculated by a formula. For example, if a sine wave is desired
V = (peak amplitude) X (sin(2πft))
Where f is the desired sine wave frequency and t is the Elapsed Time in Column D. Care needs to be exercised that the equation variables respect the performance limitations of the DACs, in particular, slew rate and settling time (see User Guide).
- DIO data entry allows the choice of driving, testing, or only be a weak pulldown. Note that during testing, the weak pulldown is also present.
- The host program quits reading lines when it sees an “End of File”. Using EXCEL to create the CSV file, the End of File is placed after the last line with data. Lines with no data between lines with data are skipped by the host.
- To create the correct number of lines:
- Copy and paste under the last existing line to create new lines. Keep in mind that formulas must be preserved.
- Select any rows that have extraneous data after the last line and delete those rows (not just the data).
Arbitrary Pulse Generator
This sample illustrates how it is possible to make data entry simple for a class of wave shapes. The objective of this spread- sheet is to emulate a pulse generator, allowing selection of frequency, amplitude, and wave shape. No other data entry is required to produce a looping reproduction of the arbitrary waveform. The looping point is determined by the DAC1 period and therefore DAC2 must have an identical period.
The waveform for this illustration arbitrarily begins at the Low Level. After the Run Button is depressed, the DAC voltage is given 1 microsecond to achieve its Low Level. This is accomplished by holding the Elapsed Time at 0 for the first 24 clocks of the 24Mhz internal clock. At Line 25 the Time Low begins and the Elapsed Time is no longer Zero. After the Time Low is achieved, the formula for the Rise Time is used to calculate the DAC voltage. After the High Level is achieved, time passes for the specified Time High. Then the waveform returns to the low level at the calculated Fall Time (Fall Time equals the remainder of the period, a calculation rather than data entry).
Because the sequencing of the waveform is fixed and the slope formulas work the same rising or falling, it is possible to enter high level data in the time slot reserved for the low level and vice versa. This can be useful to create differential signals.
With the Line Clock at 24Mhz, the maximum period is roughly 170usec. The maximum period can of course be extended by increasing the Clock Divide variable in B7.
Periods less than 1 microsecond may not be useful because of slew rate and settling time issues.
The selections shown above for time and amplitude yield the following repetitive waveforms:
A few comments about this spreadsheet design:
- The host program ignores what is in rows 18 to 40 because column A has no data entries.
- The automatic loop size (period) is created by the formula in Column E:
=IF(((D65>=($E$22*0.000001))*AND(D64<=($E$22*0.000001))), “JP”,””)
In essence, if Elapsed Time has crossed the period ($E$22) boundary, then JP is entered in Column E.
- The DAC voltage formula below uses Elapsed Time to determine the appropriate equation or value to use.
=IF((D65>($E$25*0.000001)), (IF((D65>(($E$25+$E$26)*0.000001)), (IF((D65>(($E$25+$E$26+$E$27)*0.000001)), (IF((D65>=($E$22*0.000001)), $E$23, ((-((D65-(($E$25+$E$26+$E$27)*0.000001))/($E$28*0.000001))*($E$24-$E$23))+$E$24))), $E$24)), ((((D65-($E$25*0.000001))/($E$26*0.000001))*($E$24-$E$23))+$E$23))), $E$23)
- Any of the variables – rise, fall , high, and low times — can be zero. It should be possible to extend the concept to waveforms requiring more than just 4 segments.
Arbitrary Sine Generator
This sample is much the same as the Arbitrary Pulse sample above. The DAC voltage equations have been changed and a phase variable for the DAC2 channel is added.
The above pattern yields the repetitive waveforms below:
Breakout Voltage Translate
The Breakout Board has the circuitry to translate a DIO channel’s 3.3V to anywhere between 1.8V and 5.5V. Since a DIO channel is bidirectional, for every translated channel, another channel must be sacrificed to tell the translator which direction to drive. Therefore the maximum number of translated channels is 8. The translation circuitry includes 20K pull downs at both the Direction input and the translation side of the channel interface. This allows setting up translation for only the number of channels needed. Unused channels would be left open at the Breakout Board inputs.
The sample pattern BREAKOUT VOLTAGE TRANSLATE provides a method to program a pattern without worrying about the Direction input. There are two sheets in this file:
“VOLTAGE TRANSLATE DATA ENTRY” Sheet
This is the data entry sheet, just like other patterns excepting there are only 8 DIO channels. To create your pattern, fix up this sheet for the required Setup and Line data.
“CSV SAVE THIS SHEET” Sheet
After you have finished creating the new pattern on the “VOLTAGE TRANSLATE DATA ENTRY” sheet, click the first sheet “CSV SAVE THIS SHEET”.
This sheet needs one bit of housekeeping: The number of Lines must be adjusted to equal the number of Lines in the “VOLTAGE TRANSLATE DATA ENTRY” sheet. As you paste new lines containing the formulas of the existing lines, you will see the data automatically appear.
Now, while having this sheet in view, save it as a CSV file. Now the translated pattern, “CSV SAVE THIS SHEET” (or whatever you want to name it) is ready to Download. Before running the pattern, remember to setup up the Breakout Board supplies:
- If you are translating to 5V, choose the jumper position on the Breakout Board as below:
You will only need to attach a supply to the red 5V terminal to make a 5V translation. The 3.3V terminal is a regulated output. - If you are translating to another voltage, move the jumper to the right and connect a 5V supply to the red terminal and connect another supply which will set the new level at the yellow 1.8-5.0V terminal.
SPI Example
SPI communication is highly custom with several different formats. To show how convenient data entry might be setup, mode 00 was arbitrarily chosen along with a communication cycle of two 8 bit words in a single Chip Select cycle. The sheet labeled “SPI DATA ENTRY SHEET” requires only Hex data to send an arbitrary 3 cycles of data exchange. The envisioned application would accept the first byte as a command to either Read or Write data from the host controller (Validator). The second byte is either data to be written to the slave or hold the SI pin at Ground if the command is a Read. The SO channel could be tested.
To create the conversion to Validator format, the Hex number is converted to binary. The binary occupies two cells for pasting data. One cell goes to the SI cell for when SCK is low and then the duplicate cell goes to the SI cell when SCK is high.
The first sheet, “SPI CSV SHEET”, receives the converted data in the shaded areas. The far right columns are the signals, CSN, SCK, SI, and SO. Data expected at SO during Read cycles could be screened with the Jump if Fail command.
As before, the download file is created by saving the sheet “SPI CSV SHEET” in csv format.
SPI Example produces 3 successive two 8 bit word sequences :
Summary
The first objective of the supplied sample patterns is to provide a format for creating usable CSV files for download to Validator 1. The Data Entry Blank Sheet is a basic starting point. Included in the package of sample pattern files and not discussed above, are others that further illustrate the use of commands and offer example patterns of maximum length.
A second objective is to show how one might develop a personal utility that would require minimal data input to automatically create waveforms and protocols that might frequently be needed.
When the workload presents the need to create a variety of setup patterns and waveforms, Validator 1 could be the quick solution. It may also be the fun solution when imagination and ingenuity are called to play and produce a valued utility.
Check the Support page for further additions to the list of patterns. It is the objective of SequimTek.com to continuously deliver new applications.