3. Software: Initialization & Test
3. Software: Initialization & Test
The following chapter describes the programs for initialization and test routines written
during the development of the board. The source code can be found in Appendix A of
this report.
3.1 Communication between DSP and PC via RS232
Windows ‘Terminal’ software is used to establish communication between the DSP
and the PC. The keyboard and monitor are used as input and output devices
respectively . The DSP transfers its data to the PC via the RS232 interface driven by
the on-chip UART.
The exchange of data between the DSP and the PC is controlled by polling the DR
and THRE bits of the IOSR registers of the on-chip UART. When the DR bit is set, it
indicates that a character has been received. Similarly, when the THRE bit is set, it
indicates that the transmit register is empty ( i.e. a character has been transmitted).
When receiving data, the function ISRXREADY() is called, waiting until a character is
received before attempting to read the ASDTR register in the UART.
When transmitting data, the function ISTXREADY() is called, and waits until ASDTR
register is empty before attempting to write to it.
3.2 Serial Port and TLV320AC36
The two TLV320AC36 are connected to the DSP via the serial port. The XF signal is
used to switch between the two CODECS. Only the received serial port interrupt is
used since the transmit and receive functions of the serial port are synchronized by
tying together the FSX and FSR pins.
This paragraph describes the operation of the serial port in our test program. An
external interrupt, INT2, is received every 62.5µs (16kHz). The interrupt service
routine for INT2 turns on one of the VBAPs by toggling the XF pin and outputs an old
sample stored in BUFFER. Since the transmit and receive blocks of the serial port are
synchronized, a new sample will arrive at the serial port generating a receive interrupt.
The interrupt service routine will read the new sample from the serial port and store it
in BUFFER.
To perform the serial port test, an audio source may be connected to ANALOG IN. If
speakers are connected to ANALOG OUT they should reproduce the same waveform
as that applied to ANALOG IN.
3.3 Testing the external SRAM
In this test program the DSP reads and writes to external memory. Each stored value
is checked for errors and any faults encountered increment the error counters.
The program starts by initializing a data word to 0xffffh. This data memory is copied
into program memory, and immediately copied back from program to data memory.
This procedure is repeated for all the external program and data SRAMS.
Next, the program starts a different test. The DSP executes 8 consecutive writes to
the external data space. The data written alternates between 0x5555 and 0xaaaa with
Feature Phone based on TMS320LC203
7