ReleasePage 3 of 24SMT326 DSP PC/ISA System User Guide
LED
LED
CP1
Description
The SMT326 is a PC-ISA full-length card supporting a TMS320C44 ('C44) DSP together with
multiple A/D and D/A channels.
Incorporated on the card is an interface between the PC and a 'C44 communications port.
For increased processing performance, another 'C44 (or 'C40) can be added as a TIM.
Architecture
CP2CP3
FMS 0
FMS 1
5
2
1
'C44
localglobal
FMS 2
SRAMSRAM
ID ROMFLASH
4
ADC
I2C
Interface
DAC
Logic
TTL I/O
CTRL
PC-ISA Bus
Processor
The SMT326 includes a 50MHz TMS320C44 DSP. This device is connected to a TIM (Texas
Instruments Module) site via 3 communication ports (4 ports are available with a 'C44). These three
ports are also brought out to individual connectors for connection to a larger processing system. The
connectors used are compatible with a range of Sundance 'C4x products including a 4 slot PC-ISA
TIM carrier card, frame grabbers, VXI carrier card and a 'C40 TRAM.
Debugging of application software may be carried out by the connection of an XDS-510 (or
compatible) JTAG debugger. A standard JTAG header (compliant with the requirements in the 'C4x
User's Guide) is provided on the rear edge of the board.
The 'C44 processor has two separate memory busses. They are named local and global, and the
resources on the SMT326 are shared between these busses.
An upgrade to a 60MHz 'C44 is possible
This 'C44 implementation is capable of being booted from a communication port or from on board
ReleasePage 4 of 24SMT326 DSP PC/ISA System User Guide
Interrupts
The processor may be interrupted from the ADCs on IIOF0. The ‘C44 should be set up as
edge triggered, as this signal lasts only 4 CODEC master clocks (80ns).
'C44 interrupt IIOF1 is routed to the PC Interface Logic but is currently uncommitted.
Reset
Reset to the board is performed by the PC-ISA signal RSTDRV.
A software reset to the 'C44 and communications port interface can be performed by the PC
writing a '1' to bit 0 of the link reset register (PC I/O address 0x30C).
Communications Ports
The 'C44 has four bi-directional communications ports (CPn - where n is 1,2,4 or 5) able to
sustain data rates of up to 20Mbytes/s.
On this board, one of the ports, P4, is connected to the PC-ISA communications port
interface. The other three are taken to ribbon cable connectors on the reverse of the board.
They are labelled CP1, CP2 and CP3. CP1 is connected to P1, CP2 to P2 and CP3 to P5.
(CP1=P1=FMS0; CP2=P2=FMS1 and CP3=P5=FMS2).
Additionally, ports P1, P2 and P5 are routed to the TIM site provided for expansion. P1 is
connected to TIM port 4, P2 to TIM port 5 and P5 to TIM port 1.
It must be noted that if a TIM is mounted in the TIM site then care must be taken to
ensure that only one device is driving the communications ports.
ReleasePage 5 of 24SMT326 DSP PC/ISA System User Guide
Local Bus Resource
The local bus has access to a bank of SRAM and the ID ROM.
Local SRAM
The SRAM is composed using a 72 pin ZIP SRAM module. Up to 4Mbytes are available with
the largest module. Faster SRAM (15ns) would be needed for 60MHz operation.
The local SRAM is accessed at address 0x00300000 on processor strobe LSTRB0.
ID ROM
On the local bus of the 'C44 is an ID ROM which contains module specific data to enable
operating systems such as 3L to determine the processor network architecture.
This device is a 32k byte erasable ROM, and can be re-written by the 'C44. It must be
accessed with 7 wait states at address 0x70000000 on processor strobe LSTRB0.
For write protection purposes, in addition to a software mechanism, a jumper, JP4, must be
inserted to enable writes to the ID ROM.
For storage of TIM compliant ID information, this ROM appears as a 4 bit ID ROM.
This device also contains the configuration code for the Xilinx Codec Interface.
Local Memory Interface Control Register (LMICR)
Within the 'C44 is a register which determines how the bus is partitioned and how many wait
states to use for accesses. There are two values which must be programmed here. One is for
ID ROM access, and the other for SRAM access.
For ID ROM access the value 0x3E39FF50 must be programmed into the LMICR.
For SRAM access (normal operation) the value 0x3EF78050 must be programmed into the
LMICR. When using an operating system like 3L, the loading of this register is performed
using the value within the ID ROM.
ReleasePage 6 of 24SMT326 DSP PC/ISA System User Guide
Global Bus Resource
The global bus has access to SRAM, DACs, ADCs, LED control register and ADC control registers.
Global SRAM
The SRAM is composed using a 72 pin ZIP SRAM module. Up to 4Mbytes are available with
the largest module. Faster SRAM (15ns) would be needed for 60MHz operation.
The global SRAM is accessed at address 0x80000000 on processor strobe STRB0.
CODEC
Sixteen stereo audio CODEC devices are employed on the SMT326 to provide 32 channels
of analog input and 32 channels of analog output.
The CODECs have a serial output and are interfaced to the ‘C44 global bus via an XC4006
FPGA. Configuration of the CODECs is performed through an I2C serial interface. The
CODEC can respond to two I2C addresses, primary and alternate. Eight of the CODECs
respond to their primary address, and the other eight to their secondary address. Pairs of
CODECs are then selected within the LED Control register.
DAC
The DAC output signals range from -2.83V to +2.83V (2Vrms) and are available on
the miniature co-ax connectors along the top and bottom edges.
The DAC outputs are subject to a digital filter which limits the bandwidth (0.1dB) to
10 - 20kHz, and is DC coupled.
The differential output of the CODEC is buffered with an op-amp which provides a
single-ended output.
ADC
The ADC input signal range is AC coupled (1Vrms). These signals are presented to
the ADC circuitry through connectors mounted on the top and bottom edges of the
board.
A single-ended analog input is buffered to produce the differential input required by
ReleasePage 7 of 24SMT326 DSP PC/ISA System User Guide
CODEC Clocking
The CODEC clock is generated by an on-board oscillator. There is no way to change
via software the sampling rate.
The on-board oscillator can be exchanged for any oscillator which is packaged in an
8-pin DIP. The oscillator frequency is chosen such that;-
fosc=m x fsamp < 30MHz
where fosc is the oscillator frequency,
m = oversample rate / 2 = (1024), and
fsamp is the sample rate.
i.e.:
if fosc=50MHz then fsamp=50 Ksamples/sec
CODEC Control
CODEC Start
After power-on or reset, the CODECs will be held in a reset state (not
sampling). To start the CODECs sampling a processor write to address
0x80200020 with D7 set, using processor strobe STRB1, must be performed.
This is a global signal and all CODECs will start at the same time (within one
CODEC input clock period).
CODEC Stop
To stop acquisition a processor write to address 0x80200020 with D7 clear,
using processor strobe STRB1, must be performed. This is a global signal
and all CODECs will stop at the same time. Note that the only advantage of
stopping the CODECs is to reduce power consumption. An alternative to
stopping sampling is to disable the interrupt enable within the ‘C44.
CODEC Interrupt & Status
The CODECs operate in a left/right mode. Although all channels are
sampled at the same point, the serial data from the CODECs are transmitted
in two phases as 16 channels of left followed by 16 channels of right. At the
end of each of these phases an interrupt is signalled on IIOF0. The first
interrupt received after removing reset is from the left channel.
The interrupt must be set to edge triggered as it only remains active for
approximately 120ns (hence it cannot be polled reliably by the ‘C44 within
the IIF register).
When the address 0x80200020 is read, the codec interface status is
returned. Bit 0 reflects the IIOF0 state, and bit 1 indicates which phase (left
or right) is able to be accessed by the ‘C44. When bit 1 is 0, then the ‘C44
can access the first 16 channels (left).
ReleasePage 8 of 24SMT326 DSP PC/ISA System User Guide
LED Control
An 8 bit latch is provided within the Codec FPGA to enable the state of an on board hex LED
to be changed. The LED is controlled by the 4 lsbs of this register. This register is accessed
at address 0x80200020.
The next 3 msbs of this register select which of the CODECs are selected for configuration
via the I2C interface device.
The msb of this register is used to reset the CODECs. A logic 1 will remove the reset signal.
Global Memory Interface Control Register (GMICR)
Within the 'C44 is a register which determines how the bus is partitioned and how many wait
states to use for accesses.
The value 0x34F4F840 must be programmed into the GMICR. When using an operating
system like 3L, the loading of this register is performed using the value within the ID ROM.
This value will provide 0 wait state access to SRAM (external ready), externally defined wait
states for access to the I2C interface, and n wait states for access to the CODECs.
Codec Interface FPGA
The XC4006 FPGA is configured by the ‘C44. Normally this is done by ‘C44 boot code
resident within the boot ROM. This code would read the spare section of the ID ROM and
use this as configuration data for the FPGA.
The FPGA is configured in a byte wide asynchronous peripheral mode. The PROGRAM pin
is asserted by the ‘C44 writing to address 0x80300000. This pin is de-asserted when address
0x803000000 is read.
ReleasePage 9 of 24SMT326 DSP PC/ISA System User Guide
Interface Logic
A small FPGA is used to provide all interface functions from the PC-ISA bus. This device performs
the functions necessary for a 'C44 communication port interface. The FPGA is loaded at power on
from a small serial ROM. All features of the FPGA can be customised by re-configuring this.
Communication Port Interface
An eight bit interface to the 'C44 is provided for by this device. Four bytes must be
transferred for each 32 bit word that is to be transferred to or from the 'C44. The 'C44
communications ports only deal with 32 bit quantities, although the data is transferred as
bytes.
This interface is compatible with the SMT300 and SMT322 and can thus support existing
operating systems such as 3L (TISLINK=SMT300,io:300).
Three registers reside inside this interface for the control of data transfers.
Link Reset / NMI
This register is accessed at PC I/O address 0x30C.
Asserting bit 0 of this register will put the 'C44 into reset.
Asserting bit 1 of this register will assert the NMI signal to the 'C44.
Link Status
The interface status can be determined by reading this register. It is accessed at PC
I/O address 0x304.
If bit 7 returns a '1' then data can be written to the link data register for transmission
to the 'C44 communications port. If bit 7 returns a '0', then the link data register is
full.
If bit 6 returns a '1' then data can be read from the link data register (this data is the
most recently transmitted word from the 'C44 down its communications port). If bit 6
returns a '0' then no data is available.
Link Data
Data from the PC is written here for transferral to the 'C44. It is accessed at PC I/O
address 0x30A.
The least significant byte must be written first. When all four bytes have been
written, the interface logic will transfer the whole 32 bit word to the 'C44. Bit 7 of the
link status register need only be read once per 4 bytes. Transfers must be in
multiples of 4 bytes.
Data from the 'C44 is available here for reading by the PC. The least significant byte
is read first. Transfers must be in multiples of 4 bytes. When bit 6 of the link status
register returns a '1', four bytes may be read without reading the link status register
again.
Using this polled data transfer mechanism, a data rate of approx. 350k bytes/s can
be achieved. This is due mainly to the limitation of the PC-ISA bus.
ReleasePage 13 of 24SMT326 DSP PC/ISA System User Guide
Example Code
This example code shows how to capture all 32 channels (individually). Note that the data is right
shifted 4 bits purely to convert it into a 16 bit sample. Also note that the sampling of the channels is
performed in two parts (left and right). When interrupts are used to trigger the sampling, a single
interrupt channel is asserted for the left and right channels. Thus an interrupt based system will have
to synchronise with the left/right status before enabling interrupts.
ReleasePage 14 of 24SMT326 DSP PC/ISA System User Guide
Test Code
Test both a ADC channel and a DAC channel
This first example shows how to test input/output channels. This particular code reads the ADC
channel 1 (IN1) and writes to DAC channel 0 (OUT0)
-------------------------------------------------------------------------------------------------------------------------------------/* SMT326 test program: Reads the ADC channel 1 (IN1) and writes to DAC channel 0 (OUT0) */
#include <stdio.h>
#include <c40reg.h>
#include <math.h>
volatile unsigned long *i2c_s1, *i2c_sn;
volatile unsigned long *fpga, *fpgain, *fpgaout, *prog, *status;
volatile int delay,adc_word;
int i,j,t,temp,ctrl_byte,sample, channel, outadd, mask;
main(int argc,char *argv[])
{
prog =(unsigned long *)0x80300000;
fpga =(unsigned long *)0x80200000;
i2c_s1=(unsigned long *)0x80100001;
i2c_sn=(unsigned long *)0x80100000;
/* Setup the I2C interface device */
printf("Setting up I2C interface\n");
*i2c_s1=0x80; /* select own address regsiter */
ReleasePage 19 of 24SMT326 DSP PC/ISA System User Guide
Test a DAC channel
This second example shows how to test a DAC channel. The program generates a sine wave that it
will be the digital input to the DAC to test.
/* SMT326 DAC channel 0 test program */
#include <stdio.h>
#include <c40reg.h>
#include <math.h>
volatile unsigned long *i2c_s1, *i2c_sn;
volatile unsigned long *fpga, *prog, *status;
volatile int delay;
int i,j,t,temp,ctrl_byte, channel, mask;
char ch;
int sin_table[256];
int f1,f2,f3,f4;
int i1,i2,i3,i4;
main(int argc,char *argv[])
{
for(i=0;i!=256;i++) sin_table[i]=(int)(000+256*(sin(3.14*i/128)));
prog =(unsigned long *)0x80300000;
fpga =(unsigned long *)0x80200000;
i2c_s1=(unsigned long *)0x80100001;
i2c_sn=(unsigned long *)0x80100000;
/* Setup the I2C interface device */
printf("Setting up I2C interface\n");
*i2c_s1=0x80; /* select own address regsiter */
ReleasePage 24 of 24SMT326 DSP PC/ISA System User Guide
How To DMA
To relieve the ‘C44 of any unnecessary burden of waiting for a new sample to be acquired, it is
possible (if a little complicated) to request that the ‘C44’s DMA controller perform the entire transfer
of samples into memory (or comm port) with only a single interrupt on completion.
The procedure would be to setup a series of 4 DMA operation (DMAOP) each one linking to the
following one, with DMA operation 4 linking to DMA operation 1.
DMAOP1 would synchronise to the FPGA interrupt IIOF0, have a source address pointing to
0x80200000 (FPGA source), destination address pointing to the required memory address (BUF), a
transfer length of 1, and a link pointer pointing to DMAOP2.
DMAOP2 would have no synchronisation, have a source address pointing to 0x80200001, destination
address of BUF+1, a transfer length of 15, and a link pointer pointing to DMAOP3.
DMAOP3 would synchronise to the FPGA interrupt IIOF0, have a source address pointing to
0x80200010 (FPGA source), destination address pointing to the required memory address (BUF+16),
a transfer length of 1, and a link pointer pointing to DMAOP4.
DMAOP4 would have no synchronisation, have a source address pointing to 0x80200011, destination
address of BUF+17, a transfer length of 15, a link pointer pointing to DMAOP1, and would set the
TCC bit (to enable an interrupt on completion).
In operation, the FPGA will generate an interrupt on IIOF0 for the left channel say, this will trigger
DMAOP1 to read and store the first channel. DMAOP2 will then start and read and store the next 15
channels. DMAOP3 is then started, which will wait for the next interrupt on IIOF0 (the right channels).
When this is received, DMAOP3 will read and store channel 16 and then start DMAOP4. DMAOP4
reads and stores the remaining 15 channels, generates an interrupt to the ‘C44 and reloads
DMAOP1.
When the ‘C44 receives its interrupt, the whole 32 channels will be stored at BUF.
Various simpler alternatives are available, including the ‘C44 responding to the left and right channel