September 2010
S M T W T F S
« Sep    
 1234
567891011
12131415161718
19202122232425
2627282930  

Categories

Wave/Function Generator

Microelectronic

Georgia Institute of Technology

Function Generator Screen Shot 1

James Harris
David Colvin

Introduction

Most modern media devices store audio signals in digital form. The device later translates the digital signals into analog signals. Then, these analog signals are use to operate CD players, sound cards and video devices. To perform such tasks, those devices integrate digital-to-analog converters or DACs.

Objective

Our project will explore the TLV5628CN part which is an 8 channel, 8 bit serial device. We will employ this part to generate signals similar to a function generator. Using the keypad on the PIC-690, the user can enter data to generate signals such a sinusoid waveform on a particular channel. The PIC-690 transfers that data via serial communication to the PIC-913 chip. This chip will process that data and output the user-desired signal on the external DAC. Unlike the MSP430 counter-part which is usually found in high-end hi-fi systems, the TLV5628CN part limits the maximum output frequency. So, the major objective of our project is to accurately display the signal in a small frequency range on several channels. To overcome this challenge, we have to use the various techniques we have learned in lab.

Project Description

Normally, function generators can produce signals of any waveform at frequencies in the order of hertz. To test a particular system™s response to an incoming signal, the user would input generated-signals into the system. Some example waveforms are sinusoid, ramp, triangle and square functions.  The frequencies usually range from 1Hz to 10 MHZ or more.  Some function generator models may have waveform editors, greater frequency ranges or multiple channels.

Our function generator can produce the four basic waveforms at a frequency of ~30Hz with 64 points per period resolution. To perform this task, we used a digital-to-analog converter or DAC. Our project utilized the TLV5628CN part which is an 8 channel, 8 bit serial device. Using the keypad on the PIC-690, the user can configure the PIC-913 to output signals on the DAC.
Mainly, The PIC-690 transfers the user-inputted data serially to the PIC-913 chip. This chip processes that data and outputs the user-desired signal on the external DAC.

Technical Description

The Terra Term terminal reads incoming data from the PIC-690 UART. The PIC-690 prompts the user to choose a waveform and select a channel. The Terra Term terminal also receives instant feedback from the user pressing keys on the keypad. The PIC-690 uses two state tables. The first state table de-bounces the user input from the keypad. The second state table encapsulates the first state table. The second state table controls the overall flow of the messages which prompts the user. The user makes a selection via the keypad on the PIC-690 and presses the # key to accept the value. If the user enters a invalid value, the PIC-690 refreshes the menus and prompts the user with an error message.
The PIC-690 displays the Waveform menu first.  After the user presses the # key, the PIC-690 displays the Channel menu. After the user selects a waveform and channel the PIC-690 transfers that data to the PIC-913 using a three wire interface. The PIC-913 and PIC-690 shares two ACKs and one DATA line. The PIC-913 outputs a bit on the DATA line and toggles its ACK1 line. The PIC-690 reads the DATA line and toggles its ACK2 line. The algorithm transfers bits asynchronous on the raising and falling edges of the ACK lines.
After the PIC-690 transfers the data to the PIC-913, the PIC-913 updates the channel configuration table which is a table of table pointers. These table pointers will point to one of the four lookup tables: sinusoid, triangle, ramp and square waveform. These lookup tables contain an array of pre-calculated values of the four waveform functions. At initialization the “channel configuration table elements point to a special zerotable. When the PIC-913 is not receiving new configuration data its main loop is updating the value in each channel of the DAC using the LOAD, CLK and DATA lines.  The main loop updates each channel with the next value in its corresponding waveform lookup table.

Anomalies and Problems

In order to produce usable waveforms on all channels, some optimizations were made.  First a faster clock speed was required to execute all the code for updating the DAC in a timely manner. An external 15 MHz oscillator was used to nearly double the internal clock speed.  A lower resolution waveform was used to decrease the period of the waveform.  Originally the lookup tables contained 255 points per period, and that was reduced to 64 to decrease the time it took to output a period of a waveform.  The code for transmitting to the DAC was streamlined to reduce the number of conditional statements at the cost of program space.
After the function generation code on the PIC-913 was working the SPI interface between the PIC-690 and PIC-913 stopped working.  In order to circumvent this problem a bit-banging routine was used to transfer configuration data between the PIC-690 and the PIC-913.
The increased clock rate on the PIC-913 allowed it to initialize before the PIC-690 causing errors to occur at startup.  In order to fix this problem a delay was added in the initialization routine on the PIC-913.

12 comments to Wave/Function Generator