Single IC forms pseudorandom-noise source
Edited by Bill Travis
Steve Ploss, Veridian, Dayton, OH -- EDN, 3/21/2002
Trying to find a single IC noise source can be frustrating. National Semiconductor once made such a noise source for audio applications, but it's now hard to find. This situation leaves the designer with several choices, most of which involve using several ICs. You can take the analog approach of using a lot of gain to amplify diode-avalanche noise, or you can design a linear-feedback-shift-register pseudorandom-noise source using multiple CMOS ICs. Alternatively, you could use a single-chip microcontroller, such as Microchip's 12C508. The classic approach to generating a pseudorandom-noise sequence is to model the linear-feedback-shift register in software. The method involves testing and XORing together multiple bits to provide the single-bit feedback into the shift register. One problem with this approach is that it doesn't yield the highest possible bit rate. The approach in Figure 1 is more optimum for using the lowest number of machine cycles per loop. The approach is similar to the one that CRC bit-shift algorithms take. These algorithms test only a single bit but XOR multiple bits in parallel. A microcontroller quickly accomplishes the task. The bit-test and XOR operations require only three instruction cycles to complete. Listing 1 shows the assembly code for the complete noise source. The entire
loop takes only 10 instruction cycles. The circuit in Figure 2 produces an output rate of 100 kHz for the 12C508 with its internal 4-MHz oscillator. The shift register's length is effectively 25 bits, three bytes plus a carry bit. For a maximal-length sequence such as this, the pattern does not repeat itself for 5 minutes and 35 sec. If you desire higher bit rates, you can simply use a 20-MHz part with a crystal to obtain an output rate of 500 kHz. Another trick for increasing the rate is to use a part with an 8-bit output port and use that port in place of the Hibyte register. Then, the commands "movf Hibyte,W" and "movwf GPIO" are unnecessary. The result is a loop time of eight instruction cycles and a 25% increase in output rate. Be sure to configure the port pins as all outputs. Is this the best Design Idea in this issue? Select at www.ednmag.com. |