Qucs. A Tutorial. Modelling the 555 Timer. Mike Brinson. Copyright c 2006 Mike Brinson

Similar documents
ASTABLE MULTIVIBRATOR

HIGH LOW Astable multivibrators HIGH LOW 1:1

555 Timer and Its Application

Multivibrators. Department of Electrical & Electronics Engineering, Amrita School of Engineering

EG572EX: ELECTRONIC CIRCUITS I 555 TIMERS

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

PRESENTATION ON 555 TIMER A Practical Approach

Chapter Timer IC. NE555 from Signetics in dual-in-line package WORLD TECHNOLOGIES

CHAPTER 4: 555 TIMER. Dr. Wan Mahani Hafizah binti Wan Mahmud

LM555 and LM556 Timer Circuits

Electronic Instrumentation

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2

PWM BASED DC MOTOR SPEED CONTROLLER USING 555 TIMER

Analog Electronic Circuits Lab-manual

ZSCT1555 PRECISION SINGLE CELL TIMER ISSUE 2 - MAY 1998 DEVICE DESCRIPTION FEATURES APPLICATIONS SCHEMATIC DIAGRAM

PHYS225 Lecture 18. Electronic Circuits

ENGR-4300 Fall 2006 Project 3 Project 3 Build a 555-Timer

1.3 Mixed-Signal Systems: The 555 Timer

Oscillators are electronic circuits that produce a constant oscillating signal that can be a sinusoid, a square wave or a triangular wave.

Chapter 16: Oscillators

Lab 2 Revisited Exercise

CHAPTER 6 DIGITAL INSTRUMENTS

OBJECTIVE The purpose of this exercise is to design and build a pulse generator.

Concepts to be Reviewed

ML4818 Phase Modulation/Soft Switching Controller

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

Application Note AN-3006 Optically Isolated Phase Controlling Circuit Solution

Lab 12: Timing sequencer (Version 1.3)



555 Astable Kit MitchElectronics 2018

Introduction to IC-555. Compiled By: Chanakya Bhatt EE, IT-NU

Process Components. Process component

). The THRESHOLD works in exactly the opposite way; whenever the THRESHOLD input is above 2/3V CC

Features. Applications

Experiment EB2: IC Multivibrator Circuits

hij Teacher Resource Bank GCE Electronics Exemplar Examination Questions ELEC2 Further Electronics

Draw in the space below a possible arrangement for the resistor and capacitor. encapsulated components

University of Southern California

THIRD SEMESTER ELECTRONICS - II BASIC ELECTRICAL & ELECTRONICS LAB DEPARTMENT OF ELECTRICAL ENGINEERING

Difference between BJTs and FETs. Junction Field Effect Transistors (JFET)

Features MIC1555 VS MIC1557 VS OUT 5

MODULE TITLE : OPERATIONAL AMPLIFIERS TOPIC TITLE : OSCILLATORS LESSON 2 : RELAXATION OSCILLATORS

PIN CONFIGURATION FEATURES APPLICATIONS BLOCK DIAGRAM. D, F, N Packages

LABORATORY 6 v3 TIME DOMAIN

Lecture 14: 555 Timers

css Custom Silicon Solutions, Inc.

State Machine Oscillators

ECE 2010 Laboratory # 5 J.P.O Rourke

MC3456 DUAL TIMING CIRCUIT

Regulating Pulse Width Modulators

SG2525A SG3525A REGULATING PULSE WIDTH MODULATORS

LM2240 Programmable Timer Counter

Exam Booklet. Pulse Circuits

NE555, SA555, SE555 PRECISION TIMERS

Police Siren Circuit using NE555 Timer

For the op amp circuit above, how is the output voltage related to the input voltage? = 20 k R 2

Applications of the LM392 Comparator Op Amp IC

Electric Circuit Fall 2017 Lab8 LABORATORY 8. Audio Synthesizer. Guide

Current-mode PWM controller

UNIT-V: WAVEFORM GENERATORS AND SPECIAL FUNCTION ICs. PARTA (2 Marks)

CA555, CA555C, LM555, LM555C, NE555

LINEAR IC APPLICATIONS

UC Berkeley, EECS Department

DATA SHEET. HEF4047B MSI Monostable/astable multivibrator. For a complete data sheet, please also download: INTEGRATED CIRCUITS

Applications. NS Part Number SMD Part Number NS Package Number Package Description LM555H/883 H08A 8LD Metal Can LM555J/883 J08A 8LD Ceramic Dip

To design/build monostable multivibrators using 555 IC and verify their operation using measurements by observing waveforms.

ECE:3410 Electronic Circuits

Module -18 Flip flops

ENGR4300 Fall 2005 Test 4A. Name. Section. Question 1 (25 points) Question 2 (25 points) Question 3 (25 points) Question 4 (25 points)

DUAL TIMING CIRCUIT SEMICONDUCTOR TECHNICAL DATA PIN CONNECTIONS ORDERING INFORMATION. Figure Second Solid State Time Delay Relay Circuit

A Simplified Test Set for Op Amp Characterization

ENGR-4300 Electronic Instrumentation Quiz 3 Fall 2010 Name Section

6V to 12V dc-dc boost converter using 555 timer IC

Electronic Circuits EE359A

EE 3101 ELECTRONICS I LABORATORY EXPERIMENT 9 LAB MANUAL APPLICATIONS OF IC BUILDING BLOCKS

CMOS Schmitt Trigger A Uniquely Versatile Design Component

Electric Circuit Fall 2016 Pingqiang Zhou LABORATORY 8. Audio Synthesizer. Guide

55:041 Electronic Circuits

Features. Applications

Driving High Intensity LED Strings in DC to DC Applications D. Solley, ON Semiconductor, Phoenix, AZ

LM2935 Low Dropout Dual Regulator

Lab 6: Exploring the Servomotor Controller Circuit

Resonant-Mode Power Supply Controllers

1 sur 8 07/04/ :06

UNISONIC TECHNOLOGIES CO., LTD USA555 Advance LINEAR INTEGRATED CIRCUIT

Q1. Explain the Astable Operation of multivibrator using 555 Timer IC.

Government Polytechnic Muzaffarpur Name of the Lab: Applied Electronics Lab

LM2907/LM2917 Frequency to Voltage Converter

Analog Circuits Part 3 Operational Amplifiers

High Current MOSFET Toggle Switch with Debounced Push Button

NJM4151 V-F / F-V CONVERTOR

Achieving a Single Phase PWM Inverter using 3525A PWM IC

ELEC2 (JUN15ELEC201) General Certificate of Education Advanced Subsidiary Examination June Further Electronics TOTAL. Time allowed 1 hour

Dev Bhoomi Institute Of Technology Department of Electronics and Communication Engineering PRACTICAL INSTRUCTION SHEET REV. NO. : REV.

LF442 Dual Low Power JFET Input Operational Amplifier

Comparators, positive feedback, and relaxation oscillators

LM139/LM239/LM339 A Quad of Independently Functioning Comparators

Transcription:

Qucs A Tutorial Modelling the Timer Mike Brinson Copyright c 26 Mike Brinson <mbrin7243@yahoo.co.uk> Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. A copy of the license is included in the section entitled GNU Free Documentation License.

Introduction The r was designed by Hans R. Camenzind in 197 1 and first produced by Signetics during the period 1971-1972 2. The device was originally called The IC machine and given the part number SE/NE. Over the last 3 plus years more than ten different semiconductor chip production companies have made parts, making it one of the most popular ICs of all 3. Today it is still used in a wide range of circuit applications. The r is one of the first examples of a mixed mode IC circuit that includes both analogue and digital components. The primary purpose of the r is the generation of accurately d single pulse or oscillatory pulse waveforms. By adding one or two external resistors and one capacitor the device can function as a monostable or astable pulse oscillator. The r is a difficult device to simulate. During circuit operation it switches rapidly between two very different DC states 4. Such rapid changes can be the cause of simulator DC convergence and transient analysis errors. Most of the popular simulators include some form of r model, either built-in or as a subcircuit, which functions to some degree. These models usually include a number of p-n junctions and non-linear controlled sources, making simulation s longer than those obtained with simpler models. At the heart of the r are two comparators and a set-reset flip flop. A block diagram of the main functional elements that comprise the r is illustrated in Fig. 1. The current Qucs release does not include a model for the r. The purpose of the work reported in this tutorial note has been to develop a r model from scratch which simulates efficiently, and is based only on the circuit components implemented in Qucs..1. Moreover, while developing the Qucs model every attempt has been made to reduce the number of p-n junctions to a minimum, yielding both model simplicity and reduced circuit simulation s. The approach adopted is centred on established macromodelling techniques where signals at the r device pins accurately model real device signals but internal macromodel signals often bare no relation to those found in an actual device. Internally, the macromodel simply processes input signal information and outputs signals, in the correct format, to the device output pins. In no way is an attempt made to simulate the actual r circuitry. 1 See The Timer IC. An interview with Hans Camenzind - The designer of the most successful integrated circuit ever developed, http://semiconductormuseum.com/transistors/lecturehall/ Camenzind/ 2 Now part of the Philips organisation. 3 Recent manufacturing volumes indicate that the r is as popular as ever, with for example, Samsung (Korea) producing over one billion devices in 23; see Wikipedia entry at http: //en.wikipedia.org/ 4 Typically between ground and a voltage close to power rail. 1

P_1 TRIG DIS P_ET1 R1 R=k TH CON P_THH1 + THH DIGITAL LOGIC SUB6 File=r_.sch P_CONTROL1 R2 R=k - SUB3 Reset Thresh Trig Q QB + AMP _ P_PUT1 P_TRIGGER1 R3 R=k + TRIG - SUB4 SUB Discharge Switch SUB2 P_1 P_DISCHARGE1 Figure 1: Timer functional block diagram. The Qucs r model Fig. 1 illustrates the new Qucs r model. In this model each of the major functional blocks have been separated into macromodel subcircuits, grouping similar types of component together. Essentially, the model only includes standard Qucs components which all work together to produce the correct output signals through careful selection of threshold parameters, voltage limits, logic levels and rise and fall s. These notes concentrate on explaining the structure and parameters of the macromodel subcircuits that form the r model, rather than describing the function of the device. The r is an 8 pin device with: Pin 1 Ground [] - Most negative supply connected to the device, normally this is common ground (V). Pin 2 Trigger [TRIG] - Input pin to the lower comparator. Used to set the RS latch. Pin 3 Output [] - The r output signal pin. A good tutorial guide to the operation of the r can be found at http://www.uoguelph.ca/ ~antoon/gadgets//.html 2

Pin 4 Reset [] - Used to reset the RS latch. Pin Control [CON] - Direct access point to the (2/3) divider node. Used to set the reference voltage for the upper comparator. Pin 6 Threshold [THH] - Input pin to upper comparator. Used to reset the RS latch. Pin 7 Discharge [DIS] - Collector output of an npn BJT switch. Used to discharge the external timing capacitor. Pin 8 [] - Most positive supply connected to device, normally this is V, 1V or 1V. The trigger comparator macromodel The trigger comparator input pins are connected between the (1/3) divider node and device package pin 2 (TRIG). Trigger input signals dropping below the (1/3) divider node voltage cause the trigger output voltage to switch, setting the RS latch in the digital logic subcircuit. This action also causes the r output signal to go high. The trigger input is level sensitive. Retriggering will occur if the trigger pulse is held low longer than the r output pulse width. The trigger comparator circuitry also has a storage of several microseconds, limiting the minimum monostable output pulse to around 1µS. A DC current, popularly referred to as the trigger current, flows from device pin 2 (TRIG) into the external circuit. This has a typical value of na, setting the upper limit of resistance that can be connected from pin 2 to ground 6. The circuit diagram of the trigger comparator macromodel is shown in Fig. 2. The differential input signal is sensed by operational amplifier OP1. This has it s gain set to 1e6, giving a differential input signal resolution of 1µV. OP1 output voltages are limited to ±1V. Note the upper +1V signal level corresponds to a logic 1 signal. Finally, the trigger comparator output voltage rise and fall s are set by constant R1 C1. This network also adds a delay to the comparator macromodel. 6 At = V this resistance is roughly 3.3MΩ. 3

comp_vout1 Pcomp_vp1 Pcomp_vn1 OP1 G=1e6 Umax=1 V I1 I= na R1 R=1k C1 C=1 nf + TRIG - File=r_trig.sch Figure 2: Trigger comparator macromodel. The threshold comparator macromodel The threshold comparator macromodel is shown in Fig. 3. It is very similar to the trigger comparator macromodel; one noteable difference is the size and direction of pin 6 (TH) threshold DC current which is typically 1nA and flows into pin 6 from the external circuitry 7. The threshold comparator is used to reset the RS latch in the r digital logic block, causing the r output to go low. Resetting occurs when the signal applied to external pin 6 (TH) is driven from below to above the (2/3) divider node voltage. Again the threshold input is level sensitive. I1 I=.1 ua PinP1 Num=1 PinN1 Num=2 OP1 G=1e6 Umax=1 V R1 R=1k P1 Num=3 C1 C=1 nf + THH - File=r_thresh.sch Figure 3: Threshold comparator macromodel. 7 The threshold DC current sets the upper limit to the value of the external resistor that can be connected between pin 6 and the supply - for = V this is approximately 16MΩ, with = 1 V this rises to roughly 2MΩ. 4

Set (S) Reset (R) Q (P-Q1) QB (P-QB1) Notes 1 1 Set state 1 1 1 Reset state 1 1 1 Undefined Table 1: Truth table for an SR latch constructed using NOR gates. The digital logic macromodel The digital logic macromodel consists of an SR latch with additional combinational gates at the input of the model, see Fig. 4. The truth table for the SR latch is listed in Table 1. All gates in the macromodel have logic 1 set at 1V and logic set at V. RC timing networks have been added to the output of each gate, ensuring that the gates have a finite rise and fall s rather than the Qucs default value of zero seconds 8. Gate input signals with values less than the gate threshold voltage (.V) are considered to be a logic signal. A logic signal on r pin 4 () also resets the SR latch causing the output signal, pin 3 (), to move to a low state. The reset signal is an override signal in that it forces the r output to a low state regardless of the signals on other r input pins. Reset has a delay of roughly.µs, making the minimum reset pulse width of approximately.µs. The reset signal is inverted then ORed with the threshold comparator output signal. 8 In mixed mode circuit simulation transient analysis problems can occur when devices change state in zero seconds, see later notes for comments on this topic.

P_Q1 P_reset1 Y2 1 R1 R=1k C1 C=.nF Y3 1 R2 R=1k C2 C=.nF Y4 1 R4 R=1k C C=.nF Y1 1 R R=1k P_QB1 C3 C=1nF P_tresh1 P_trig1 Y 1 R3 R=1k C4 C=.9nF DIGITAL LOGIC Reset Q Thresh Trig QB File=r_digital_comb.sch Figure 4: Digital logic macromodel. The r output amplifier macromodel Illustrated in Fig. is the macromodel for the r output amplifier. This is a simple model constructed from a voltage gain block plus a resistor to represent the r output resistance. The voltage gain block has it s value set to 3. in Fig.. This is the value needed to scale the logic 1 signal voltage to the required external voltage at r output pin 3 (). This value is only correct for power supply voltage set to V, and must be changed for other voltages 9. 9 At this Qucs does not allow parameters to be passed to subcircuits, making it difficult to write generalised macromodels. Adding parameter passing to subcircuits and the calculation of component values using equations is on the to-do list. Suggested values for the amplifier gain are: (1) = V, G = 3., (2) = 1V, G = 8.V and (3) = 1V, G = 13.. These gain values correct for the voltage drop in the r totem-pole output stage. 6

Pamp_P1 SRC1 Pamp_N1G=3. T= R1 R=7 P_vout1 + _ AMP File=r_amp.sch Figure : Output amplifier macromodel. The discharge switch macromodel The discharge switch macromodel is shown in Fig. 6. Like the actual r the macromodel discharge switch is based on an npn transistor. A logic 1 signal applied to terminal pin_control_in1 turns the npn transistor on causing the path from the collector ( r pin DIS) to ground to become low resistance. It is through this branch that the r external capacitor is discharged. The reverse characteristic is observed when the input control voltage is logic. In this case the collector to ground branch has a very high resistance. Resistor R1 is included in the macromodel to limit the npn base current when the BJT is turned on. Similarly, resistor R2 has been added to the model to limit the external capacitor discharge current 1. 1 Normally the external timing capacitor is discharged through a resistor in series with the collector to ground path. However, if this series resistor is very small, or indeed does not exist, it is theoretically possible for the discharge current to become very large, which in turn leads to DC convergence errors or very long transient simulation s. 7

P_control_in1 R1 R=1K T1 Type=npn Is=1e-16 Nf=1 Vaf= Bf=1 Discharge Switch P_1 P_Discharge1 R2 R=2 File=r_Discharge.sch Figure 6: The discharge switch macromodel. Published r test circuits The majority of manufacturers outline in their r specification sheets a range of fundamental circuit applications 11. A number of these circuits are introduced as a series of simulation test cases. The conditions chosen for the simulation tests are as follows: Integration method Gear, order 6 (this method works well with circuits that contain constants that have widely different values) 12. Input driver signals have a finite rise and fall, usually in nano seconds (problems can occur when driver signals have either zero or very small rise and fall s - often a simulator will reduce the transient analysis step size in an attempt to reduce errors which in turn can significantly increase simulation run s). Transient simulation parameter MinStep is set to one hundredth, or less, of the smallest rise or fall in the circuit (this is a good rule of thumb, giving reasonable simulation s and accuracy, normally without DC convergence or transient analysis step problems). The r monostable pulse generator Figure 7 shows the basic r monostable pulse generator circuit. The output pulse width is given by the equation T = 1.1 R C1; when R = 9.1k and C1 =.1µF, T = 1ms. Figure 8 illustrates the simulation waveforms for the monostable oscillator. 11 See for example the Applications Information section of the National Semiconductor LM Timer data sheet, July 26, www.national.com. 12 One of the simulation tests also presents results using the standard trapezoidal second order integration method. 8

R R=9.1k V1 U= V vtrig C1 C=.1 uf transient simulation TR1 Type=lin Start= Stop=.6ms IntegrationMethod=Gear Order=6 V U1= V U2= V T1=.3ms T2=.3 ms Tr= ns Tf= ns vout reset TRIG V4 U1= V U2=V T1=.1ms T2=.1ms DIS TH CON C2 C=.1uF vdis Figure 7: The basic r monostable pulse generator. 9

reset.vt e- 1e-4 1.e-4 2e-4 2.e-4 3e-4 3.e-4 4e-4 4.e-4 e-4.e-4 6e-4 vtrig.vt e- 1e-4 1.e-4 2e-4 2.e-4 3e-4 3.e-4 4e-4 4.e-4 e-4.e-4 6e-4 vdis.vt 4 e- 1e-4 1.e-4 2e-4 2.e-4 3e-4 3.e-4 4e-4 4.e-4 e-4.e-4 6e-4 vout.vt 2 e- 1e-4 1.e-4 2e-4 2.e-4 3e-4 3.e-4 4e-4 4.e-4 e-4.e-4 6e-4 Figure 8: Simulation waveforms for the basic monostable pulse generator. 1

The r astable pulse oscillator Figure 9 shows the basic r astable pulse generator circuit. The charging for capacitor C1 is given by tc =.693(R + R6)C1 seconds, and the discharge by td =.693(R6)C1 seconds. Hence, the period and frequency of oscillation are: 1.44 T = tc + td =.693(R + 2R6)C1 seconds, and f = (R + 2R6)C1 Hz. The duty cycle for the r output waveform is also given byd = R6 R + 2R6. Figure 1 illustrates the simulation waveforms for the astable oscillator. When resistor R6 is shunted by a diode, capacitor C1 charges via resistor R and discharges via resistor R6. On setting R = R6 a percent duty cycle results 13, see Figures 11 and 12. R R=3.9k V1 U= V vtrig vdis R6 R=3k transient simulation vout TRIG DIS TH C1 C=.1 uf TR1 Type=lin Start= Stop=.3ms Points=1 IntegrationMethod=Gear Order=6 reset V4 U1= V U2=V T1= T2=.2ms CON File=r_.sch C2 C=.1uF Figure 9: The basic r astable pulse generator. 13 The value of R6 needs to be trimmed to set the duty cycle to exactly percent. 11

reset.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 4 vtrig.vt 2 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 vout.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 vdis.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 Figure 1: Simulation waveforms for the basic astable pulse generator. R R=3k V1 U= V D1 R6 R=3.6k C1 C=.1 uf transient simulation TR1 Type=lin Start= Stop=.3ms Points=4 IntegrationMethod=Gear Order=6 vtrig vout reset TRIG V4 U1= V U2=V T1= T2=.2ms DIS TH CON File=r_.sch vdis C2 C=.1uF Figure 11: r astable pulse generator with percent duty cycle. 12

reset.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 vtrig.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 vout.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 vdis.vt 2e- 4e- 6e- 8e- 1e-4 1.2e-4 1.4e-4 1.6e-4 1.8e-4 2e-4 2.2e-4 2.4e-4 2.6e-4 2.8e-4 3e-4 Figure 12: Simulation waveforms for percent duty cycle astable pulse generator. Pulse width modulation Triggering the r in monostable mode with a continuous sequence of pulses allows the output pulse width to be modulated by changing the amplitude of a signal applied to the control input pin (CON). An example pulse width modulator circuit is given in Fig. 13. In this circuit components C2, R6 and D1 convert the trigger signal into a falling edge triggering signal. This can be seen in Fig. 14 which illustrates the trigger, discharge and resulting output waveform. The r control pin is driven from a voltage pulse source. The specification of the control waveform has been chosen to generate a triangular shaped signal so that the modulation of the pulse width can be clearly seen as the control signal amplitude changes. 13

R R=2k C1 C=.1 uf V1 U= V vsig V7 U= V TH=.7 ms TL=. ms Tr=2 ns Tf=2 ns C2 C=.1uF R6 D1 R=4.7k reset vtrig V4 U1= V U2=V T1=.2ms T2=.ms Tr=1 ns Tf=1 ns vout TRIG DIS TH CON File=r_.sch vcon transient simulation TR1 Type=lin Start= Stop=2ms IntegrationMethod=Gear Order=6 vdis V8 U1=1 V U2= V T1= T2=2ms Tr=1 ms Tf=1 ms Figure 13: Pulse width modulator r circuit. 14

reset.vt.2.4.6.8.1.12.14.16.18.2 vcon.vt.2.4.6.8.1.12.14.16.18.2 vsig.vt.2.4.6.8.1.12.14.16.18.2 1 vtrig.vt.2.4.6.8.1.12.14.16.18.2 vdis.vt.2.4.6.8.1.12.14.16.18.2 vout.vt.2.4.6.8.1.12.14.16.18.2 Figure 14: Simulation waveforms for pulse width modulator. 1

Pulse position modulation A pulse position modulator can be constructed from the astable waveform generator given in Fig. 9. A modulating signal is applied to the control input pin (CON); see Fig. 1. This signal causes the pulse position to vary with the amplitude of the applied modulating signal. A typical set of simulation waveforms for this circuit are shown in Fig. 16. This is a very difficult circuit to simulate. It is one case where the trapezoidal integration method works successfully whereas the 6th order Gear integration method appears to fail 14. Note that the trapezoidal results were obtained using 3 points, Initial step =.1 ns, MinStep = 1e-16, MaxIter =, abstol = 1uA and vntol = 1uV. R R=3.9k V1 U= V vtrig vdis R6 R=3k C1 C=.1 uf transient simulation TR1 Type=lin Start= Stop=1ms Points=3 IntegrationMethod=Trapezoidal Order=2 vout reset TRIG V4 U1= V U2=V T1= T2=.2ms DIS TH CON File=r_.sch vcon V U1=V U2=4 V T1= T2=1 ms Tr= ms Tf= ms Figure 1: Pulse position modulator r circuit. 14 The transient simulation never finishes and can only be terminated by clicking the simulation abort button. 16

reset.vt 1e-3.2.3.4..6.7.8.9.1 vtrig.vt 1e-3.2.3.4..6.7.8.9.1 vdis.vt 1e-3.2.3.4..6.7.8.9.1 vout.vt 1e-3.2.3.4..6.7.8.9.1 vcon.vt 4 1e-3.2.3.4..6.7.8.9.1 Figure 16: Simulation waveforms for pulse position modulator obtained using trapezoidal integration. Multiple r simulation examples Having established in the last section that the new Qucs r model can simulate the standard application circuits listed in a typical device data sheet, this part of the tutorial introduces two further, more complex, examples that demonstrate how the r is used in practice. Sequential pulse train generation A very practical application of the r is the generation of timing pulses for control purposes. The circuit illustrated in Fig. 17 shows a set of monostable pulse generators connected in series and parallel. After circuit reset the falling edge of input pulse vin triggers the start of pulse sequence generation. The duration of each monostable 17

pulse is set by external capacitors C1 to C4 1. The specification of the monostable pulse generator subcircuit is given in Fig. 18. The sequential pulse generator is a complex circuit with: 6 R instances, 4 C instances, 4 VCVS instances, 1 Vdc instances, 8 Idc instances, 2 Vpulse instances, 8 OpAmp instances, 4 Diode instances, 4 BJT instances, 8 Inv instances, 8 NOR instances and 4 OR instances. V1 U= V vin IN vout1 IN vout2 IN vout3 V3 U1= V U2=V T1=1ms T2=1.3 ms Tr=1 ns Tf=1 ns vres V2 U1= V U2= V T1=.2ms T2=.ms ms Tr=1 ns Tf=1 ns CAP C1 C=.1uF CAP SUB2 C2 C=.2uF CAP SUB3 C3 C=.uF transient simulation TR1 Type=lin Start= Stop= ms IntegrationMethod=Gear Order=6 MinStep=1e-1 IN CAP vout4 C4 C=.1uF SUB4 Figure 17: Sequential pulse generator circuit. 1 The pulse duration s set by C1 to C4, in Fig. 17, have simply been chosen for demonstration purposes and do not represent any particular control timing sequence. 18

P_ R R=2k R6 D1 R=4.7k P_CAP TRIG DIS P_IN C2 C=.1uF TH P_ P_ CON C3 C=.1uF P_ IN CAP SUB2 File=_r_mono.sch Figure 18: Monostable pulse generator subcircuit. 19

The large number of components, and indeed the complexity of the circuit, tend to make the simulation of the pulse train generator circuit much greater than typical s recorded when simulating single r circuits. Also, circuit DC convergence and transient analysis step errors can be a problem, due to switching discontinuities, making careful selection of the non-linear diode parameters and the transient analysis conditions essential. In Fig. 18 a diode is used to clamp the r trigger input at five volts when the signal attempts to rise above volts. The default Qucs diode parameters are similar to those specified by SPICE 16. By default the diode emission constant is set to 1 and the diode series resistance to zero ohms. Neither of these values are particularly representative for silicon diodes. For silicon devices, rather than germanium diodes, n needs to be between roughly 1. and 2. Similarly, all diodes have some series resistance, often in the range.1 to 1 ohms depending on the power rating of the diode. To aid simulation these parameters have been set to n = 2 and Rs = 1Ω. Figure. 19 illustrates a typical set of signal waveforms obtained from the simulation of the sequential pulse generator: the simulation conditions employed to generate these results are; Integration method = Gear, Order = 6, initialstep = 1 ns, MinStep = 1e-1, reltol =.1, abstol = 1µA, vntol = 1µV, Solver = CroutLU and initialdc = yes. 16 The default values were set in an early version of SPICE, probably version 1, and appear to have not been changed as the simulator was developed. 2

vres.vt e-4 1e-3.1.2.2.3.3.4.4. vin.vt e-4 1e-3.1.2.2.3.3.4.4. vout1.vt e-4 1e-3.1.2.2.3.3.4.4. vout2.vt e-4 1e-3.1.2.2.3.3.4.4. vout3.vt e-4 1e-3.1.2.2.3.3.4.4. vout4.vt e-4 1e-3.1.2.2.3.3.4.4. Figure 19: Simulation waveforms for the monostable pulse generator circuit. 21

Frequency divider circuit A common requirement in both digital and mixed mode circuit design is frequency division, where a high frequency pulse train, often derived from a crystal controlled clock, is divided down to a much lower frequency 17. The classical way of dividing such signals is to use a chain of flip-flops each connected as a divide by two element. The r can also be used for pulse train frequency division 18. The schematic shown in Fig. 2 shows a basic monostable mode circuit with a train of pulses applied to the trigger input pin 2 (TRIG). In an earlier section of these notes it was explained that the trigger comparator input was signal level sensitive and retriggering takes place if the duration of the low signal section of the trigger waveform is greater than the monostable pulse duration. In Fig. 2 the monostable pulse length is.22ms and rectangular voltage generator parameter TL is.ms which causes retriggering to occur. The effects of retriggering can be seen in Fig. 21. Frequency division employing rs is based on the monostable circuit shown in Fig. 2 and hence circuit designers must make sure that retriggering does not take place. Illustrated in Fig. 22 is a two stage frequency division circuit where each stage divides the input pulse train by five giving an overall division ratio of twenty five. The output waveforms for this circuit are shown in Fig. 23. When designing r frequency divider circuits good performance can be achieved if the period of the r is set at (N-.) s the period of the input pulse train 19, where N is the division ratio and is in the range 2 N 1. R R=2k C1 C=.1 uf V1 U= V V7 U= V TH=.7 ms TL=. ms Tr=2 ns Tf=2 ns vtrig1 reset V4 U1= V U2=V T1= T2=.2ms Tr=1 ns Tf=1 ns vout1 TRIG DIS TH CON File=r_.sch transient simulation TR1 Type=lin Start= Stop=1ms IntegrationMethod=Gear Order=6 Figure 2: A monostable mode r circuit with a pulse train applied to the trigger input. 17 Often the resulting frequency is in the region 1 to Hz and is used to flash an LED, or some other optical actuator, on/off. 18 rs are normally more efficient than flip-flops in this application because single devices can have divisors greater than two. 19 E. A Parr, IC Projects, Bernard Babani (publishing) Ltd, 1981, p. 19. 22

reset.vt 1e-3.2.3.4..6.7.8.9.1 vtrig1.vt 1e-3.2.3.4..6.7.8.9.1 4 vout1.vt 2 1e-3.2.3.4..6.7.8.9.1 Figure 21: Simulation waveforms for the circuit given in Fig. 2: these show retriggering. 23

R R=2k C1 C=.2 uf V1 U= V V7 U= V TH=.2 ms TL=.1 ms Tr=2 ns Tf=2 ns vtrig1 reset vout1 V4 U1= V U2=V T1= T2=.2ms Tr=1 ns Tf=1 ns TRIG DIS TH CON transient simulation TR1 Type=lin Start= Stop=1ms IntegrationMethod=Gear Order=6 R6 R=2k vout2 TRIG DIS TH C2 C=.26 uf CON SUB2 Figure 22: A two stage r frequency division circuit. 24

reset.vt 1e-3.2.3.4..6.7.8.9.1 vtrig1.vt 1e-3.2.3.4..6.7.8.9.1 4 vout1.vt 2 1e-3.2.3.4..6.7.8.9.1 4 vout2.vt 2 1e-3.2.3.4..6.7.8.9.1 Figure 23: Simulation waveforms for the circuit given in Fig. 22. End note Developing a simulation model for the r is an interesting challenge. This tutorial note attempts to describe the principles and macromodelling technology needed for such a task. It also demonstrates how much Qucs has matured as a universal simulator. The new Qucs r model is very much a first attempt on my part at building a functional model of this complex device. Much more work needs to be done in the future to improve the r model. Low power r models are also needed for these popular variants. Longer term a universal parameterised subcircuit model for the r should become possible once passing parameters to Qucs subcircuits and calculation of component values using equations are implemented. A special thanks to Stefan Jahn for all his encouragement and the many modifications he made to Qucs, which either corrected bugs or added functionality, during the period I have been working on this topic. 2