Reply by Jon Harris November 7, 20052005-11-07
--- Mike Rosing <eresrch@eres...> wrote:

> On Fri, 4 Nov 2005, Sendhil Kumar wrote:
>
> > Dear Friends,
> > I have a problem in ADSP2181.
> >
> > The board that i'm using is a one which is developed by us. I have a
> routine
> > to send a character through UART, which i have called in a nested loop. The
> > problem that i face is that the number of character that displayed is not
> > same as that of my loop counter values. But this happens only for the first
> > time & from the next time onwards it is equal to the number of times that i
> > expect.
> >
> > cntr = 1;
> > do loop1 until ce;
> > cntr = 1;
> > do loop2 until ce;
> > nop;
> > call outchar;
> > loop2: nop;
> > loop1: nop;
> >
> > outchar is a routine which transmits a character through IO port.
> > When i execute in the board, i got 10 characters for the first time but
> from
> > 2nd time onwards it was 1 characters.
> >
> > What might be the problem & Its soultions please.
>
> I'm not familiar with the 2181, but on other ADI processors you can't have
> a call next to the end of a loop. How deep is the 2181 loop stack?

Or if you do, if you have use the "loop return" (LR) modifier on your return.
For Sendhil, try adding a few NOPs after the call.
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com



Reply by Mike Rosing November 4, 20052005-11-04
On Fri, 4 Nov 2005, Sendhil Kumar wrote:

> Dear Friends,
> I have a problem in ADSP2181.
>
> The board that i'm using is a one which is developed by us. I have a routine
> to send a character through UART, which i have called in a nested loop. The
> problem that i face is that the number of character that displayed is not
> same as that of my loop counter values. But this happens only for the first
> time & from the next time onwards it is equal to the number of times that i
> expect.
>
> cntr = 1;
> do loop1 until ce;
> cntr = 1;
> do loop2 until ce;
> nop;
> call outchar;
> loop2: nop;
> loop1: nop;
>
> outchar is a routine which transmits a character through IO port.
> When i execute in the board, i got 10 characters for the first time but from
> 2nd time onwards it was 1 characters.
>
> What might be the problem & Its soultions please.

I'm not familiar with the 2181, but on other ADI processors you can't have
a call next to the end of a loop. How deep is the 2181 loop stack?

Patience, persistence, truth,
Dr. mike