AN-1116 One-Shot Pulse Generator

In this App Note we will explain how to create a 4-channel One-Shot Pulse generator in a GreenPAK SLG46533V device. This design will allow a user to create four asynchronous One-Shot signals of different lengths ranging from 1µs to 32s. Two of the one shots are active HIGH and two are active LOW. However, it would only take a few simple changes to make any of the one-shots active HIGH or active LOW.

This design also automatically powers down the oscillator blocks to save current while waiting for a one-shot pulse to be triggered.

This App Note references AN-1090: Simple I2C IO Controllers with SLG46531V which describes how to use I2C with GreenPAK devices.

GreenPAK Design

This design uses four independently triggered one-shot counters with selectable clock sources. CNT2, CNT3 and CNT5 are used as clock dividers to create 2kHz, 1kHz, and 1MHz clock sources. SEL0:SEL3 determine which clock source is selected for each of the one-shots, while a HIGH pulse on IN0:IN3 will trigger that signal’s corresponding one-shot.

CNT0 and CNT1 are both 16 bit counters with values ranging from 1d:65535d, and each of their clock sources can be muxed between a 2kHz clock and a 25MHz clock using look up tables (LUT) 3-bit LUT0 and 3-bit LUT1.

When the user desires the 2kHz clock source, they would set the corresponding SEL signal LOW, while if they wanted the 25MHz clock, they would set it HIGH.

When they wish to trigger a one-shot pulse, they would send a short active-HIGH pulse to IN0 or IN1.

CNT4 and CNT6 are both 8-bit counters with values between 1d:255d, and their available clock sources are a 1kHz clock or a 1MHz clock. The SEL and IN signals are similarly controlled via the I2C Virtual Input block. The different clock frequencies were chosen to give the user a wide variety of available one-shot lengths.

Table 1 shows the speed and the output time range options for each of the four one-shots.

One Shot CNT0 & CNT1 CNT4 & CNT6
Counter Data Min 1 1
Max 65535 255
Clock Source 0 Speed 2kHz 1kHz
Min 1.5ms 3ms
Max 32.77s 257ms
Formula for length of time 1.5 + 0.5*(n-1) ms 3 + 1*(n-1) ms
Clock Source 1 Speed 25MHz 1MHz
Min 0.12µs 3µs
Max 2.6215ms 257µs
Formula for length of time 0.12 + 0.4*(n-1) µs 3 + 1*(n-1) µs

 

Table 1. One-Shot Options

The look up tables at the bottom of Figure 1 control the oscillator power down signal. The three OR gates (3-bit LUT11/12/13) are used to clock DFF7, which sends a LOW signal to both OSC1 and OSC2’s PWR DOWN pins, allowing them to turn on. Once all of the one shots return to their default states, the other four LUTs and the rising edge detector PDLY set the DFF output HIGH again, which powers down both oscillators.

Initially, OneShot0 and OneShot2 are configured as active-HIGH one-shots while OneShot1 and OneShot3 are configured to be active-LOW. To change these settings, open up the counter’s properties panel and change the output polarity as shown in Figure 2. Then alter the logic in 2-bit LUT0/1 to go HIGH when the one-shots return to their default states.

GreenPAK Design

Figure 1. GreenPAK Design

CNT1 Properties Panel

Figure 2. CNT1 Properties Panel

I2C Commands

The directions below will walk the user through the process of generating an I2C command to create their desired one-shot output. They explain how to find the correct I2C address for each CNT/DLY block and how to write a value to a desired counter. They also explain how to change the multiplexer SEL and counter IN signals by finding the proper bit in the I2C Virtual Input byte, and writing a value to that location. For more information about how to use I2C with GreenPAK devices, please read App Note AN-1090.

1. Write a value to the desired counter.

1.1. The I2C address for each of the counter blocks is:

1.1.1. CNT0: 0xC6 (bits 15:8), 0xC5 (bits 7:0)

1.1.2. CNT1: 0xC8 (bits 15:8), 0xC7 (bits 7:0)

1.1.3. CNT4: 0xC2

1.1.4. CNT6: 0xC4

1.2. Value ranges:

1.2.1. CNT0/CNT1 = 1 to 65535 or 0x0001 to 0xFFFF

1.2.2. CNT4/CNT6 = 1 to 255 or 0x01 to 0xFF

1.3. To write a value to a counter, the I2C command is:

1.3.1. [0x00 0x<counter address> 0x<value>]

2. Write a start command to the I2C Virtual Inputs block including SEL and IN signals for your desired one-shots.

2.1. The address of the I2C Virtual Input block is 0xF4, so the structure of the start byte is: [0x00 0xF4 0x<start byte>]

2.1.1. To construct the start byte, determine which clock source you want to use and which one-shots you wish to trigger by referencing Table 2 below.

2.1.2. Be careful not to toggle a SEL bit while its corresponding one-shot is running, because it would alter the one-shot’s clock source.

2.2. For example, to trigger CNT0 on Clock Source 0 and CNT1 on Clock Source 1 at the same time, you want to set IN1, IN0, and SEL1 HIGH, and set SEL0 LOW.

2.2.1. The I2C command in this case is: [0x00 0xF4 0x32]

3. Write a reset command to the I2C Virtual Inputs block to prepare it for the next start command. The reset command will not affect the values you wrote to the four counters.

3.1. The reset command is similar to the start command, but you want to reset all of the IN signals to 0. You should leave the SEL bits alone to avoid accidentally toggling a clock source while its one-shot is running.

3.2. The reset command structure is: [0x00 0xF4 0x0?] where “?” contains the active SEL signals.

Waveform

Figure 3 below is a waveform of OneShot0 and OneShot1 and several signals that affect them. As you can see, the oscillators power off once the One-Shot pulses run their course. The corresponding probe points are:

D0 – OneShot0 clock

D1 – OneShot0 output

D2 – OneShot1 clock

D3 – OneShot1 output

D4 – SEL0

D5 – SEL1

D6 – IN0

D7 – IN1

D8 – I2C SCL

D9 – I2C SDA

One-Shot Waveform

Figure 3. One-Shot Waveform

The I2C commands used were: [0x00 0xF4 0x31] [0x00 0xF4 0x01]. Referring to Table 2 above, we wanted to trigger OneShot0 and OneShot1, so the first nibble of the Start command’s byte value is “3”. We then set OneShot0 to the 25MHz clock source and OneShot1 to the 2kHz clock source with the second nibble “1”. When we sent the reset command, we set IN0 and IN1 LOW, while keeping the SEL signals the same, so our reset command’s byte value is 0x01.

I2C Virtual Output Bit 7 6 5 4 3 2 1 0
Signal IN3 IN2 IN1 IN0 SEL3 SEL2 SEL1 SEL0

 

Table 2. Start Byte Configuration

Conclusion

In this app note we used a Silego SLG46533V GreenPAK device to create a 4-channel one-shot generator controlled with I2C. A few advantages with this design are near-zero standby current, and easy on the fly reconfiguration of the one-shot lengths. This design leaves quite a few blocks unused, including several look up tables, ACMPs, DFFs, as well as a handful of other blocks. A user could easily absorb more functionality into this project to save room on their PCB.

About the Author

Name: David Riedell

Background: David attained a BS in Computer Engineering from North Carolina State University. He is currently working with CMICs as an applications engineer at Silego Technology.

Contact: appnotes@silego.com

 

Files



See full list of Application Notes