DSPRelated.com
Forums

AW: IRQ2 interrupt

Started by Christoph Ripcke October 1, 2002
Hi everybody,

several years ago I had the same problem on an '61 eval-board. I never made
the UART interrupt run on it. I solved the problem by connecting the IRQ2 to
IRQ1 (IRQ0???) and used that one instead. That worked fine and no changes in
software were needed (according to functionallity). My only idea was that
the download/debug software holds hand on the IRQ vector.

regards
Christoph

>>-----Ursprgliche Nachricht-----
>>Von: ask2amol [mailto:]
>>Gesendet: Dienstag, 1. Oktober 2002 10:16
>>An:
>>Betreff: [adsp] IRQ2 interrupt
>>
>>
>>Hello,
>>
>>I am using an ADSP-21061 processor. I have 1 interrupt running: the
>>IRQ2. To setup the interrupt vector, I am
>>using the C library function (provided with my ADI compile tools)
>>"interrupt".
>>
>>Here's a code snip:
>>
>>//initialize IRQ2 interrupt - UART service
>>interrupt(SIG_IRQ2,uart_handler);
>>
>>The code for IRQ2 never gets hit. I have confirmed (several times)
>>that I am getting a good, clean interrupt on the IRQ2 pin. What could
>>be the problem? I'm not disabling any interrupts anywhere in the
>>code. The global interrupt enable bit is set (enabled).
>>
>>
>>
>>_____________________________________
>>Note: If you do a simple "reply" with your email client, only
>>the author of this message will receive your answer. You
>>need to do a "reply all" if you want your answer to be
>>distributed to the entire group.
>>
>>_____________________________________
>>About this discussion group:
>>
>>To Join: Send an email to
>>
>>To Post: Send an email to
>>
>>To Leave: Send an email to
>>
>>Archives: http://groups.yahoo.com/group/adsp
>>
>>Other Groups: http://www.dsprelated.com/groups.php3
>>
>>
>>">http://docs.yahoo.com/info/terms/
>>
>>





Hi,
I am sure that the uart is generating interrupt
But the processor is not getting interrupted.

i.e it is not going to my isr routine.

I am attaching my C program please have a look at it.

Regards

amol

#include<21060.h>
#include<stdio.h>
#include<signal.h>
#include "defuart.h"
#include<def21060.h>
asm("#include<def21060.h>");

#define setIOP(addr,val) (*(int *)addr)=(val)
#define getIOP(addr) (*(int *)addr)
#define ms1 0x00402000

volatile int buffer;
int togg=0;

void transbyte(int sig);
void toggle1();
void toggle2();
void main()
{
initialise();
while(1)
{
//setIOP((ms1+THR_ADDR),0x61);

if(togg==1)
toggle2();
//else
// toggle1();
}
}

initialise()
{
setIOP((ms1+IER_ADDR),0x00);
asm("BIT CLR MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ2I;");

interrupt(SIG_IRQ2,transbyte);

asm("USTAT1 = dm(WAIT);");
asm("bit clr USTAT1 0x000003E0;");
asm("bit set USTAT1 0x00000340;");
asm("dm(WAIT) = USTAT1;");
setIOP((ms1+LCR_ADDR),0x83);

setIOP((ms1+DLL_ADDR),0x78);

setIOP((ms1+DLM_ADDR),0x00);

setIOP((ms1+LCR_ADDR),0x03);

setIOP((ms1+FCR_ADDR),0x01);
setIOP((ms1+MCR_ADDR),0x00);

while(1)
{

buffer=getIOP((ms1+LSR_ADDR));
if(buffer & 1)
buffer=getIOP((ms1+RBR_ADDR));
else
break;
}
buffer=getIOP((ms1+MSR_ADDR));
buffer=getIOP((ms1+IIR_ADDR));

// setIOP((ms1+IER_ADDR),0x01);
setIOP((ms1+MCR_ADDR),0x02); //setIOP(IRQ2I,0x00000043);
// setIOP(IRPTEN,0x00001000);

asm("USTAT1 = dm(WAIT);");
asm("bit clr USTAT1 0x000003E0;");
asm("bit set USTAT1 0x00000340;");
asm("dm(WAIT) = USTAT1;"); asm("BIT SET MODE1 RND32 | NESTM;");
asm("BIT CLR MODE1 IRPTEN;");

//asm("BIT SET MODE2 IRQ0E | IRQ1E | FLG0O | FLG2O |
FLG3O;");

asm("BIT CLR MODE2 IRQ2E | FLG1O ;");

asm("BIT SET MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ0I;");
asm("BIT CLR IMASK IRQ1I;");
asm("BIT SET IMASK IRQ2I;");
setIOP((ms1+IER_ADDR),0x01);

}

void transbyte(int sig)
{
asm("BIT CLR MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ2I;");

/* buffer=getIOP((ms1+ LSR_ADDR));
if(buffer & 1)
{
buffer=getIOP((ms1+ LSR_ADDR));
togg=1;
// toggle2();

} */
buffer = getIOP(ms1+RBR_ADDR);
togg=1;
setIOP((ms1+THR_ADDR),0x61);
setIOP((ms1+MCR_ADDR),0x02);

asm("BIT SET MODE1 IRPTEN;");
asm("BIT SET IMASK IRQ2I;");
}

void toggle1()
{
int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, SET_FLAG);
}

void toggle2()
{
int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, SET_FLAG);
}
--- Christoph Ripcke <> wrote: >
Hi everybody,
>
> several years ago I had the same problem on an '61
> eval-board. I never made
> the UART interrupt run on it. I solved the problem
> by connecting the IRQ2 to
> IRQ1 (IRQ0???) and used that one instead. That
> worked fine and no changes in
> software were needed (according to functionallity).
> My only idea was that
> the download/debug software holds hand on the IRQ
> vector.
>
> regards
> Christoph
>
> >>-----Ursprgliche Nachricht-----
> >>Von: ask2amol [mailto:]
> >>Gesendet: Dienstag, 1. Oktober 2002 10:16
> >>An:
> >>Betreff: [adsp] IRQ2 interrupt
> >>
> >>
> >>Hello,
> >>
> >>I am using an ADSP-21061 processor. I have 1
> interrupt running: the
> >>IRQ2. To setup the interrupt vector, I am
> >>using the C library function (provided with my ADI
> compile tools)
> >>"interrupt".
> >>
> >>Here's a code snip:
> >>
> >>//initialize IRQ2 interrupt - UART service
> >>interrupt(SIG_IRQ2,uart_handler);
> >>
> >>The code for IRQ2 never gets hit. I have confirmed
> (several times)
> >>that I am getting a good, clean interrupt on the
> IRQ2 pin. What could
> >>be the problem? I'm not disabling any interrupts
> anywhere in the
> >>code. The global interrupt enable bit is set
> (enabled).
> >>
> >>
> >>
> >>_____________________________________
> >>Note: If you do a simple "reply" with your email
> client, only
> >>the author of this message will receive your
> answer. You
> >>need to do a "reply all" if you want your answer
> to be
> >>distributed to the entire group.
> >>
> >>_____________________________________
> >>About this discussion group:
> >>
> >>To Join: Send an email to
>
> >>
> >>To Post: Send an email to
> >>
> >>To Leave: Send an email to
>
> >>
> >>Archives: http://groups.yahoo.com/group/adsp
> >>
> >>Other Groups:
> http://www.dsprelated.com/groups.php3
> >>
> >>
> >>">http://docs.yahoo.com/info/terms/
> >>
> >>

________________________________________________________________________
Missed your favourite TV serial last night? Try the new, Yahoo! TV.
visit http://in.tv.yahoo.com


#include<21060.h>
#include<stdio.h>
#include<signal.h>
#include "defuart.h"
#include<def21060.h>
asm("#include<def21060.h>");

#define setIOP(addr,val) (*(int *)addr)=(val)
#define getIOP(addr) (*(int *)addr)
#define ms1 0x00402000

volatile int buffer;
int togg=0;

void transbyte(int sig);
void toggle1();
void toggle2();
void main()
{
initialise();
while(1)
{
//setIOP((ms1+THR_ADDR),0x61);

if(togg==1)
toggle2();
//else
// toggle1();
}
}

initialise()
{
setIOP((ms1+IER_ADDR),0x00);
asm("BIT CLR MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ2I;");

interrupt(SIG_IRQ2,transbyte);

asm("USTAT1 = dm(WAIT);");
asm("bit clr USTAT1 0x000003E0;");
asm("bit set USTAT1 0x00000340;");
asm("dm(WAIT) = USTAT1;");
setIOP((ms1+LCR_ADDR),0x83);

setIOP((ms1+DLL_ADDR),0x78);

setIOP((ms1+DLM_ADDR),0x00);

setIOP((ms1+LCR_ADDR),0x03);

setIOP((ms1+FCR_ADDR),0x01);
setIOP((ms1+MCR_ADDR),0x00);

while(1)
{

buffer=getIOP((ms1+LSR_ADDR));
if(buffer & 1)
buffer=getIOP((ms1+RBR_ADDR));
else
break;
}
buffer=getIOP((ms1+MSR_ADDR));
buffer=getIOP((ms1+IIR_ADDR));

// setIOP((ms1+IER_ADDR),0x01);
setIOP((ms1+MCR_ADDR),0x02); //setIOP(IRQ2I,0x00000043);
// setIOP(IRPTEN,0x00001000);

asm("USTAT1 = dm(WAIT);");
asm("bit clr USTAT1 0x000003E0;");
asm("bit set USTAT1 0x00000340;");
asm("dm(WAIT) = USTAT1;"); asm("BIT SET MODE1 RND32 | NESTM;");
asm("BIT CLR MODE1 IRPTEN;");

//asm("BIT SET MODE2 IRQ0E | IRQ1E | FLG0O | FLG2O | FLG3O;");

asm("BIT CLR MODE2 IRQ2E | FLG1O ;");

asm("BIT SET MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ0I;");
asm("BIT CLR IMASK IRQ1I;");
asm("BIT SET IMASK IRQ2I;");
setIOP((ms1+IER_ADDR),0x01);

}

void transbyte(int sig)
{
asm("BIT CLR MODE1 IRPTEN;");
asm("BIT CLR IMASK IRQ2I;");

/* buffer=getIOP((ms1+ LSR_ADDR));
if(buffer & 1)
{
buffer=getIOP((ms1+ LSR_ADDR));
togg=1;
// toggle2();

} */
buffer = getIOP(ms1+RBR_ADDR);
togg=1;
setIOP((ms1+THR_ADDR),0x61);
setIOP((ms1+MCR_ADDR),0x02);

asm("BIT SET MODE1 IRPTEN;");
asm("BIT SET IMASK IRQ2I;");
}

void toggle1()
{
int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, SET_FLAG);
}

void toggle2()
{
int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, SET_FLAG);
}



Don't touch IMASK. The interrupt() library function and the dispatcher
in the library take care of that for you. Within an ISR, only disable
interrupts if nesting is enabled and you don't want a higher-priority
interrupt to trigger. Same-priority interrupts won't be taken while your
ISR is running, as the IMASKP register will have a bit set preventing
that.

[Please direct replies to the list.]



now i had not IMASK , still the ISR routine is not
executing.plz help.

#include<21060.h>
#include<signal.h>
#include "defuart.h"
#include<def21060.h>
asm("#include<def21060.h>");

#define setIOP(addr,val) (*(int *)addr)=(val)
#define getIOP(addr) (*(int *)addr)
#define ms1 0x00402000

int buffer=0;
int buffer1=0;
volatile int togg=0;

void initialize();
void transbyte(int sig);
void toggle1();
void toggle2();
void toggle3();

void main()
{
initialize();
while(1)
{
if(togg==1)
toggle2();
}
}

void initialize()
{
setIOP((ms1+IER_ADDR),0x00);

asm("BIT CLR MODE1 IRPTEN;");

interrupt(SIG_IRQ2,transbyte);

setIOP((ms1+LCR_ADDR),0x83);

setIOP((ms1+DLL_ADDR),0x78);

setIOP((ms1+DLM_ADDR),0x00);

setIOP((ms1+LCR_ADDR),0x03);

setIOP((ms1+FCR_ADDR),0x01);

setIOP((ms1+MCR_ADDR),0x00);

buffer=getIOP((ms1+LSR_ADDR));

if(buffer & 1)
buffer=getIOP((ms1+RBR_ADDR));

setIOP((ms1+IER_ADDR),0x01);

setIOP((ms1+MCR_ADDR),0x02);

asm("BIT SET MODE1 IRPTEN;");
}

void transbyte(int sig)
{
asm("BIT CLR MODE1 IRPTEN;");

buffer1=getIOP((ms1+LSR_ADDR));
if(buffer1 & 1)
{
buffer1=getIOP((ms1+RBR_ADDR));
togg=1;
}

asm("BIT SET MODE1 IRPTEN;");
}

void toggle1()
{
long int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG1, SET_FLAG);
}

void toggle2()
{
long int i;
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, CLR_FLAG);
for(i=0;i<500000;i++)
set_flag(SET_FLAG2, SET_FLAG);
} --- Kenneth Porter
<> wrote: > Don't
touch IMASK. The interrupt() library function
> and the dispatcher
> in the library take care of that for you. Within an
> ISR, only disable
> interrupts if nesting is enabled and you don't want
> a higher-priority
> interrupt to trigger. Same-priority interrupts won't
> be taken while your
> ISR is running, as the IMASKP register will have a
> bit set preventing
> that.
>
> [Please direct replies to the list.] > _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/



Hi,

I have a similar problem.
I am using adsp-21061 ezkit. I have program written
in assembly for serial communication, which work fine.

Even my C code which communicate using polling, works
fine.
But it don't work for interrupt driven.

IER reg of uart is set to 0x01 (i.e enabling received
data available interrupt)
I am checking any of the bit is set in IIR reg.
If yes toggle some flag. and the flag do toggle.
That means uart is generating interrupt.

what I fail to understand is why the processor on
receiving interrupt doesn't jump to my isr.

Can anyone help?

Regards

Liyju

--- amol gavande <> wrote:
> now i had not IMASK , still the ISR routine is not
> executing.plz help.
>
> #include<21060.h>
> #include<signal.h>
> #include "defuart.h"
> #include<def21060.h>
> asm("#include<def21060.h>");
>
> #define setIOP(addr,val) (*(int *)addr)=(val)
> #define getIOP(addr) (*(int *)addr)
> #define ms1 0x00402000
>
> int buffer=0;
> int buffer1=0;
> volatile int togg=0;
>
> void initialize();
> void transbyte(int sig);
> void toggle1();
> void toggle2();
> void toggle3();
>
> void main()
> {
> initialize();
> while(1)
> {
> if(togg==1)
> toggle2();
> }
> }
>
> void initialize()
> {
> setIOP((ms1+IER_ADDR),0x00);
>
> asm("BIT CLR MODE1 IRPTEN;");
>
> interrupt(SIG_IRQ2,transbyte);
>
> setIOP((ms1+LCR_ADDR),0x83);
>
> setIOP((ms1+DLL_ADDR),0x78);
>
> setIOP((ms1+DLM_ADDR),0x00);
>
> setIOP((ms1+LCR_ADDR),0x03);
>
> setIOP((ms1+FCR_ADDR),0x01);
>
> setIOP((ms1+MCR_ADDR),0x00);
>
> buffer=getIOP((ms1+LSR_ADDR));
>
> if(buffer & 1)
> buffer=getIOP((ms1+RBR_ADDR));
>
> setIOP((ms1+IER_ADDR),0x01);
>
> setIOP((ms1+MCR_ADDR),0x02);
>
> asm("BIT SET MODE1 IRPTEN;");
> }
>
> void transbyte(int sig)
> {
> asm("BIT CLR MODE1 IRPTEN;");
>
> buffer1=getIOP((ms1+LSR_ADDR));
> if(buffer1 & 1)
> {
> buffer1=getIOP((ms1+RBR_ADDR));
> togg=1;
> }
>
> asm("BIT SET MODE1 IRPTEN;");
> }
>
> void toggle1()
> {
> long int i;
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG1, CLR_FLAG);
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG1, SET_FLAG);
> }
>
> void toggle2()
> {
> long int i;
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG2, CLR_FLAG);
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG2, SET_FLAG);
> } > --- Kenneth Porter
> <> wrote: > Don't
> touch IMASK. The interrupt() library function
> > and the dispatcher
> > in the library take care of that for you. Within
> an
> > ISR, only disable
> > interrupts if nesting is enabled and you don't
> want
> > a higher-priority
> > interrupt to trigger. Same-priority interrupts
> won't
> > be taken while your
> > ISR is running, as the IMASKP register will have a
> > bit set preventing
> > that.
> >
> > [Please direct replies to the list.]
> >
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email
> > client, only the author of this message will
> receive
> > your answer. You need to do a "reply all" if you
> > want your answer to be distributed to the entire
> > group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to
> >
> >
> > To Post: Send an email to
> >
> > To Leave: Send an email to
> >
> >
> > Archives: http://groups.yahoo.com/group/adsp
> >
> > Other Groups:
> http://www.dsprelated.com/groups.php3
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/


__________________________________________________


Hi, This is with respect to the use of UART and using IRQ2. I have two programs that
worked on the EZ-Kit Lite 21061. Have attached them with this mail. Alok

"Liyju Janardhan" wrote:
Hi,

I have a similar problem.
I am using adsp-21061 ezkit. I have program written
in assembly for serial communication, which work fine.

Even my C code which communicate using polling, works
fine.
But it don't work for interrupt driven.

IER reg of uart is set to 0x01 (i.e enabling received
data available interrupt)
I am checking any of the bit is set in IIR reg.
If yes toggle some flag. and the flag do toggle.
That means uart is generating interrupt.

what I fail to understand is why the processor on
receiving interrupt doesn't jump to my isr.

Can anyone help?

Regards

Liyju

--- amol gavande wrote:
> now i had not IMASK , still the ISR routine is not
> executing.plz help.
>
> #include<21060.h>
> #include
> #include "defuart.h"
> #include
> asm("#include");
>
> #define setIOP(addr,val) (*(int *)addr)=(val)
> #define getIOP(addr) (*(int *)addr)
> #define ms1 0x00402000
>
> int buffer=0;
> int buffer1=0;
> volatile int togg=0;
>
> void initialize();
> void transbyte(int sig);
> void toggle1();
> void toggle2();
> void toggle3();
>
> void main()
> {
> initialize();
> while(1)
> {
> if(togg==1)
> toggle2();
> }
> }
>
> void initialize()
> {
> setIOP((ms1+IER_ADDR),0x00);
>
> asm("BIT CLR MODE1 IRPTEN;");
>
> interrupt(SIG_IRQ2,transbyte);
>
> setIOP((ms1+LCR_ADDR),0x83);
>
> setIOP((ms1+DLL_ADDR),0x78);
>
> setIOP((ms1+DLM_ADDR),0x00);
>
> setIOP((ms1+LCR_ADDR),0x03);
>
> setIOP((ms1+FCR_ADDR),0x01);
>
> setIOP((ms1+MCR_ADDR),0x00);
>
> buffer=getIOP((ms1+LSR_ADDR));
>
> if(buffer & 1)
> buffer=getIOP((ms1+RBR_ADDR));
>
> setIOP((ms1+IER_ADDR),0x01);
>
> setIOP((ms1+MCR_ADDR),0x02);
>
> asm("BIT SET MODE1 IRPTEN;");
> }
>
> void transbyte(int sig)
> {
> asm("BIT CLR MODE1 IRPTEN;");
>
> buffer1=getIOP((ms1+LSR_ADDR));
> if(buffer1 & 1)
> {
> buffer1=getIOP((ms1+RBR_ADDR));
> togg=1;
> }
>
> asm("BIT SET MODE1 IRPTEN;");
> }
>
> void toggle1()
> {
> long int i;
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG1, CLR_FLAG);
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG1, SET_FLAG);
> }
>
> void toggle2()
> {
> long int i;
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG2, CLR_FLAG);
> for(i=0;i<500000;i++)
> set_flag(SET_FLAG2, SET_FLAG);
> } > --- Kenneth Porter
> wrote: > Don't
> touch IMASK. The interrupt() library function
> > and the dispatcher
> > in the library take care of that for you. Within
> an
> > ISR, only disable
> > interrupts if nesting is enabled and you don't
> want
> > a higher-priority
> > interrupt to trigger. Same-priority interrupts
> won't
> > be taken while your
> > ISR is running, as the IMASKP register will have a
> > bit set preventing
> > that.
> >
> > [Please direct replies to the list.]
> >
> >
> > _____________________________________
> > Note: If you do a simple "reply" with your email
> > client, only the author of this message will
> receive
> > your answer. You need to do a "reply all" if you
> > want your answer to be distributed to the entire
> > group.
> >
> > _____________________________________
> > About this discussion group:
> >
> > To Join: Send an email to
> >
> >
> > To Post: Send an email to
> >
> > To Leave: Send an email to
> >
> >
> > Archives: http://groups.yahoo.com/group/adsp
> >
> > Other Groups:
> http://www.dsprelated.com/groups.php3
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/


__________________________________________________ _____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://groups.yahoo.com/group/adsp

Other Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from
http://www.planetm.co.in
Change the way you talk. Indiatimes presents "Valufon", Your PC to Phone service
with clear voice at rates far less than the normal ISD rates. Go to
http://www.valufon.indiatimes.com. Choose your plan. BUY NOW.


Attachment (not stored)
uart_asm.zip
Type: application/x-zip-compressed

Attachment (not stored)
uart_C.zip
Type: application/x-zip-compressed


Hi,
Thanks a lot, alok for sending the files.
I have tried to run your C file.

I am using g21k complier for creating the executable
file.( >g21k -o t.21k serial.c uart.asm )

But your program doesn't run on my board.
I am using ezkit-21061.

I think the same problem persist. i.e on receving
irq2 the processor is not jumping to uart_interrupt().

I have confirmed this by the following way:-
In the main() for(;;) loop after idle(); i have added
a line to toggle flag2.
So when I send a byte using tango, flag2 toggles.
But its not going to the if loop, because NewData is
0. That means uart is generating interrupt, but
uart_interrupt() subroutine is not being called.

What could be the problem? Please help.

Regards

Liyju
--- alokmodak <> wrote:
> Hi, > This is with respect to the use of UART and using
> IRQ2. I have two programs that worked on the EZ-Kit
> Lite 21061. Have attached them with this mail. > Alok
>
> "Liyju Janardhan" wrote: >
> Hi,
>
> I have a similar problem.
> I am using adsp-21061 ezkit. I have program written
> in assembly for serial communication, which work
> fine.
>
> Even my C code which communicate using polling,
> works
> fine.
> But it don't work for interrupt driven.
>
> IER reg of uart is set to 0x01 (i.e enabling
> received
> data available interrupt)
> I am checking any of the bit is set in IIR reg.
> If yes toggle some flag. and the flag do toggle.
> That means uart is generating interrupt.
>
> what I fail to understand is why the processor on
> receiving interrupt doesn't jump to my isr.
>
> Can anyone help?
>
> Regards
>
> Liyju
>
> --- amol gavande wrote:
> > now i had not IMASK , still the ISR routine is
> not


Hi, The programs work over here. I am using the same DSP. Try simulating in VDSP.
Under settings, interrupts set for IRQ2 generation after some cycles. Once the
interrupt is generated the program should jump to UART_Interrupt. How are you
checking the whether the data is recieved on the other side of the UART? You
will need to write a C program to do the same. Alok

"Liyju Janardhan" wrote:
Hi,
Thanks a lot, alok for sending the files.
I have tried to run your C file.

I am using g21k complier for creating the executable
file.( >g21k -o t.21k serial.c uart.asm )

But your program doesn't run on my board.
I am using ezkit-21061.

I think the same problem persist. i.e on receving
irq2 the processor is not jumping to uart_interrupt().

I have confirmed this by the following way:-
In the main() for(;;) loop after idle(); i have added
a line to toggle flag2.
So when I send a byte using tango, flag2 toggles.
But its not going to the if loop, because NewData is
0. That means uart is generating interrupt, but
uart_interrupt() subroutine is not being called.

What could be the problem? Please help.

Regards

Liyju
--- alokmodak wrote:
> Hi, > This is with respect to the use of UART and using
> IRQ2. I have two programs that worked on the EZ-Kit
> Lite 21061. Have attached them with this mail. > Alok
>
> "Liyju Janardhan" wrote: >
> Hi,
>
> I have a similar problem.
> I am using adsp-21061 ezkit. I have program written
> in assembly for serial communication, which work
> fine.
>
> Even my C code which communicate using polling,
> works
> fine.
> But it don't work for interrupt driven.
>
> IER reg of uart is set to 0x01 (i.e enabling
> received
> data available interrupt)
> I am checking any of the bit is set in IIR reg.
> If yes toggle some flag. and the flag do toggle.
> That means uart is generating interrupt.
>
> what I fail to understand is why the processor on
> receiving interrupt doesn't jump to my isr.
>
> Can anyone help?
>
> Regards
>
> Liyju
>
> --- amol gavande wrote:
> > now i had not IMASK , still the ISR routine is
> not
_____________________________________
Note: If you do a simple "reply" with your email client, only the author of this
message will receive your answer. You need to do a "reply all" if you want your
answer to be distributed to the entire group.

_____________________________________
About this discussion group:

To Join: Send an email to

To Post: Send an email to

To Leave: Send an email to

Archives: http://groups.yahoo.com/group/adsp

Other Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy Music, Video, CD-ROM, Audio-Books and Music Accessories from
http://www.planetm.co.in



Hi,
I have tried running the program on
simulator(ezkit
lite) .In execution+setup+AutoInterruptControl i have
set irq2 as periodic (period 0).

while running the program, it remains in idle state-
after some period it jumps to uart_interrupt().

That means the program runs fine in simulator.
But it is not running in our board.
We have few program to send and recieve the bytes,
such as tango.exe, buff1024.c.

We are sending buff1024.c to you.
plz check whether it is receving the byte & wat is the
problem.
when we send some bytes(i.e pressing some keys through
keyboard) we r receiving 0. i.e the ELSE condition is
executed. i.e it is not going to the ISR routine.

Please help, --- alokmodak <> wrote:
> Hi, > The programs work over here. I am using the same
> DSP. Try simulating in VDSP. Under settings,
> interrupts set for IRQ2 generation after some
> cycles. Once the interrupt is generated the program
> should jump to UART_Interrupt. How are you checking
> the whether the data is recieved on the other side
> of the UART? You will need to write a C program to
> do the same. > Alok
>
> "Liyju Janardhan" wrote: >
> Hi,
> Thanks a lot, alok for sending the files.
> I have tried to run your C file.
>
> I am using g21k complier for creating the executable
> file.( >g21k -o t.21k serial.c uart.asm )
>
> But your program doesn't run on my board.
> I am using ezkit-21061.
>
> I think the same problem persist. i.e on receving
> irq2 the processor is not jumping to
> uart_interrupt().
>
> I have confirmed this by the following way:-
> In the main() for(;;) loop after idle(); i have
> added
> a line to toggle flag2.
> So when I send a byte using tango, flag2 toggles.
> But its not going to the if loop, because NewData is
> 0. That means uart is generating interrupt, but
> uart_interrupt() subroutine is not being called.
>
> What could be the problem? Please help.
>
> Regards
>
> Liyju >
> --- alokmodak wrote:
> > Hi,
> >
> >
> > This is with respect to the use of UART and using
> > IRQ2. I have two programs that worked on the
> EZ-Kit
> > Lite 21061. Have attached them with this mail.
> >
> >
> > Alok
> >
> > "Liyju Janardhan" wrote:
> >
> >
> >
> > Hi,
> >
> > I have a similar problem.
> > I am using adsp-21061 ezkit. I have program
> written
> > in assembly for serial communication, which work
> > fine.
> >
> > Even my C code which communicate using polling,
> > works
> > fine.
> > But it don't work for interrupt driven.
> >
> > IER reg of uart is set to 0x01 (i.e enabling
> > received
> > data available interrupt)
> > I am checking any of the bit is set in IIR reg.
> > If yes toggle some flag. and the flag do toggle.
> > That means uart is generating interrupt.
> >
> > what I fail to understand is why the processor on
> > receiving interrupt doesn't jump to my isr.
> >
> > Can anyone help?
> >
> > Regards
> >
> > Liyju
> >
> > --- amol gavande wrote:
> > > now i had not IMASK , still the ISR routine is
> > not >
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/ >
> Get Your Private, Free E-mail from Indiatimes at
> http://email.indiatimes.com
> Buy Music, Video, CD-ROM, Audio-Books and Music
> Accessories from http://www.planetm.co.in >
> _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to > To Post: Send an email to
>
> To Leave: Send an email to > Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/
__________________________________________________


/* Name : Sample Comm's Program - 1024 Byte Buffer - buff1024.c */
/* Written By : Craig Peacock <> */

/* Copyright 1997 CRAIG PEACOCK <> */

/* See http://www.senet.com.au/~cpeacock/serial1.htm */
/* For More Information */

#include <dos.h>
#include <stdio.h>
#include <conio.h>

#define PORT1 0x3F8 /* Port Address Goes Here */
#define INTVECT 0x0C /* Com Port's IRQ here (Must also change PIC setting) */

/* Defines Serial Ports Base Address */
/* COM1 0x3F8 */
/* COM2 0x2F8 */
/* COM3 0x3E8 */
/* COM4 0x2E8 */

int bufferin = 0;
int bufferout = 0;
char ch;
char buffer[1025];

void interrupt (*oldport1isr)();

void interrupt PORT1INT() /* Interrupt Service Routine (ISR) for PORT1 */
{
int c;
do { c = inportb(PORT1 + 5);
if (c & 1) {buffer[bufferin] = inportb(PORT1);
bufferin++;
if (bufferin == 1024) {bufferin = 0;}}
}while (c & 1);
outportb(0x20,0x20);
}

void main(void)
{
int c;
outportb(PORT1 + 1 , 0); /* Turn off interrupts - Port1 */

oldport1isr = getvect(INTVECT); /* Save old Interrupt Vector of later
recovery */

setvect(INTVECT, PORT1INT); /* Set Interrupt Vector Entry */
/* COM1 - 0x0C */
/* COM2 - 0x0B */
/* COM3 - 0x0C */
/* COM4 - 0x0B */

/* PORT 1 - Communication Settings */

outportb(PORT1 + 3 , 0x80); /* SET DLAB ON */
outportb(PORT1 + 0 , 0x0C); /* Set Baud rate - Divisor Latch Low Byte */
/* Default 0x03 = 38,400 BPS */
/* 0x01 = 115,200 BPS */
/* 0x02 = 57,600 BPS */
/* 0x06 = 19,200 BPS */
/* 0x0C = 9,600 BPS */
/* 0x18 = 4,800 BPS */
/* 0x30 = 2,400 BPS */
outportb(PORT1 + 1 , 0x00); /* Set Baud rate - Divisor Latch High Byte */
outportb(PORT1 + 3 , 0x03); /* 8 Bits, No Parity, 1 Stop Bit */
outportb(PORT1 + 2 , 0xC7); /* FIFO Control Register */
outportb(PORT1 + 4 , 0x0B); /* Turn on DTR, RTS, and OUT2 */

outportb(0x21,(inportb(0x21) & 0xEF)); /* Set Programmable Interrupt
Controller */
/* COM1 (IRQ4) - 0xEF */
/* COM2 (IRQ3) - 0xF7 */
/* COM3 (IRQ4) - 0xEF */
/* COM4 (IRQ3) - 0xF7 */

outportb(PORT1 + 1 , 0x01); /* Interrupt when data received */

printf("\nSample Comm's Program. Press ESC to quit \n");

do {

if (bufferin != bufferout){ch = buffer[bufferout];
bufferout++;
if (bufferout == 1024) {bufferout = 0;}
printf("%c",ch);}

if (kbhit()){c = getch();
outportb(PORT1, c);}

} while (c !');

outportb(PORT1 + 1 , 0); /* Turn off interrupts - Port1 */
outportb(0x21,(inportb(0x21) | 0x10)); /* MASK IRQ using PIC */
/* COM1 (IRQ4) - 0x10 */
/* COM2 (IRQ3) - 0x08 */
/* COM3 (IRQ4) - 0x10 */
/* COM4 (IRQ3) - 0x08 */
setvect(INTVECT, oldport1isr); /* Restore old interrupt vector */

}