DSPRelated.com
Forums

DSK6711 is driven me crazy: CSL & McBSP0 problem!

Started by the_visitor_or_not July 11, 2007
Hi decent members,

I am working on my Master's Project, and having troubles with the DSK
I have to work on: TMS320C6711

One of my tasks consists in acquiring some digital data: I am thinking
about using the Jack Input from MotherBoard to get it done.

Therefore, I am trying to access McBSP0 with CSL tools: but it is
getting me crazy, I can't figure out how to make the McBSP0 work!
However, using the DaughterBoard PCM3003 and McBSP1 works perfectly
with CSL.

Following code is what I try to do to read MotherBoard's input and
send it MotherBoard's output.

As you can see, the code is not that long!

Please folks, any comment is appreciate. Regards!

/********\
main.c
\********/

#define CHIP_6711
#include
#include
#include
#include
//define the data
union sample_type {
int both;
} sample_McBsp0;
//declare McBsp0
MCBSP_Handle hMcbsp0;
MCBSP_Config MyMcBsp0 = {
0x00010001,
0x000000A0,
0x000000A0,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000
};

//dsp and peripheral initialisation
void c6711dsk_init() {
hMcbsp0 = MCBSP_open(MCBSP_DEV0, MCBSP_OPEN_RESET);
MCBSP_config(hMcbsp0, &MyMcBsp0);
}

interrupt void intser_McBSP0(void)
{
sample_McBsp0.both = MCBSP_read(hMcbsp0);
MCBSP_write(hMcbsp0, sample_McBsp0.both);
return;
}

//main
void main()
{
CSL_init();
c6711dsk_init();

//IRQ
IRQ_map(IRQ_EVT_RINT0, 4);
IRQ_reset(IRQ_EVT_RINT0);
IRQ_nmiEnable();
IRQ_enable(IRQ_EVT_RINT0);
IRQ_globalEnable();
IRQ_set(IRQ_EVT_RINT0);

while(1) {}
}

/************\
vectors.asm
\************/

The only interrupt I am playing with is number 4
INT4:
STW B0, *B15--
MVKL _intser_McBSP0, B0
MVKH _intser_McBSP0, B0
B B0
LDW *++B15, B0
NOP
NOP
NOP
Visitor,

In the recent history, say the last 6 months, there was a program posted on this e-list that
successfully used both the McBSPs.
It did not use the interrupts.
There was several comments about the source code that you might also read, as expressed in later posts.

It seems to me that the interrupts should not be enabled until after the interrupt vector value is
placed in the vector table.

BTW:
Shouldn't the interrupt routine end in a RTI (return from interrupt) instruction, not just run off
the end of the function?
I seem to remember that the mcbsp open function has three parameters and the read/write functions
have 2 parameters.
But my memory isn't perfect, so that code may be right.

It looks like a non maskable interrupt is being enabled, maybe I'm misunderstanding the line of code
(IRQ_nmiEnable();)

a question:
is the mcbsp0 routed to the motherboard jack that you mentioned?

R. Williams
---------- Original Message -----------
From: "the_visitor_or_not"
To: c...
Sent: Wed, 11 Jul 2007 11:33:11 -0000
Subject: [c6x] DSK6711 is driven me crazy: CSL & McBSP0 problem!

> Hi decent members,
>
> I am working on my Master's Project, and having troubles with the DSK
> I have to work on: TMS320C6711
>
> One of my tasks consists in acquiring some digital data: I am thinking
> about using the Jack Input from MotherBoard to get it done.
>
> Therefore, I am trying to access McBSP0 with CSL tools: but it is
> getting me crazy, I can't figure out how to make the McBSP0 work!
> However, using the DaughterBoard PCM3003 and McBSP1 works perfectly
> with CSL.
>
> Following code is what I try to do to read MotherBoard's input and
> send it MotherBoard's output.
>
> As you can see, the code is not that long!
>
> Please folks, any comment is appreciate. Regards!
>
> /********\
> main.c
> \********/
>
> #define CHIP_6711
> #include
> #include
> #include
> #include //define the data
> union sample_type {
> int both;
> } sample_McBsp0;
>
> //declare McBsp0
> MCBSP_Handle hMcbsp0;
> MCBSP_Config MyMcBsp0 = {
> 0x00010001,
> 0x000000A0,
> 0x000000A0,
> 0x00000000,
> 0x00000000,
> 0x00000000,
> 0x00000000,
> 0x00000000
> };
>
> //dsp and peripheral initialisation
> void c6711dsk_init() {
> hMcbsp0 = MCBSP_open(MCBSP_DEV0, MCBSP_OPEN_RESET);
> MCBSP_config(hMcbsp0, &MyMcBsp0);
> }
>
> interrupt void intser_McBSP0(void)
> {
> sample_McBsp0.both = MCBSP_read(hMcbsp0);
> MCBSP_write(hMcbsp0, sample_McBsp0.both);
> return;
> }
>
> //main
> void main()
> {
> CSL_init();
> c6711dsk_init();
>
> //IRQ
> IRQ_map(IRQ_EVT_RINT0, 4);
> IRQ_reset(IRQ_EVT_RINT0);
> IRQ_nmiEnable();
> IRQ_enable(IRQ_EVT_RINT0);
> IRQ_globalEnable();
> IRQ_set(IRQ_EVT_RINT0);
>
> while(1) {}
> }
>
> /************\
> vectors.asm
> \************/
>
> The only interrupt I am playing with is number 4
>
> INT4:
> STW B0, *B15--
> MVKL _intser_McBSP0, B0
> MVKH _intser_McBSP0, B0
> B B0
> LDW *++B15, B0
> NOP
> NOP
> NOP
------- End of Original Message -------
Hi all,

I'm really interested in the program that Richard's speaking about. Could anyone re-post it please? (i can't find it)
Thank you very much

Miguel

Visitor,

In the recent history, say the last 6 months, there was a program posted on this e-list that
successfully used both the McBSPs.
It did not use the interrupts.
There was several comments about the source code that you might also read, as expressed in later posts.

It seems to me that the interrupts should not be enabled until after the interrupt vector value is
placed in the vector table.

BTW:
Shouldn't the interrupt routine end in a RTI (return from interrupt) instruction, not just run off
the end of the function?

I seem to remember that the mcbsp open function has three parameters and the read/write functions
have 2 parameters.
But my memory isn't perfect, so that code may be right.

It looks like a non maskable interrupt is being enabled, maybe I'm misunderstanding the line of code
(IRQ_nmiEnable( );)

a question:
is the mcbsp0 routed to the motherboard jack that you mentioned?

R. Williams

---------- Original Message -----------
From: "the_visitor_ or_not"
To: c6x@yahoogroups. com
Sent: Wed, 11 Jul 2007 11:33:11 -0000
Subject: [c6x] DSK6711 is driven me crazy: CSL & McBSP0 problem!

> Hi decent members,
>
> I am working on my Master's Project, and having troubles with the DSK
> I have to work on: TMS320C6711
>
> One of my tasks consists in acquiring some digital data: I am thinking
> about using the Jack Input from MotherBoard to get it done.
>
> Therefore, I am trying to access McBSP0 with CSL tools: but it is
> getting me crazy, I can't figure out how to make the McBSP0 work!
> However, using the DaughterBoard PCM3003 and McBSP1 works perfectly
> with CSL.
>
> Following code is what I try to do to read MotherBoard' s input and
> send it MotherBoard' s output.
>
> As you can see, the code is not that long!
>
> Please folks, any comment is appreciate. Regards!
>
> /********\
> main.c
> \********/
>
> #define CHIP_6711
> #include
> #include
> #include
> #include //define the data
> union sample_type {
> int both;
> } sample_McBsp0;
>
> //declare McBsp0
> MCBSP_Handle hMcbsp0;
> MCBSP_Config MyMcBsp0 = {
> 0x00010001,
> 0x000000A0,
> 0x000000A0,
> 0x00000000,
> 0x00000000,
> 0x00000000,
> 0x00000000,
> 0x00000000
> };
>
> //dsp and peripheral initialisation
> void c6711dsk_init( ) {
> hMcbsp0 = MCBSP_open(MCBSP_ DEV0, MCBSP_OPEN_RESET) ;
> MCBSP_config( hMcbsp0, &MyMcBsp0);
> }
>
> interrupt void intser_McBSP0( void)
> {
> sample_McBsp0. both = MCBSP_read(hMcbsp0) ;
> MCBSP_write( hMcbsp0, sample_McBsp0. both);
> return;
> }
>
> //main
> void main()
> {
> CSL_init();
> c6711dsk_init( );
>
> //IRQ
> IRQ_map(IRQ_ EVT_RINT0, 4);
> IRQ_reset(IRQ_ EVT_RINT0) ;
> IRQ_nmiEnable( );
> IRQ_enable(IRQ_ EVT_RINT0) ;
> IRQ_globalEnable( );
> IRQ_set(IRQ_ EVT_RINT0) ;
>
> while(1) {}
> }
>
> /*********** *\
> vectors.asm
> \*********** */
>
> The only interrupt I am playing with is number 4
>
> INT4:
> STW B0, *B15--
> MVKL _intser_McBSP0, B0
> MVKH _intser_McBSP0, B0
> B B0
> LDW *++B15, B0
> NOP
> NOP
> NOP
------- End of Original Message -------

______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y miles desde 1 ctimo por minuto.
http://es.voice.yahoo.com