Forums

ADSP-21160M EzKIT Lite Parallel Interface

Started by Unknown August 29, 2001
Hi guys,

I hope you can help me on getting information on how to communicate
the 21160 EzKIT Lite to a PC via the parrallel interface. It's
through the Xilinx CPLD, but how should the interface be? Where
should I write the data on the DSP to send to the PC host, and how
should I read it on the DSP from the PC host?

Cheers,



wrote:
> I hope you can help me on getting information on how to communicate
> the 21160 EzKIT Lite to a PC via the parrallel interface. It's
> through the Xilinx CPLD, but how should the interface be? Where
> should I write the data on the DSP to send to the PC host, and how
> should I read it on the DSP from the PC host?

I tried this some time ago but ended up in the conclusion that the
state machine of the CPLD is controlled by the PC-side interface
(i wanted to attach a "passive" display to it). I used the serial
port then.

The sources of the CPLD and the monitor program are available. Dig
through ezpld.v and its comments to understand the CPLD's state
machine and then look up the CPLD address in pp_alib.c . With this
you should be able to write a PC program handling your communication.

HTH

--
/* Michael Haertl */


Jaime Andr Aranguren Cardona wrote:
> I have another question for you. Which serial port did you use? How did
> you do it?

I've simulated an asynchronous rs232 transmitter on SPORT 0:
- every byte to be transmitted has to be shifted left, then mask in/out
the start/stop bits
- after sending a byte send only '1's to keep the serial line 'high'
- connect sport 0 tx out pin to a max232 (or similar) I am not sure about all those magic constants in the code below (i copied
it from a snapshot disk). But i remember sending 2 start bits (hence the
11 bits), it gave better results.

further note: i did only send, no receiving. > So, it is not possible to drive a peripheral from the EzKIT Parallel Port?

I investigated not very long, but as i understand the ezpld.v-file: no
Please correct me, if I am worng. > As long as I understood, just using the PP_Read() and PP_Write(Byte)
> functions on pp_alib.c I will have all the required functionality for
> interfacing the PC Parallel Port. Am I right?

As I see it, basically, yes. But I didn't use it, as I couldn't manage
to toogle any line on connector J11 when using the ez-kit stand-alone
(e.g. via a JTAG debugger). > > -----Mensaje original-----
> > De: Michael Haertl [mailto:]
> > Enviado el: Micoles, 29 de Agosto de 2001 07:33 a.m.
> > Para:
> > CC: SHARC list
> > Asunto: Re: [adsp] ADSP-21160M EzKIT Lite Parallel Interface
> >
> >
> > wrote:
> > > I hope you can help me on getting information on how to communicate
> > > the 21160 EzKIT Lite to a PC via the parrallel interface. It's
> > > through the Xilinx CPLD, but how should the interface be? Where
> > > should I write the data on the DSP to send to the PC host, and how
> > > should I read it on the DSP from the PC host?
> >
> > I tried this some time ago but ended up in the conclusion that the
> > state machine of the CPLD is controlled by the PC-side interface
> > (i wanted to attach a "passive" display to it). I used the serial
> > port then.
> >
> > The sources of the CPLD and the monitor program are available. Dig
> > through ezpld.v and its comments to understand the CPLD's state
> > machine and then look up the CPLD address in pp_alib.c . With this
> > you should be able to write a PC program handling your communication.


-----------------------------
#include <def21160.h>
#define SETREG(reg,val) (*((unsigned long*)(reg))=val)

void init_rs232(void)
{
/* reset sport 0 tx */
SETREG(STCTL0, 0);

/* setup sport 0 tx */
#if 0
// TCLKDIV = 4166 = 0x1046 (abt 9600)
// TFSDIV = 10 = 0xa (11bits)
SETREG(TDIV0, 0x00091046);
#else
// TCLKDIV = 2082 = 0x0822 (abt 19200)
// TFSDIV = 10 = 0xa (11bits)
SETREG(TDIV0, 0x00090822);
#endif

// SPEN=1,DTYPE=0,SENDN=0,SLEN bits(),PACK=0,ICLK=1,CKRE=0,
// TFSR=0,ITFS=1,DITFS=0,LTFS=0,LAFS=0,SDEN=0,SCHEN=0
SETREG(STCTL0, 0x000044a9);
}

void send_byte(int a)
{
a = (((a & 0xff) << 2) | 0x401);
SETREG(TX0, (a & 0x3ff)); // send data byte w/ start/stop bits
SETREG(TX0, 0x7ff); // keep the line 'high'
}
-----------------------------

--
/* Michael Haertl */