DSPRelated.com
Forums

Blackfin - ISR not executed

Started by vicwan713 November 15, 2002
Can someone familiar with Blackfin help me on this? I am using PF7 as
PF Interrupt A. The intrrupt is obviously detected because SIC_ISR is
set to 0x00020000 (PF Int A is asserted). However, when I press SW7
(PF7), nothing happens.
My SIC_IMASK is 0x0002000 so PF Interrupt is enabled.
The SIC_IAR2 is 0x0000050 (FP Interrupt A - Peripheral #17 is mapped
to IVG 12).
I am sure my ISR for IVG12 is defined and registered because ISR
responds to raise_intr(12).

Thanks.

#include "def21535.h"
#include "ccblkfn.h"
#include <sys/exception.h>

/*global variables*/
volatile unsigned short * fio_dir_reg;
volatile unsigned short * fio_set_reg;
volatile unsigned short * fio_clr_reg;
volatile unsigned short * fio_maska_s;
volatile unsigned short * fio_maska_c;
volatile unsigned long * fio_sic_imask;
volatile unsigned long * fio_sic_iar2;
volatile unsigned short * fio_polar_reg;
volatile unsigned short * fio_edge_reg;
volatile unsigned short * fio_both_reg;

/*function prototype*/
void raise_intr(int);
void sti(unsigned mask);
unsigned cli();
EX_INTERRUPT_HANDLER(flash); /*void main()*/
void main()
{

/* setup the general purpose register first */
fio_dir_reg = (unsigned short *)FIO_DIR;
fio_set_reg = (unsigned short *)FIO_FLAG_S;
fio_clr_reg = (unsigned short *)FIO_FLAG_C;
fio_maska_s = (unsigned short *)FIO_MASKA_S;
fio_maska_c = (unsigned short *)FIO_MASKA_C;
fio_sic_imask = (unsigned long *)SIC_IMASK;
fio_sic_iar2 = (unsigned long *)SIC_IAR2;
fio_polar_reg = (unsigned short *)FIO_POLAR;
fio_edge_reg = (unsigned short *)FIO_EDGE;
fio_both_reg = (unsigned short *)FIO_BOTH;

/* disable interrupts */
cli();

/* set PF0 - PF3 as output */
*fio_dir_reg = (unsigned short)0x000F;
asm("ssync;");

/* set SIC_IMASK */
*fio_sic_imask = (unsigned long)SIC_MASK17;

/* set SIC_IAR2 */
//IAR 5 -> Int A -> IVG 12
*fio_sic_iar2 = (unsigned long)P17_IVG12;

/* set FIO_POLAR */
*fio_polar_reg = (unsigned short)0x0000;

/* set FIO_EDGE */
*fio_edge_reg = (unsigned short)0x0080;

/* set FIO_BOTH */
*fio_both_reg = (unsigned short)0x0000;

/* set PF mask A 0x0080*/
*fio_maska_s = (unsigned short)0xFFFF;
*fio_maska_c = (unsigned short)0xFF7F;

asm("ssync;");

/* register handler, set IMASK and enable interrupts*/
register_handler(ik_ivg12,flash);

//raise_intr(12);

while(1);
}

EX_INTERRUPT_HANDLER(flash)
{
*fio_clr_reg = (unsigned short)0x0080;
putchar('t');
}



What chip version do you have?
If you have 0.2 there is a problem with the SIC_IMASK. The problem is that a
"0" enable the interrupt and a "1" disable interrupt. This is corrected in
the next releases.

/Erik

-----Original Message-----
From: vicwan713 [mailto:]
Sent: 15. november 2002 20:35
To:
Subject: [adsp] Blackfin - ISR not executed

Can someone familiar with Blackfin help me on this? I am using PF7 as
PF Interrupt A. The intrrupt is obviously detected because SIC_ISR is
set to 0x00020000 (PF Int A is asserted). However, when I press SW7
(PF7), nothing happens.
My SIC_IMASK is 0x0002000 so PF Interrupt is enabled.
The SIC_IAR2 is 0x0000050 (FP Interrupt A - Peripheral #17 is mapped
to IVG 12).
I am sure my ISR for IVG12 is defined and registered because ISR
responds to raise_intr(12).

Thanks.

#include "def21535.h"
#include "ccblkfn.h"
#include <sys/exception.h>

/*global variables*/
volatile unsigned short * fio_dir_reg;
volatile unsigned short * fio_set_reg;
volatile unsigned short * fio_clr_reg;
volatile unsigned short * fio_maska_s;
volatile unsigned short * fio_maska_c;
volatile unsigned long * fio_sic_imask;
volatile unsigned long * fio_sic_iar2;
volatile unsigned short * fio_polar_reg;
volatile unsigned short * fio_edge_reg;
volatile unsigned short * fio_both_reg;

/*function prototype*/
void raise_intr(int);
void sti(unsigned mask);
unsigned cli();
EX_INTERRUPT_HANDLER(flash); /*void main()*/
void main()
{

/* setup the general purpose register first */
fio_dir_reg = (unsigned short *)FIO_DIR;
fio_set_reg = (unsigned short *)FIO_FLAG_S;
fio_clr_reg = (unsigned short *)FIO_FLAG_C;
fio_maska_s = (unsigned short *)FIO_MASKA_S;
fio_maska_c = (unsigned short *)FIO_MASKA_C;
fio_sic_imask = (unsigned long *)SIC_IMASK;
fio_sic_iar2 = (unsigned long *)SIC_IAR2;
fio_polar_reg = (unsigned short *)FIO_POLAR;
fio_edge_reg = (unsigned short *)FIO_EDGE;
fio_both_reg = (unsigned short *)FIO_BOTH;

/* disable interrupts */
cli();

/* set PF0 - PF3 as output */
*fio_dir_reg = (unsigned short)0x000F;
asm("ssync;");

/* set SIC_IMASK */
*fio_sic_imask = (unsigned long)SIC_MASK17;

/* set SIC_IAR2 */
//IAR 5 -> Int A -> IVG 12
*fio_sic_iar2 = (unsigned long)P17_IVG12;

/* set FIO_POLAR */
*fio_polar_reg = (unsigned short)0x0000;

/* set FIO_EDGE */
*fio_edge_reg = (unsigned short)0x0080;

/* set FIO_BOTH */
*fio_both_reg = (unsigned short)0x0000;

/* set PF mask A 0x0080*/
*fio_maska_s = (unsigned short)0xFFFF;
*fio_maska_c = (unsigned short)0xFF7F;

asm("ssync;");

/* register handler, set IMASK and enable interrupts*/
register_handler(ik_ivg12,flash);

//raise_intr(12);

while(1);
}

EX_INTERRUPT_HANDLER(flash)
{
*fio_clr_reg = (unsigned short)0x0080;
putchar('t');
} _____________________________________
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/