DSPRelated.com
Forums

Unable read CIPR bit

Started by anse...@yahoo.com May 28, 2008
Hi Everybody

I have written following code in which I am trying to use EDMA to copy data from one memory location to other. The data is successfully being transfered but EDMA doesnt generate interrupt and it is not because of TCINT because TCINT=YES.

Anybody has any clue. Your help is very much appreciated

Kind Regards
Here is the Code for reference

/*
* ======== main.c ======= * This file contains all the functions for Lab2 except
* SINE_init() and SINE_blockFill().
*/

/*
* ======== Include files ======= */
#include
#include
#include
#include
/*
* ======== Declarations ======= */
#define BUFFSIZE 32

/*
* ======== Prototypes ======= */
void edmaHwi(int tcc);
void initHwi(void);
/*
* ======== Global Variables ======= */

short gBufRcv[BUFFSIZE]={0,1951,3827,5556,7071,8315,9239,9808,10000,9808,9239,8315,7071,5556,3827,1951,0,-1951,-3827,-5556,-7071,-8315,-9239,-9808,-10000,-9808,-9239,-8315,-7071,-5556,-3827,-1951};
short gBufXmt[BUFFSIZE]={0};
int dummy = 0;
int i;
int temp;
short test[BUFFSIZE]={9};
short test1[BUFFSIZE]={9};
short gTCC;
EDMA_Handle hEdmaCopy;

EDMA_Config gEdmaConfigCopy = {
EDMA_OPT_RMK(
EDMA_OPT_PRI_LOW, // Priority
EDMA_OPT_ESIZE_16BIT, // Element size
EDMA_OPT_2DS_NO, // 2 dimensional source
EDMA_OPT_SUM_INC, // Src update mode
EDMA_OPT_2DD_NO, // 2 dimensional dest
EDMA_OPT_DUM_INC, // Dest update mode
EDMA_OPT_TCINT_YES, // Cause EDMA interrupt
EDMA_OPT_TCC_OF(2), // Transfer Complete Code
// EDMA_OPT_TCCM_DEFAULT, // Transfer Complete Code Upper Bits (c64x only)
// EDMA_OPT_ATCINT_DEFAULT, // Alternate TCC Interrupt (c64x only)
// EDMA_OPT_ATCC_DEFAULT, // Alternate Transfer Complete Code (c64x only)
// EDMA_OPT_PDTS_DEFAULT, // Peripheral Device Transfer Source (c64x only)
// EDMA_OPT_PDTD_DEFAULT, // Peripheral Device Transfer Dest (c64x only)
EDMA_OPT_LINK_NO, // Enable link parameters
EDMA_OPT_FS_NO // Use frame sync
),
EDMA_SRC_OF(gBufRcv), // src address
EDMA_CNT_OF(BUFFSIZE), // Count = buffer size
EDMA_DST_OF(gBufXmt), // dest address
EDMA_IDX_OF(0), // frame/element index value
EDMA_RLD_OF(0) // reload
};

/*
* ======== main ======= */
void main()
{
initHwi();

dummy ;

hEdmaCopy = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_RESET);

EDMA_config(hEdmaCopy,&gEdmaConfigCopy);

EDMA_intEnable(2);
tempA_intTest(2);

for (i=0;i<32;i++){
EDMA_setChannel(hEdmaCopy);
test[i]A_getChannel(hEdmaCopy);
}

while (1) {
// Loop Forever
}
}

void edmaHwi(int tcc)
{
dummy990;
}

/*
* ======== initHwi ======== */

void initHwi(void)
{ //dummy33;

IRQ_enable(IRQ_EVT_EDMAINT);
IRQ_globalEnable();
}
anserme,

Maybe I'm missing something important, but I do not see the interrupt functions that need to be
executed when the interrupt occurs.

Does this mean that those functions have not been written and addresses put in the interrupt vector
table?

R. Williams
---------- Original Message -----------
From: a...@yahoo.com
To: c...
Sent: Wed, 28 May 2008 19:15:02 -0400
Subject: [c6x] Unable read CIPR bit

> Hi Everybody
>
> I have written following code in which I am trying to use EDMA to copy data from one
> memory location to other. The data is successfully being transfered but EDMA doesnt
> generate interrupt and it is not because of TCINT because TCINT=YES.
>
> Anybody has any clue. Your help is very much appreciated
>
> Kind Regards
> Here is the Code for reference
>
> /*
> * ======== main.c =======> * This file contains all the functions for Lab2 except
> * SINE_init() and SINE_blockFill().
> */
>
> /*
> * ======== Include files =======> */
> #include
> #include
> #include
> #include /*
> * ======== Declarations =======> */
> #define BUFFSIZE 32
>
> /*
> * ======== Prototypes =======> */
> void edmaHwi(int tcc);
> void initHwi(void);
> /*
> * ======== Global Variables =======> */
>
> short gBufRcv[BUFFSIZE]={0,1951,3827,5556,7071,8315,9239,9808,10000,9808,9239,8315,7071,
> 5556,3827,1951,0,-1951,-3827,-5556,-7071,-8315,-9239,-9808,-10000,-9808,-9239,-8315,-7071,-
> 5556,-3827,-1951}; short gBufXmt[BUFFSIZE]={0}; int dummy = 0; int i; int temp; short
test[BUFFSIZE]={9};
> short test1[BUFFSIZE]={9};
> short gTCC;
> EDMA_Handle hEdmaCopy;
>
> EDMA_Config gEdmaConfigCopy = {
> EDMA_OPT_RMK(
> EDMA_OPT_PRI_LOW, // Priority
> EDMA_OPT_ESIZE_16BIT, // Element size
> EDMA_OPT_2DS_NO, // 2 dimensional source
> EDMA_OPT_SUM_INC, // Src update mode
> EDMA_OPT_2DD_NO, // 2 dimensional dest
> EDMA_OPT_DUM_INC, // Dest update mode
> EDMA_OPT_TCINT_YES, // Cause EDMA interrupt
> EDMA_OPT_TCC_OF(2), // Transfer Complete Code
> // EDMA_OPT_TCCM_DEFAULT, // Transfer Complete Code Upper Bits (c64x only)
> // EDMA_OPT_ATCINT_DEFAULT, // Alternate TCC Interrupt (c64x only)
> // EDMA_OPT_ATCC_DEFAULT, // Alternate Transfer Complete Code (c64x only)
> // EDMA_OPT_PDTS_DEFAULT, // Peripheral Device Transfer Source (c64x only)
> // EDMA_OPT_PDTD_DEFAULT, // Peripheral Device Transfer Dest (c64x only)
> EDMA_OPT_LINK_NO, // Enable link parameters
> EDMA_OPT_FS_NO // Use frame sync
> ),
> EDMA_SRC_OF(gBufRcv), // src address
> EDMA_CNT_OF(BUFFSIZE), // Count = buffer size
> EDMA_DST_OF(gBufXmt), // dest address
> EDMA_IDX_OF(0), // frame/element index value
> EDMA_RLD_OF(0) // reload
> };
>
> /*
> * ======== main =======> */
> void main()
> {
> initHwi();
>
> dummy ;
>
> hEdmaCopy = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_RESET);
>
> EDMA_config(hEdmaCopy,&gEdmaConfigCopy);
>
> EDMA_intEnable(2);
> tempA_intTest(2);
>
> for (i=0;i<32;i++){
> EDMA_setChannel(hEdmaCopy);
> test[i]A_getChannel(hEdmaCopy);
> }
>
> while (1) {
> // Loop Forever
> }
> }
>
> void edmaHwi(int tcc)
> {
> dummy990;
> }
>
> /*
> * ======== initHwi ========> */
>
> void initHwi(void)
> { //dummy33;
>
> IRQ_enable(IRQ_EVT_EDMAINT);
> IRQ_globalEnable();
> }
------- End of Original Message -------
Dear William

Thanks for your response. I am using DSK TMS320C6713. Actually the function edmaHwi(); just at the
bottom of the code is my interrupt service routine. This ISR does nothing except setting a new
value to a variable called 'dummy'. I have set this ISR in response to INT8 (in config tool) which
happens to be the default interrupt of EDMA.

The problem I am facing is from EDMA side. The edma is not generating the interrupt when it
completes the transfer from one memory location to other. This may be because of transfer count
NOT going to zero or some other problem. I have set TCINT=YES, TCC(bit16 to 19)= 2. Now when I am
checking CIPR bit 2 using testA_intTest(2); and viewing 'test' in watch window; I get 'test'
equals to 0.

Anyone has any idea; I shall be very grateful
Kind regards

Anser Mehboob

--- Richard Williams wrote:

>
> anserme,
>
> Maybe I'm missing something important, but I do not see the interrupt functions that need to be
> executed when the interrupt occurs.
>
> Does this mean that those functions have not been written and addresses put in the interrupt
> vector
> table?
>
> R. Williams
> ---------- Original Message -----------
> From: a...@yahoo.com
> To: c...
> Sent: Wed, 28 May 2008 19:15:02 -0400
> Subject: [c6x] Unable read CIPR bit
>
> > Hi Everybody
> >
> > I have written following code in which I am trying to use EDMA to copy data from one
> > memory location to other. The data is successfully being transfered but EDMA doesnt
> > generate interrupt and it is not because of TCINT because TCINT=YES.
> >
> > Anybody has any clue. Your help is very much appreciated
> >
> > Kind Regards
> > Here is the Code for reference
> >
> > /*
> > * ======== main.c =======> > * This file contains all the functions for Lab2 except
> > * SINE_init() and SINE_blockFill().
> > */
> >
> > /*
> > * ======== Include files =======> > */
> > #include
> > #include
> > #include
> > #include
> >
> > /*
> > * ======== Declarations =======> > */
> > #define BUFFSIZE 32
> >
> > /*
> > * ======== Prototypes =======> > */
> > void edmaHwi(int tcc);
> > void initHwi(void);
> > /*
> > * ======== Global Variables =======> > */
> >
> > short gBufRcv[BUFFSIZE]={0,1951,3827,5556,7071,8315,9239,9808,10000,9808,9239,8315,7071,
> > 5556,3827,1951,0,-1951,-3827,-5556,-7071,-8315,-9239,-9808,-10000,-9808,-9239,-8315,-7071,-
> > 5556,-3827,-1951}; short gBufXmt[BUFFSIZE]={0}; int dummy = 0; int i; int temp; short
> test[BUFFSIZE]={9};
> > short test1[BUFFSIZE]={9};
> > short gTCC;
> > EDMA_Handle hEdmaCopy;
> >
> > EDMA_Config gEdmaConfigCopy = {
> > EDMA_OPT_RMK(
> > EDMA_OPT_PRI_LOW, // Priority
> > EDMA_OPT_ESIZE_16BIT, // Element size
> > EDMA_OPT_2DS_NO, // 2 dimensional source
> > EDMA_OPT_SUM_INC, // Src update mode
> > EDMA_OPT_2DD_NO, // 2 dimensional dest
> > EDMA_OPT_DUM_INC, // Dest update mode
> > EDMA_OPT_TCINT_YES, // Cause EDMA interrupt
> > EDMA_OPT_TCC_OF(2), // Transfer Complete Code
> > // EDMA_OPT_TCCM_DEFAULT, // Transfer Complete Code Upper Bits (c64x only)
> > // EDMA_OPT_ATCINT_DEFAULT, // Alternate TCC Interrupt (c64x only)
> > // EDMA_OPT_ATCC_DEFAULT, // Alternate Transfer Complete Code (c64x only)
> > // EDMA_OPT_PDTS_DEFAULT, // Peripheral Device Transfer Source (c64x only)
> > // EDMA_OPT_PDTD_DEFAULT, // Peripheral Device Transfer Dest (c64x only)
> > EDMA_OPT_LINK_NO, // Enable link parameters
> > EDMA_OPT_FS_NO // Use frame sync
> > ),
> > EDMA_SRC_OF(gBufRcv), // src address
> > EDMA_CNT_OF(BUFFSIZE), // Count = buffer size
> > EDMA_DST_OF(gBufXmt), // dest address
> > EDMA_IDX_OF(0), // frame/element index value
> > EDMA_RLD_OF(0) // reload
> > };
> >
> > /*
> > * ======== main =======> > */
> > void main()
> > {
> > initHwi();
> >
> > dummy ;
> >
> > hEdmaCopy = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_RESET);
> >
> > EDMA_config(hEdmaCopy,&gEdmaConfigCopy);
> >
> > EDMA_intEnable(2);
> > tempA_intTest(2);
> >
> > for (i=0;i<32;i++){
> > EDMA_setChannel(hEdmaCopy);
> > test[i]A_getChannel(hEdmaCopy);
> > }
> >
> > while (1) {
> > // Loop Forever
> > }
> > }
> >
> > void edmaHwi(int tcc)
> > {
> > dummy990;
> > }
> >
> > /*
> > * ======== initHwi ========> > */
> >
> > void initHwi(void)
> > { //dummy33;
> >
> > IRQ_enable(IRQ_EVT_EDMAINT);
> > IRQ_globalEnable();
> > }
> ------- End of Original Message -------
anser,

I received your email about which function is the interrupt handler.
and I replied to it.

Also, the interrupt must be enabled AND the address of the interrupt function placed in the
interrupt vector table.

R. Williams

---------- Original Message -----------
From: "Richard Williams"
To: a...@yahoo.com, c...
Sent: Wed, 28 May 2008 17:59:59 -0700
Subject: Re: [c6x] Unable read CIPR bit

> anserme,
>
> Maybe I'm missing something important, but I do not see the interrupt functions that need
> to be executed when the interrupt occurs.
>
> Does this mean that those functions have not been written and addresses put in the
> interrupt vector table?
>
> R. Williams
>
> ---------- Original Message -----------
> From: a...@yahoo.com
> To: c...
> Sent: Wed, 28 May 2008 19:15:02 -0400
> Subject: [c6x] Unable read CIPR bit
>
> > Hi Everybody
> >
> > I have written following code in which I am trying to use EDMA to copy data from one
> > memory location to other. The data is successfully being transfered but EDMA doesnt
> > generate interrupt and it is not because of TCINT because TCINT=YES.
> >
> > Anybody has any clue. Your help is very much appreciated
> >
> > Kind Regards
> > Here is the Code for reference
> >
> > /*
> > * ======== main.c =======> > * This file contains all the functions for Lab2 except
> > * SINE_init() and SINE_blockFill().
> > */
> >
> > /*
> > * ======== Include files =======> > */
> > #include
> > #include
> > #include
> > #include
> >
> > /*
> > * ======== Declarations =======> > */
> > #define BUFFSIZE 32
> >
> > /*
> > * ======== Prototypes =======> > */
> > void edmaHwi(int tcc);
> > void initHwi(void);
> > /*
> > * ======== Global Variables =======> > */
> >
> > short gBufRcv[BUFFSIZE]={0,1951,3827,5556,7071,8315,9239,9808,10000,9808,9239,8315,7071,
> > 5556,3827,1951,0,-1951,-3827,-5556,-7071,-8315,-9239,-9808,-10000,-9808,-9239,-8315,-7071,-
> > 5556,-3827,-1951}; short gBufXmt[BUFFSIZE]={0}; int dummy = 0; int i; int temp; short
> test[BUFFSIZE]={9};
> > short test1[BUFFSIZE]={9};
> > short gTCC;
> > EDMA_Handle hEdmaCopy;
> >
> > EDMA_Config gEdmaConfigCopy = {
> > EDMA_OPT_RMK(
> > EDMA_OPT_PRI_LOW, // Priority
> > EDMA_OPT_ESIZE_16BIT, // Element size
> > EDMA_OPT_2DS_NO, // 2 dimensional source
> > EDMA_OPT_SUM_INC, // Src update mode
> > EDMA_OPT_2DD_NO, // 2 dimensional dest
> > EDMA_OPT_DUM_INC, // Dest update mode
> > EDMA_OPT_TCINT_YES, // Cause EDMA interrupt
> > EDMA_OPT_TCC_OF(2), // Transfer Complete Code
> > // EDMA_OPT_TCCM_DEFAULT, // Transfer Complete Code Upper Bits (c64x only)
> > // EDMA_OPT_ATCINT_DEFAULT, // Alternate TCC Interrupt (c64x only)
> > // EDMA_OPT_ATCC_DEFAULT, // Alternate Transfer Complete Code (c64x only)
> > // EDMA_OPT_PDTS_DEFAULT, // Peripheral Device Transfer Source (c64x only)
> > // EDMA_OPT_PDTD_DEFAULT, // Peripheral Device Transfer Dest (c64x only)
> > EDMA_OPT_LINK_NO, // Enable link parameters
> > EDMA_OPT_FS_NO // Use frame sync
> > ),
> > EDMA_SRC_OF(gBufRcv), // src address
> > EDMA_CNT_OF(BUFFSIZE), // Count = buffer size
> > EDMA_DST_OF(gBufXmt), // dest address
> > EDMA_IDX_OF(0), // frame/element index value
> > EDMA_RLD_OF(0) // reload
> > };
> >
> > /*
> > * ======== main =======> > */
> > void main()
> > {
> > initHwi();
> >
> > dummy ;
> >
> > hEdmaCopy = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_RESET);
> >
> > EDMA_config(hEdmaCopy,&gEdmaConfigCopy);
> >
> > EDMA_intEnable(2);
> > tempA_intTest(2);
> >
> > for (i=0;i<32;i++){
> > EDMA_setChannel(hEdmaCopy);
> > test[i]A_getChannel(hEdmaCopy);
> > }
> >
> > while (1) {
> > // Loop Forever
> > }
> > }
> >
> > void edmaHwi(int tcc)
> > {
> > dummy990;
> > }
> >
> > /*
> > * ======== initHwi ========> > */
> >
> > void initHwi(void)
> > { //dummy33;
> >
> > IRQ_enable(IRQ_EVT_EDMAINT);
> > IRQ_globalEnable();
> > }
> ------- End of Original Message -------
------- End of Original Message -------