Digital Signal Processing Reference
In-Depth Information
input to the DSK. Increase the frequency of the input signal and verify the sequence
associated with the LEDs that turn on.
10.7 SPECTRUM DISPLAY THROUGH EMIF USING LCDS
16
character liquid-crystal display (LCD) (LCM-S01602DTR/M from Lumex).
Each LCD character is decomposed into two separate states to form a bar graph
displaying the spectrum of an input signal. See also the previous project, which
displays a spectrum through EMIF using a bank of 32 LEDs. Figure 10.13 shows
the core of the program, EMIF_LCD.c , that implements this project. It uses the
C-coded FFT function called from FFT256c.c in Chapter 6 to obtain the spectrum
(for the section of code that is excluded without outputting the negative spike for
reference).
This project implements a graphical frequency display through the use of a 2
¥
FFT Component
One component of the program is based on the FFT program example in Chapter
6 that calls a C-coded FFT function (see FFT256c.c ). The FFT component uses 256
points and samples at 32 kHz to allow a frequency display range from 0 to 16 kHz.
The second component of the program is associated with the EMIF-LCD.
LCD Component
Since the LCD is 16 characters wide, each character is chosen to correspond to
one band. The FFT range then can be decomposed linearly into sixteen 1-kHz
bands, with each band being determined in a nested “for loop.” The 256-point FFT
is then decomposed into 16 bands with eight samples per band. The average of the
samples is taken and placed into an array of size 16. Using thresholds, this array is
then parsed to determine which character (blank or filled) is to be displayed on the
LCD.
Each LCD character has two different states, either fully on or fully off (four
states total). These characters are then placed in arrays, one array for the top row
of the LCD and one for the bottom row. These arrays are accessed by the function
that writes data to the appropriate LCD. Two functions are used to transfer data to
the LCD:
1. The first function, LCD _ PUT _ CMD , is used primarily by an initialization
function ( init _ LCD ). It masks the proper data bits and configures the control
lines. The LCD has setup and hold times that must be achieved for proper
operation. The LCD _ PUT _ CMD function sets the control lines, with delays
to ensure that there are no timing glitches, and then pulses the enable control
line. Clocking the data into the LCD occurs during the falling edge of the
enable line.
2. The second function, LCD _ PUT _ CHAR , sends the characters to the LCD and
requires different control signals. The cursor address is autoincremented so
that a character is sent to the proper position on the LCD.
Search WWH ::




Custom Search