|
||
March 26, 1998PLL implements FPGA-based SDRAM controllerEddy Debaere, Barco Graphics, Ghent, Belgium
When you use FPGAs, delays to get on and off chip add up quickly: clock pin to internal clock buffer for the internal clock-distribution net (5.4 nsec) and internal clock to output flip-flop (4.5 nsec minimum). The sum of these delays excludes an FPGA from application with SDRAMs using a 10-nsec clock period, considering a 3-nsec setup time for the address, control, and data-out signals. Figure 1 shows how to use a PLL with an FPGA and how to implement clock and control-path signals to make FPGA-based SDRAM controllers that operate at 100 MHz and beyond. The SDRAM address, data, and control signals use the memory-system clock, MCLK, as reference and the FB signal from an FPGA output pin as feedback. Because the PLL loop uses no dividers, MCLK and XCLK have the same frequency. When the PLL locks, the XCLK signal precedes MCLK by a time equal to the sum of the clock-buffer delay (from XCLK to ICLK) and the combinatorial output-buffer delay (from ICLK to the PLL feedback pin). The address, control, and data-out signals obtain their clock signals from ICLK. Because the delay from ICLK to the clocked output pin (7.0 nsec for the slew-rate-limited output) is close to but higher than the delay from ICLK to the FB output pin (4.8 nsec for a fast output), the clocked output appears early in the CLK period. The required SDRA setup time is thus easily fulfilled in a 100-MHz system: (10(7.04.8))>3 nsec. Note that changes in temperature, IC processes, and voltage have little influence on performance, because the XCLK clock-generating circuit is a closed-loop system. Moreover, the output buffer of the FB pin and the control and data pins have the same clock input as does the input pin, and all circuit blocks reside on the same die. Tests designed to check the data-input setup-and-hold times used a clocked input flip-flop (in the same I/O block as the data-output flip-flop), which received its clock from an internal version of MCLK. This configuration avoids excessive hold-time requirements for the SDRAM. (Editor's note: An EDN contributing editor warns that the 7.04.8 nsec reflects maximum specified times for the XC4010E-2 and yields an acceptable margin for an SDRAM with 1.5-nsec minimum hold time. However, an FPGA running at typical specs may present a marginal situation.) Tests using the AV9170-01 PLL from ICS show satisfactory performance to 106.25 MHz. (DI#2165) Comparator uses signal-dependent hysteresisP Krehlik and L Sliwczynski, University of Mining and Metallurgy, Krakow, Poland
Amplifiers IC1A and IC1B with associated resistors and diodes, R1, R2, D1, and D2, operate as logarithmic converters, producing output voltages where VT=kT/~;25 mV at room temperature, and IS is the saturation current of the p-n junction. The derivation of the equation assumes that R1=R2=R. Next, voltages VO1 and VO2 combine in the summing amplifier, IC1C. Using the assumption that R3=R5 and R4=R6 and that the diodes are matched, the output voltage from IC1C is The voltage is thus proportional to the ratio of the input voltages. The last amplifier in the circuit, IC1D, is a standard inverting comparator with hysteresis centered around zero and the threshold levels: The voltage swing at the output of the circuit (V+O4, V+O4), is a function of the limiter comprising resistor R9 and diodes D3 to D8. The output voltage, VO4, changes state when VO3>V+H (output goes low) or VO3<V=H (output goes high). These conditions correspond to The design allows you to distinguish between two signals, with a tolerance set by the external components, R3, R4, R7, and R8. When V+O4=|VO4|, the tolerance is symmetrical. With the given values, the output state changes when one input signal is approximately 30% higher than the other. If you need to use the circuit over a wide temperature range, you should take the thermal dependence of the threshold levels into consideration. The circuit uses an LM324 quad op amp. If you use a rail-to-rail amplifier (for example, the LMC6484), the output limiter is unnecessary. (DI #2166) Simple LCD interface takes two wiresEd Maste, Jem Designs, Pickering, ON, CanadaAlphanumeric LCD modules can provide an attractive display for a project, but their parallel I/O lines require a large number of outputs from a µC. For example, a direct LCD interface would consume all of the I/O pins of a small µC, such as the eight-pin PIC12C508 from Microchip Technology (Chandler, AZ).
A 74LS164 serial-to-parallel shift register forms the heart of the circuit and communicates with the LCD module in 4-bit mode. The shift register's outputs directly drive the LCD module's data inputs, DB7 through DB4, as well as RS, the control/data select input. The only signal that is not a direct output from the shift register is the LCD module's enable pin, which is Pin 6. R4 and D1 derive the enable input and ensure that the enable signal remains low until valid data is present at all other outputs. R1 is a current-limiting resistor for an LED backlight if the LCD module has one, and R2 and R3 set the contrast level of the module. You can replace R2 and R3 with a potentiometer if an adjustable contrast level is desirable. The µC must first clock in at least seven zeros for the first write (Figure 1b). This series of zeros guarantees that output QG of IC1 is low and will remain so for the next six clock cycles. This low level ensures that the enable input (Pin 6 of the LCD module) remains low because of diode D1. The serial-input stream then must consist of a one, followed by RS, and finally DB7 through DB4. With the data input low, an additional clock pulse shifts in a zero and lines up all of the outputs to the LCD module with the correct shift-register pins. The first clocked-in one now appears at QG, which reverse-biases D1. The enable continues to remain low because the data input to the circuit is low, and this situation pulls the enable low through R4. The data input then must go high for at least 450 nsec without a clock pulse to provide the enable pulse for the LCD module. This process, including clocking in at least six zeros, is then repeated for the next 4-bit write. For further information, including minimum cycle times and 4-bit-mode communication, consult the technical documentation provided by an LCD module manufacturer, such as Optrex (Plymouth, MI). (DI #2177) Inexpensive logic controls stepper motorDavid Ellis, Ellis Lindauer, Pullman, WA
DA=((DIR)(C))+((DIR) (C)); Equation 1 is an exclusive NOR, and Equation 2 is an exclusive OR. To save space, you can use a single quad XOR chip to implement both equations. A dual D flip-flop completes the logic driver, as Figure 1 shows. Using rising-edge-triggered D flip-flops helps keep the design simple while eliminating mode-change faults. The circuit derives the four outputs from the Q and Q outputs of D flip-flops IC2A and IC2B in Figure 1. IC1A XORs the Q output of flip-flop IC2B with the DIR input, and the circuit transforms the output into an XNOR by using IC1B as a controlled inverter. IC1B then drives the D input of flip-flop IC2A. Similarly, IC1C XORs the Q output of IC2A with the DIR input. The output of IC1C drives XOR IC1D, which acts as a noninverting buffer. The output of IC1D drives the D input of IC2B. Using XOR gate IC1D as a buffer keeps the propagation delays to the D inputs of the flip-flops equal, which helps the circuit avoid any race conditions. The STEP signal is the step-rate input, which drives the clock inputs of both flip-flops. The last design task is to add the appropriate-sized transistors to drive the stepper motor. In the case of the unipolar motor, output signals A, B, C, and D can directly drive the transistors. To drive a bipolar motor, you can use the A and C outputs to drive one-half of two H-bridges and the B and D outputs to drive the other corresponding half of the H-bridges. This design is possible because the B output is the inverse of A, and D is the inverse of C. (DI #2176) Low-voltage reset operates below 2.7VBob Kelly, Maxim Integrated Products, Sunnyvale, CA
The R1/R2 divider and internal 1.204V reference establish a threshold that determines when the circuit asserts an active-low at the output. For the values in the figure, this threshold is 2.25V (Figure 1b). IC1 has an open-drain output, so R3 and C1 control the length of the active-low pulse, RESET. In this case, the pulse length, or reset interval, is approximately 54 msec, which is sufficient reset time for most µCs and other digital circuits. Low power consumption distinguishes this circuit. The IC typically draws only 5 µA, and the R1/R2 divider draws slightly more than 1 µA in a 2.7V application. Pullup resistor R3 consumes power only when the supply voltage droops out of tolerance, so the power loss is minimal in normal operation. To prevent erratic behavior, IC1 offers approximately 6 mV of built-in hysteresis. For more hysteresis, you can add a large-value resistor, RHYST, between the IC's input and output; to reject short transients, IC1 has an inherent glitch immunity of 35 µsec with 100 mV of overdrive. The input capacitance works with R1 and R2 to provide some lowpass-filter action. For further immunity from transients, which is unnecessary unless the power bus is noisy, you can form an additional lowpass filter by adding a small-value capacitor, CG, to the input pin. (DI #2174) Alternating LED blinker uses four partsAndy Meng, Cincinnati, OH
The main element of this circuit is LED1, a Radio Shack 276-036 blinking red LED. D1 can be almost any silicon diode. The forward bias of D1 brings the turn-on voltage of LED2 up to 2.5V. R1 is a current-limit resistor for LED1, and this resistor also reduces the current of LED1 for longer battery life. LED2 is a Radio Shack 276-041 red LED. When you apply power, LED1 turns on and drops the voltage across LED2 to 1V. When LED1 turns off, the voltage across LED2 equals 3V, and LED2 turns on. (DI #2172) Spice generates PSK and FSK signalsDebra Horvitz, Galahad Systems, Laguna Hills, CACreating generators for amplitude-, frequency-, and phase-modulated signals can greatly simplify communication-system simulation. Although Spice includes a basic set of waveform generators, it includes no built-in support for many types of signals. You must create these signals from combinations of elements, and you can create variations of these built-in generators using Spice 2- dependent sources. However, using dependent sources to generate complex waveforms can require fairly complex Spice subcircuits.
The PSK subcircuit produces a coherent binary PSK signal according to the following equations: where EB is the transmitted energy per bit, TB is the bit duration, and f is the transmission frequency equal to NC/TB. (NC is an integer constant, and the period is 2×TB; thus, the duty cycle equals 50%.) In Listing 1, the input voltage source, VSIG, produces the polar form of the input signal. Using the B1 element, the subcircuit multiplies this input by the local oscillator voltage, VLO1, to produce the PSK output signal. The subcircuit, FSK, produces a coherent binary FSK signal according to the following equations: where f1 is the high-bit transmission frequency, and f2 is the low-bit transmission frequency. The frequency, f1, is equal to NC+1/TB. The frequency, f2, is equal to NC+2/TB. For simplicity, two pulse generators, VSIG and VSIGN, produce the input signal, m(t), and the inverse of the message signal, M(t), respectively. Again, using the B1 element, the subcircuit code multiplies these signals by the appropriate frequency generator: VLO1 for logic high and VLO2 for logic low. The sum of the resultant signals produces the FSK output signal. (DI #2173) Frequency multiplier improves line readingsYongping Xia, Teldata Inc, Los Angeles, CA
The number in the counter represents the delay (tW) between the last pulse and the next line-signal change. The µC compares tW with a fixed number. If tW is larger than that number, indicating that the clock frequency is too high, the value in OSCCAL decreases by one step to slow down. If tW is smaller than the fixed number, the value in OSCCAL increases by one step to speed up. Thus, the automatic clock-frequency adjustment continuously sends a signal at 100 times the line frequency. Note that, because of the calibration range, this approach has a limited input-frequency range. However, it accommodates line-frequency measurements from 58 to 62 Hz. You can download the assembly code from EDN's Web site, by clicking here: download. (DI #2182) Circular slide rule provides quick resultsJacek Pawlowski, PW INMEL, Zielona Góra, Poland
On side B (Figures 3 and 4), you can calculate the following formulas: Any quantity can be the unknown. For example, you can calculate You can modify the slide rule to incorporate the formulas you use most often. The design of the slide rule uses AutoCAD LT. (DI #2137) |
||
| EDN Access | Feedback | Table of Contents | |
||
| Copyright © 1997 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Publishing Company, a unit of Reed Elsevier Inc. | ||