DSPRelated.com
Forums

Code for ADS7881EVM

Started by B S October 18, 2010
Hi Guys,

I am using ADS7811EVM and 5-6 Interface board to interface with C6713 DSK. I
have attached the ADC as stated in the guide and used the C code given in zipped
folder on the following website.

http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
I don't know whats wrong, when I run the code, processor seem to work but Ping
and Pong buffers are all zero when I check by putting break point.

Can any one please provide me working code OR help me with this code ?

I will appreciate your kind support.

BR,
BAS
B.S.

Have you read the referenced code?

It skips the first buffer of data.
Then it simply resets the EDMA and INT and continues.
SO the best it can do is have the second buffer of data modified and moved to
the data* buffers.

It does not (although comments say it does) fire a software interrupt for
processing of the data.

The code assumes this is being run under the BIOS.

Do you have a steady stream of data being fed into the A/D converter from some
external source? With out any data coming in, the buffers will always be full
of 0s.

This code is NOT a normal ping/pong buffer operation.
rather it reads two 16bit values from the A/D converter and places those values
into two buffers.
Then reads the next two 16 bit values.

R. Williams
---------- Original Message -----------
From: B S
To: c...
Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
Subject: [c6x] Code for ADS7881EVM

> Hi Guys,
>
> I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> DSK. I have attached the ADC as stated in the guide and used the C
> code given in zipped folder on the following website.
>
> http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
>
> I don't know whats wrong, when I run the code, processor seem to work
> but Ping and Pong buffers are all zero when I check by putting break point.
>
> Can any one please provide me working code OR help me with this code ?
>
> I will appreciate your kind support.
>
> BR,
> BAS
------- End of Original Message -------

_____________________________________
R. Williams,

Yes I applied analog signal from external source and when I run the code,
processor does processing but data buffers are always 0s.
I think there is some thing wrong with interfacing. I am using default jumper
setting for ADS7881EVM, I wasn't sure to change them as stated in the document
because some of the jumper settings are same as defined in the document and some
aren't. In the following document, Table # 1 and Table # 2 shows jumper settings
for ADS7881EVM and 5-6K Interface Board respectively.
http://focus.ti.com/lit/an/slaa257/slaa257.pdf

Should I change all of them accoring to document ? I didn't have any prior
knowledge of interfacing, can you give me some guidance if you don't mind.

I will appreciate your help.

Regards.

________________________________
From: Richard Williams
To: B S ; c...
Sent: Mon, October 18, 2010 4:11:23 PM
Subject: Re: [c6x] Code for ADS7881EVM

B.S.

Have you read the referenced code?

It skips the first buffer of data.
Then it simply resets the EDMA and INT and continues.
SO the best it can do is have the second buffer of data modified and moved to
the data* buffers.

It does not (although comments say it does) fire a software interrupt for
processing of the data.

The code assumes this is being run under the BIOS.

Do you have a steady stream of data being fed into the A/D converter from some
external source? With out any data coming in, the buffers will always be full
of 0s.

This code is NOT a normal ping/pong buffer operation.
rather it reads two 16bit values from the A/D converter and places those values
into two buffers.
Then reads the next two 16 bit values.

R. Williams

---------- Original Message -----------
From: B S
To: c...
Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
Subject: [c6x] Code for ADS7881EVM

> Hi Guys,
>
> I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> DSK. I have attached the ADC as stated in the guide and used the C
> code given in zipped folder on the following website.
>
> http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
>
> I don't know whats wrong, when I run the code, processor seem to work
> but Ping and Pong buffers are all zero when I check by putting break point.
>
> Can any one please provide me working code OR help me with this code ?
>
> I will appreciate your kind support.
>
> BR,
> BAS
------- End of Original Message -------
B.S.

Alright, a bit of debugging is needed..

have you stopped the CPU at the beginning of the interrupt handler and checked
the values actually read?

have you stopped the CPU and manually read the input port to see what the values
are?

have you put a logic analyzer on the data lines from the ADS chip and noted if
any data is actually being produced?

have you put a logic analyzer on the CS, etc lines of the ADS chip and noted if
the chip is actually being enabled and accessed?

If I may make a useful suggestion ...

The kinds of questions I read from you are missing many critical details.
The posts say: "I wrote/used some code, it did not work, fix it for me."
Often the posts seem to indicate your not really sure about what the application
is expected to do.

What would be much better ...
--I used such and such a code example. (or here is a snipit of the code that I
think is giving a problem).
--this is how I set up the surrounding hardware ....
--when I ran the application it did not work as expected.
--here is what the application did do ....
--I used ... equipment, and did ... to debug the application.
--This is what I found in my debug efforts ....
--Given the above, what do you suggest I look at next?

R. Williams

---------- Original Message -----------
From: B S
To: Richard Williams , c...
Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> Yes I applied analog signal from external source and when I run the
> code, processor does processing but data buffers are always 0s.
>
> I think there is some thing wrong with interfacing. I am using default
> jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> in the document because some of the jumper settings are same as
> defined in the document and some aren't. In the following document,
> Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> Interface Board respectively.
>
> http://focus.ti.com/lit/an/slaa257/slaa257.pdf
>
> Should I change all of them accoring to document ? I didn't have any
> prior knowledge of interfacing, can you give me some guidance if you
> don't mind.
>
> I will appreciate your help.
>
> Regards.
>
> ________________________________
> From: Richard Williams
> To: B S ; c...
> Sent: Mon, October 18, 2010 4:11:23 PM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Have you read the referenced code?
>
> It skips the first buffer of data.
> Then it simply resets the EDMA and INT and continues.
> SO the best it can do is have the second buffer of data modified and
> moved to the data* buffers.
>
> It does not (although comments say it does) fire a software interrupt
> for processing of the data.
>
> The code assumes this is being run under the BIOS.
>
> Do you have a steady stream of data being fed into the A/D converter
> from some external source? With out any data coming in, the buffers
> will always be full of 0s.
>
> This code is NOT a normal ping/pong buffer operation.
> rather it reads two 16bit values from the A/D converter and places
> those values into two buffers. Then reads the next two 16 bit values.
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: c...
> Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> Subject: [c6x] Code for ADS7881EVM
>
> > Hi Guys,
> >
> > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > DSK. I have attached the ADC as stated in the guide and used the C
> > code given in zipped folder on the following website.
> >
> > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> >
> > I don't know whats wrong, when I run the code, processor seem to work
> > but Ping and Pong buffers are all zero when I check by putting break point.
> >
> > Can any one please provide me working code OR help me with this code ?
> >
> > I will appreciate your kind support.
> >
> > BR,
> > BAS
> ------- End of Original Message -------
------- End of Original Message -------

_____________________________________
R. Williams,

Got your point. I get back to you soon with details.

Thanks.

________________________________
From: Richard Williams
To: B S ; c...
Sent: Tue, October 19, 2010 7:45:50 PM
Subject: Re: [c6x] Code for ADS7881EVM

B.S.

Alright, a bit of debugging is needed..

have you stopped the CPU at the beginning of the interrupt handler and checked
the values actually read?

have you stopped the CPU and manually read the input port to see what the values

are?

have you put a logic analyzer on the data lines from the ADS chip and noted if
any data is actually being produced?

have you put a logic analyzer on the CS, etc lines of the ADS chip and noted if
the chip is actually being enabled and accessed?

If I may make a useful suggestion ...

The kinds of questions I read from you are missing many critical details.
The posts say: "I wrote/used some code, it did not work, fix it for me."
Often the posts seem to indicate your not really sure about what the application

is expected to do.

What would be much better ...
--I used such and such a code example. (or here is a snipit of the code that I
think is giving a problem).
--this is how I set up the surrounding hardware ....
--when I ran the application it did not work as expected.
--here is what the application did do ....
--I used ... equipment, and did ... to debug the application.
--This is what I found in my debug efforts ....
--Given the above, what do you suggest I look at next?

R. Williams

---------- Original Message -----------
From: B S
To: Richard Williams , c...
Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> Yes I applied analog signal from external source and when I run the
> code, processor does processing but data buffers are always 0s.
>
> I think there is some thing wrong with interfacing. I am using default
> jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> in the document because some of the jumper settings are same as
> defined in the document and some aren't. In the following document,
> Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> Interface Board respectively.
>
> http://focus.ti.com/lit/an/slaa257/slaa257.pdf
>
> Should I change all of them accoring to document ? I didn't have any
> prior knowledge of interfacing, can you give me some guidance if you
> don't mind.
>
> I will appreciate your help.
>
> Regards.
>
> ________________________________
> From: Richard Williams
> To: B S ; c...
> Sent: Mon, October 18, 2010 4:11:23 PM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Have you read the referenced code?
>
> It skips the first buffer of data.
> Then it simply resets the EDMA and INT and continues.
> SO the best it can do is have the second buffer of data modified and
> moved to the data* buffers.
>
> It does not (although comments say it does) fire a software interrupt
> for processing of the data.
>
> The code assumes this is being run under the BIOS.
>
> Do you have a steady stream of data being fed into the A/D converter
> from some external source? With out any data coming in, the buffers
> will always be full of 0s.
>
> This code is NOT a normal ping/pong buffer operation.
> rather it reads two 16bit values from the A/D converter and places
> those values into two buffers. Then reads the next two 16 bit values.
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: c...
> Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> Subject: [c6x] Code for ADS7881EVM
>
> > Hi Guys,
> >
> > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > DSK. I have attached the ADC as stated in the guide and used the C
> > code given in zipped folder on the following website.
> >
> > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> >
> > I don't know whats wrong, when I run the code, processor seem to work
> > but Ping and Pong buffers are all zero when I check by putting break point.
> >
> > Can any one please provide me working code OR help me with this code ?
> >
> > I will appreciate your kind support.
> >
> > BR,
> > BAS
> ------- End of Original Message -------
------- End of Original Message -------
R. Williams,

I would have provided you all missing details if I knew whats going on there :-)

I got the board, interfaced as stated in the document mentioned below and used
the code given in the end of that document.

http://focus.ti.com/lit/an/slaa257/slaa257.pdf

However, I went through the code and checked the lines mentioned below, seems
that Timer1 is not triggering and thats the reason ping and pong buffers have 0s
value.

TIMER_start(hTimer1); /*Start A/D CONVST#
trigger */

LOG_printf(&trace, "GO! \n"); /*Go sample at 4MSPS*/

Last sentence of Page 8 (in the document mentioned above) says to change link
handle setting in the config.cdb file to continuously Ping Pong. I did this but
still it's not working.

I am sure ADC is interfaced with the processor successfully but don't know why
code is not working.

Please suggest where else should I look.

Regards.
BAS

________________________________
From: Richard Williams
To: B S ; c...
Sent: Tue, October 19, 2010 7:45:50 PM
Subject: Re: [c6x] Code for ADS7881EVM

B.S.

Alright, a bit of debugging is needed..

have you stopped the CPU at the beginning of the interrupt handler and checked
the values actually read?

have you stopped the CPU and manually read the input port to see what the values

are?

have you put a logic analyzer on the data lines from the ADS chip and noted if
any data is actually being produced?

have you put a logic analyzer on the CS, etc lines of the ADS chip and noted if
the chip is actually being enabled and accessed?

If I may make a useful suggestion ...

The kinds of questions I read from you are missing many critical details.
The posts say: "I wrote/used some code, it did not work, fix it for me."
Often the posts seem to indicate your not really sure about what the application

is expected to do.

What would be much better ...
--I used such and such a code example. (or here is a snipit of the code that I
think is giving a problem).
--this is how I set up the surrounding hardware ....
--when I ran the application it did not work as expected.
--here is what the application did do ....
--I used ... equipment, and did ... to debug the application.
--This is what I found in my debug efforts ....
--Given the above, what do you suggest I look at next?

R. Williams

---------- Original Message -----------
From: B S
To: Richard Williams , c...
Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> Yes I applied analog signal from external source and when I run the
> code, processor does processing but data buffers are always 0s.
>
> I think there is some thing wrong with interfacing. I am using default
> jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> in the document because some of the jumper settings are same as
> defined in the document and some aren't. In the following document,
> Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> Interface Board respectively.
>
> http://focus.ti.com/lit/an/slaa257/slaa257.pdf
>
> Should I change all of them accoring to document ? I didn't have any
> prior knowledge of interfacing, can you give me some guidance if you
> don't mind.
>
> I will appreciate your help.
>
> Regards.
>
> ________________________________
> From: Richard Williams
> To: B S ; c...
> Sent: Mon, October 18, 2010 4:11:23 PM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Have you read the referenced code?
>
> It skips the first buffer of data.
> Then it simply resets the EDMA and INT and continues.
> SO the best it can do is have the second buffer of data modified and
> moved to the data* buffers.
>
> It does not (although comments say it does) fire a software interrupt
> for processing of the data.
>
> The code assumes this is being run under the BIOS.
>
> Do you have a steady stream of data being fed into the A/D converter
> from some external source? With out any data coming in, the buffers
> will always be full of 0s.
>
> This code is NOT a normal ping/pong buffer operation.
> rather it reads two 16bit values from the A/D converter and places
> those values into two buffers. Then reads the next two 16 bit values.
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: c...
> Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> Subject: [c6x] Code for ADS7881EVM
>
> > Hi Guys,
> >
> > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > DSK. I have attached the ADC as stated in the guide and used the C
> > code given in zipped folder on the following website.
> >
> > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> >
> > I don't know whats wrong, when I run the code, processor seem to work
> > but Ping and Pong buffers are all zero when I check by putting break point.
> >
> > Can any one please provide me working code OR help me with this code ?
> >
> > I will appreciate your kind support.
> >
> > BR,
> > BAS
> ------- End of Original Message -------
------- End of Original Message -------
B.S.

Perhaps I was not clear.

So I'll ask a few directed questions.

1) what makes you think the timer interrupt is not occuring?

2) after the project runs for a while, what is the value of the variable
'pingpong'?

3) looking at the lines to the ads7881,
do you see the the start convert line being strobed?

4) looking at the lines from the ads7881,
do you see the data ready line being strobed?

5) after resetting, then performing a 'run to main', does the code stop at the
begining of the 'main' function?

6) after putting a breakpoint in the hwiDMA_isr function, does the code ever hit
that breakpoint?

7) if you add some code in the hwiDMA_isr function to toggle a GPIO pin,
can you see that pin being toggled? if so, how often?

8) have you examined the appropriate registers to determine of the edms
interrupt 6 is being enabled?

9) have you examined the appropriate registers to determine if the timer 1 is
properly setup?

I'm not there to look over your shoulder and make suggestions, so you have to
tell me what is going on, what you have checked, etc.

R. Williams

---------- Original Message -----------
From: B S
To: Richard Williams
Cc: c...
Sent: Wed, 20 Oct 2010 07:49:13 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> I would have provided you all missing details if I knew whats going on
> there :-)
>
> I got the board, interfaced as stated in the document mentioned below
> and used the code given in the end of that document.
>
> http://focus.ti.com/lit/an/slaa257/slaa257.pdf
>
> However, I went through the code and checked the lines mentioned below,
> seems that Timer1 is not triggering and thats the reason ping and
> pong buffers have 0s value.
>
> TIMER_start(hTimer1); /*Start A/D
> CONVST# trigger */
>
> LOG_printf(&trace, "GO! \n"); /*Go sample at 4MSPS*/
>
> Last sentence of Page 8 (in the document mentioned above) says to
> change link handle setting in the config.cdb file to continuously Ping
> Pong. I did this but still it's not working.
>
> I am sure ADC is interfaced with the processor successfully but don't
> know why code is not working.
>
> Please suggest where else should I look.
>
> Regards.
> BAS
>
> ________________________________
> From: Richard Williams
> To: B S ; c...
> Sent: Tue, October 19, 2010 7:45:50 PM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Alright, a bit of debugging is needed..
>
> have you stopped the CPU at the beginning of the interrupt handler and
> checked the values actually read?
>
> have you stopped the CPU and manually read the input port to see what
> the values
>
> are?
>
> have you put a logic analyzer on the data lines from the ADS chip and
> noted if any data is actually being produced?
>
> have you put a logic analyzer on the CS, etc lines of the ADS chip and
> noted if the chip is actually being enabled and accessed?
>
> If I may make a useful suggestion ...
>
> The kinds of questions I read from you are missing many critical details.
> The posts say: "I wrote/used some code, it did not work, fix it for me."
> Often the posts seem to indicate your not really sure about what the
> application
>
> is expected to do.
>
> What would be much better ...
> --I used such and such a code example. (or here is a snipit of the
> code that I think is giving a problem). --this is how I set up the
> surrounding hardware .... --when I ran the application it did not work
> as expected. --here is what the application did do .... --I used ...
> equipment, and did ... to debug the application. --This is what I
> found in my debug efforts .... --Given the above, what do you suggest
> I look at next?
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: Richard Williams , c...
> Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
> Subject: Re: [c6x] Code for ADS7881EVM
>
> > R. Williams,
> >
> > Yes I applied analog signal from external source and when I run the
> > code, processor does processing but data buffers are always 0s.
> >
> > I think there is some thing wrong with interfacing. I am using default
> > jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> > in the document because some of the jumper settings are same as
> > defined in the document and some aren't. In the following document,
> > Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> > Interface Board respectively.
> >
> > http://focus.ti.com/lit/an/slaa257/slaa257.pdf
> >
> > Should I change all of them accoring to document ? I didn't have any
> > prior knowledge of interfacing, can you give me some guidance if you
> > don't mind.
> >
> > I will appreciate your help.
> >
> > Regards.
> >
> > ________________________________
> > From: Richard Williams
> > To: B S ; c...
> > Sent: Mon, October 18, 2010 4:11:23 PM
> > Subject: Re: [c6x] Code for ADS7881EVM
> >
> > B.S.
> >
> > Have you read the referenced code?
> >
> > It skips the first buffer of data.
> > Then it simply resets the EDMA and INT and continues.
> > SO the best it can do is have the second buffer of data modified and
> > moved to the data* buffers.
> >
> > It does not (although comments say it does) fire a software interrupt
> > for processing of the data.
> >
> > The code assumes this is being run under the BIOS.
> >
> > Do you have a steady stream of data being fed into the A/D converter
> > from some external source? With out any data coming in, the buffers
> > will always be full of 0s.
> >
> > This code is NOT a normal ping/pong buffer operation.
> > rather it reads two 16bit values from the A/D converter and places
> > those values into two buffers. Then reads the next two 16 bit values.
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: B S
> > To: c...
> > Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> > Subject: [c6x] Code for ADS7881EVM
> >
> > > Hi Guys,
> > >
> > > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > > DSK. I have attached the ADC as stated in the guide and used the C
> > > code given in zipped folder on the following website.
> > >
> > > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> > sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> > >
> > > I don't know whats wrong, when I run the code, processor seem to work
> > > but Ping and Pong buffers are all zero when I check by putting break
point.
> > >
> > > Can any one please provide me working code OR help me with this code ?
> > >
> > > I will appreciate your kind support.
> > >
> > > BR,
> > > BAS
> > ------- End of Original Message -------
> ------- End of Original Message -------
------- End of Original Message -------

_____________________________________
R. Williams,

Please find your answers below.

1) what makes you think the timer interrupt is not occuring?

When I put break point to see step by step functioning, it halts just after
running once. It doesn't trigger timer1 to get the samples.

2) after the project runs for a while, what is the value of the variable
'pingpong'?

pingpong has 0 value.

3) looking at the lines to the ads7881, do you see the the start convert line
being strobed?

No.

4) looking at the lines from the ads7881, do you see the data ready line being
strobed?

No. As a matter of fact, there is no light on ADS7881EVM board to be strobed.

5) after resetting, then performing a 'run to main', does the code stop at the
begining of the 'main' function?

No. Without breakpoint it runs continuously but ping and pong buffers has always
0 values.

6) after putting a breakpoint in the hwiDMA_isr function, does the code ever
hit that breakpoint?

No, it doesn't hit hwiDMA_isr function.

7) if you add some code in the hwiDMA_isr function to toggle a GPIO pin, can
you see that pin being toggled? if so, how often?

I don't know how to write code for GPIO.

8) have you examined the appropriate registers to determine of the edms
interrupt 6 is being enabled?

The EDMA channel used in this application is channel 7. They are configured as
follows.

EDMA_Config edmaCfgChan7 = {
0x28360003, /* Option */
0xA0014000, /* Source Address - Numeric */
0x00000000, /* Transfer Counter - Numeric */
(Uint32) pingBuf, /* Destination Address - Extern Decl. Obj */
0x00000000, /* Index register - Numeric */
0x00010000 /* Element Count Reload and Link Address */
};

EDMA_Config edmaCfgChan7A = {
0x28360003, /* Option */
0xA0014000, /* Source Address - Numeric */
0x00000000, /* Transfer Counter - Numeric */
(Uint32) pongBuf, /* Destination Address - Extern Decl. Obj */
0x00000000, /* Index register - Numeric */
0x00010000 /* Element Count Reload and Link Address */
};

EDMA_Config edmaCfg0 = {
0x48160003, /* Option */
0xA0004000, /* Source Address - Numeric */
0x00000000, /* Transfer Counter - Numeric */
(Uint32) &temp, /* Destination Address - Extern Decl. Obj */
0x00010001, /* Index register - Numeric */
0x00010000 /* Element Count Reload and Link Address */
};

9) have you examined the appropriate registers to determine if the timer 1 is
properly setup?

Yes. It is configured in the following way.

TIMER_Config timerCfg1 = {
0x000002D3, /* Control Register (CTL) */
0x0000000E, /* Period Register (PRD) */
0x00000000 /* Counter Register (CNT) */
};

Here is the project (code) I am using for this application. You may find it
useful if feel some doubts in my answers.

http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=slaa257&fileType=zip
Is there any other way to check if ADS has interfaced with Processor correctly ?

What should I do next ?

Waiting for your reply and thanks for your time.

Regards.

________________________________
From: Richard Williams
To: B S
Cc: c...
Sent: Thu, October 21, 2010 3:05:55 AM
Subject: Re: [c6x] Code for ADS7881EVM

B.S.

Perhaps I was not clear.

So I'll ask a few directed questions.

1) what makes you think the timer interrupt is not occuring?

2) after the project runs for a while, what is the value of the variable
'pingpong'?

3) looking at the lines to the ads7881,
do you see the the start convert line being strobed?

4) looking at the lines from the ads7881,
do you see the data ready line being strobed?

5) after resetting, then performing a 'run to main', does the code stop at the
begining of the 'main' function?

6) after putting a breakpoint in the hwiDMA_isr function, does the code ever hit

that breakpoint?

7) if you add some code in the hwiDMA_isr function to toggle a GPIO pin,
can you see that pin being toggled? if so, how often?

8) have you examined the appropriate registers to determine of the edms
interrupt 6 is being enabled?

9) have you examined the appropriate registers to determine if the timer 1 is
properly setup?

I'm not there to look over your shoulder and make suggestions, so you have to
tell me what is going on, what you have checked, etc.

R. Williams

---------- Original Message -----------
From: B S
To: Richard Williams
Cc: c...
Sent: Wed, 20 Oct 2010 07:49:13 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> I would have provided you all missing details if I knew whats going on
> there :-)
>
> I got the board, interfaced as stated in the document mentioned below
> and used the code given in the end of that document.
>
> http://focus.ti.com/lit/an/slaa257/slaa257.pdf
>
> However, I went through the code and checked the lines mentioned below,
> seems that Timer1 is not triggering and thats the reason ping and
> pong buffers have 0s value.
>
> TIMER_start(hTimer1); /*Start A/D
> CONVST# trigger */
>
> LOG_printf(&trace, "GO! \n"); /*Go sample at 4MSPS*/
>
> Last sentence of Page 8 (in the document mentioned above) says to
> change link handle setting in the config.cdb file to continuously Ping
> Pong. I did this but still it's not working.
>
> I am sure ADC is interfaced with the processor successfully but don't
> know why code is not working.
>
> Please suggest where else should I look.
>
> Regards.
> BAS
>
> ________________________________
> From: Richard Williams
> To: B S ; c...
> Sent: Tue, October 19, 2010 7:45:50 PM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Alright, a bit of debugging is needed..
>
> have you stopped the CPU at the beginning of the interrupt handler and
> checked the values actually read?
>
> have you stopped the CPU and manually read the input port to see what
> the values
>
> are?
>
> have you put a logic analyzer on the data lines from the ADS chip and
> noted if any data is actually being produced?
>
> have you put a logic analyzer on the CS, etc lines of the ADS chip and
> noted if the chip is actually being enabled and accessed?
>
> If I may make a useful suggestion ...
>
> The kinds of questions I read from you are missing many critical details.
> The posts say: "I wrote/used some code, it did not work, fix it for me."
> Often the posts seem to indicate your not really sure about what the
> application
>
> is expected to do.
>
> What would be much better ...
> --I used such and such a code example. (or here is a snipit of the
> code that I think is giving a problem). --this is how I set up the
> surrounding hardware .... --when I ran the application it did not work
> as expected. --here is what the application did do .... --I used ...
> equipment, and did ... to debug the application. --This is what I
> found in my debug efforts .... --Given the above, what do you suggest
> I look at next?
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: Richard Williams , c...
> Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
> Subject: Re: [c6x] Code for ADS7881EVM
>
> > R. Williams,
> >
> > Yes I applied analog signal from external source and when I run the
> > code, processor does processing but data buffers are always 0s.
> >
> > I think there is some thing wrong with interfacing. I am using default
> > jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> > in the document because some of the jumper settings are same as
> > defined in the document and some aren't. In the following document,
> > Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> > Interface Board respectively.
> >
> > http://focus.ti.com/lit/an/slaa257/slaa257.pdf
> >
> > Should I change all of them accoring to document ? I didn't have any
> > prior knowledge of interfacing, can you give me some guidance if you
> > don't mind.
> >
> > I will appreciate your help.
> >
> > Regards.
> >
> > ________________________________
> > From: Richard Williams
> > To: B S ; c...
> > Sent: Mon, October 18, 2010 4:11:23 PM
> > Subject: Re: [c6x] Code for ADS7881EVM
> >
> > B.S.
> >
> > Have you read the referenced code?
> >
> > It skips the first buffer of data.
> > Then it simply resets the EDMA and INT and continues.
> > SO the best it can do is have the second buffer of data modified and
> > moved to the data* buffers.
> >
> > It does not (although comments say it does) fire a software interrupt
> > for processing of the data.
> >
> > The code assumes this is being run under the BIOS.
> >
> > Do you have a steady stream of data being fed into the A/D converter
> > from some external source? With out any data coming in, the buffers
> > will always be full of 0s.
> >
> > This code is NOT a normal ping/pong buffer operation.
> > rather it reads two 16bit values from the A/D converter and places
> > those values into two buffers. Then reads the next two 16 bit values.
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: B S
> > To: c...
> > Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> > Subject: [c6x] Code for ADS7881EVM
> >
> > > Hi Guys,
> > >
> > > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > > DSK. I have attached the ADC as stated in the guide and used the C
> > > code given in zipped folder on the following website.
> > >
> > > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> > sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> > >
> > > I don't know whats wrong, when I run the code, processor seem to work
> > > but Ping and Pong buffers are all zero when I check by putting break
point.
> > >
> > > Can any one please provide me working code OR help me with this code ?
> > >
> > > I will appreciate your kind support.
> > >
> > > BR,
> > > BAS
> > ------- End of Original Message -------
> ------- End of Original Message -------
------- End of Original Message -------
B.S.

> 3) looking at the lines to the ads7881, do you see the the start
> convert line being strobed?
>
> No.
>
> 4) looking at the lines from the ads7881, do you see the data ready
> line being strobed?
>
> No. As a matter of fact, there is no light on ADS7881EVM board to be strobed.

A clarification:
by 'strobed' I mean:
a positive (or negative) voltage pulse on the line, not a LED/strobe/lightbulb.

> 5) after resetting, then performing a 'run to main', does the code
> stop at the begining of the 'main' function?
>
> No. Without breakpoint it runs continuously but ping and pong buffers
> has always 0 values.

The 'run to main' is a clickable menu entry on the CCS debug menu.
It has nothing to do with the ping/pong buffers.
The action performed when the 'run to main' menu entry is clicked is:
the code begins execution at the normal start address...
and continues to run until code execution reaches the beginning of the 'main'
function. then the execution stops.
This is accompolished by the debugger placing a hardware breakpoint at the first
executable instruction in the 'main' function.
The 'run to main' should be run after using the debug menu items to reset the
emulator and the target.

New question:
does the code ever execute the 'main' function?

I see you have copied the configuration sequence(s) for the EDMA and the Timer1.
Have you actually looked at the actual peripheral registers to assure they are
actually being written with the configuration values?

After running the application for a while,
have you stopped the application and examined:
--Timer1 counter register to determine if it is actually decrementing?
--EDMA 7 index register to determine if it is actually incrementing?
--EDMA 7 transfer counter register to determine if it is actually incrementing?

Do you understand how the Timer1 works?
Do you understand how the EDMA 7 works?
You say the code halts just after running once.
Where does it halt?
Why does it halt?
What is the condition of the stack pointer?
Where is the instruction pointer pointing?

Have you defined a 'PRD' function in the project configuration file?
Have you defined a HWIirq interrupt handler in the project configuration file?
What interrupt is being routed to the HWIirq interrupt handler?
What interrupt handler is handling the Timer1 interrupt?
What interrupt handler is handling the EDMA7 interrupt?

R. Williams
---------- Original Message -----------
From: B S
To: Richard Williams
Cc: c...
Sent: Thu, 21 Oct 2010 07:03:31 -0700 (PDT)
Subject: Re: [c6x] Code for ADS7881EVM

> R. Williams,
>
> Please find your answers below.
>
> 1) what makes you think the timer interrupt is not occuring?
>
> When I put break point to see step by step functioning, it halts just
> after running once. It doesn't trigger timer1 to get the samples.
>
> 2) after the project runs for a while, what is the value of the
> variable 'pingpong'?
>
> pingpong has 0 value.
>
> 3) looking at the lines to the ads7881, do you see the the start
> convert line being strobed?
>
> No.
>
> 4) looking at the lines from the ads7881, do you see the data ready
> line being strobed?
>
> No. As a matter of fact, there is no light on ADS7881EVM board to be strobed.
>
> 5) after resetting, then performing a 'run to main', does the code
> stop at the begining of the 'main' function?
>
> No. Without breakpoint it runs continuously but ping and pong buffers
> has always 0 values.
>
> 6) after putting a breakpoint in the hwiDMA_isr function, does the
> code ever hit that breakpoint?
>
> No, it doesn't hit hwiDMA_isr function.
>
> 7) if you add some code in the hwiDMA_isr function to toggle a GPIO
> pin, can you see that pin being toggled? if so, how often?
>
> I don't know how to write code for GPIO.
>
> 8) have you examined the appropriate registers to determine of the
> edms interrupt 6 is being enabled?
>
> The EDMA channel used in this application is channel 7. They are
> configured as follows.
>
> EDMA_Config edmaCfgChan7 = {
> 0x28360003, /* Option */
> 0xA0014000, /* Source Address - Numeric */
> 0x00000000, /* Transfer Counter - Numeric */
> (Uint32) pingBuf, /* Destination Address - Extern Decl. Obj */
> 0x00000000, /* Index register - Numeric */
> 0x00010000 /* Element Count Reload and Link Address */
> };
>
> EDMA_Config edmaCfgChan7A = {
> 0x28360003, /* Option */
> 0xA0014000, /* Source Address - Numeric */
> 0x00000000, /* Transfer Counter - Numeric */
> (Uint32) pongBuf, /* Destination Address - Extern Decl. Obj */
> 0x00000000, /* Index register - Numeric */
> 0x00010000 /* Element Count Reload and Link Address */
> };
>
> EDMA_Config edmaCfg0 = {
> 0x48160003, /* Option */
> 0xA0004000, /* Source Address - Numeric */
> 0x00000000, /* Transfer Counter - Numeric */
> (Uint32) &temp, /* Destination Address - Extern Decl. Obj */
> 0x00010001, /* Index register - Numeric */
> 0x00010000 /* Element Count Reload and Link Address */
> };
>
> 9) have you examined the appropriate registers to determine if the
> timer 1 is properly setup?
>
> Yes. It is configured in the following way.
>
> TIMER_Config timerCfg1 = {
> 0x000002D3, /* Control Register (CTL) */
> 0x0000000E, /* Period Register (PRD) */
> 0x00000000 /* Counter Register (CNT) */
> };
>
> Here is the project (code) I am using for this application. You may
> find it useful if feel some doubts in my answers.
>
> http://focus.ti.com/general/docs/lit/getliterature.tsp?
literatureNumber=slaa257&fileType=zip
>
> Is there any other way to check if ADS has interfaced with Processor
> correctly ?
>
> What should I do next ?
>
> Waiting for your reply and thanks for your time.
>
> Regards.
>
> ________________________________
> From: Richard Williams
> To: B S
> Cc: c...
> Sent: Thu, October 21, 2010 3:05:55 AM
> Subject: Re: [c6x] Code for ADS7881EVM
>
> B.S.
>
> Perhaps I was not clear.
>
> So I'll ask a few directed questions.
>
> 1) what makes you think the timer interrupt is not occuring?
>
> 2) after the project runs for a while, what is the value of the
> variable 'pingpong'?
>
> 3) looking at the lines to the ads7881,
> do you see the the start convert line being strobed?
>
> 4) looking at the lines from the ads7881,
> do you see the data ready line being strobed?
>
> 5) after resetting, then performing a 'run to main', does the code
> stop at the begining of the 'main' function?
>
> 6) after putting a breakpoint in the hwiDMA_isr function, does the
> code ever hit
>
> that breakpoint?
>
> 7) if you add some code in the hwiDMA_isr function to toggle a GPIO
> pin, can you see that pin being toggled? if so, how often?
>
> 8) have you examined the appropriate registers to determine of the
> edms interrupt 6 is being enabled?
>
> 9) have you examined the appropriate registers to determine if the
> timer 1 is properly setup?
>
> I'm not there to look over your shoulder and make suggestions, so you
> have to tell me what is going on, what you have checked, etc.
>
> R. Williams
>
> ---------- Original Message -----------
> From: B S
> To: Richard Williams
> Cc: c...
> Sent: Wed, 20 Oct 2010 07:49:13 -0700 (PDT)
> Subject: Re: [c6x] Code for ADS7881EVM
>
> > R. Williams,
> >
> > I would have provided you all missing details if I knew whats going on
> > there :-)
> >
> > I got the board, interfaced as stated in the document mentioned below
> > and used the code given in the end of that document.
> >
> > http://focus.ti.com/lit/an/slaa257/slaa257.pdf
> >
> > However, I went through the code and checked the lines mentioned below,
> > seems that Timer1 is not triggering and thats the reason ping and
> > pong buffers have 0s value.
> >
> > TIMER_start(hTimer1); /*Start A/D
> > CONVST# trigger */
> >
> > LOG_printf(&trace, "GO! \n"); /*Go sample at 4MSPS*/
> >
> > Last sentence of Page 8 (in the document mentioned above) says to
> > change link handle setting in the config.cdb file to continuously Ping
> > Pong. I did this but still it's not working.
> >
> > I am sure ADC is interfaced with the processor successfully but don't
> > know why code is not working.
> >
> > Please suggest where else should I look.
> >
> > Regards.
> > BAS
> >
> > ________________________________
> > From: Richard Williams
> > To: B S ; c...
> > Sent: Tue, October 19, 2010 7:45:50 PM
> > Subject: Re: [c6x] Code for ADS7881EVM
> >
> > B.S.
> >
> > Alright, a bit of debugging is needed..
> >
> > have you stopped the CPU at the beginning of the interrupt handler and
> > checked the values actually read?
> >
> > have you stopped the CPU and manually read the input port to see what
> > the values
> >
> > are?
> >
> > have you put a logic analyzer on the data lines from the ADS chip and
> > noted if any data is actually being produced?
> >
> > have you put a logic analyzer on the CS, etc lines of the ADS chip and
> > noted if the chip is actually being enabled and accessed?
> >
> > If I may make a useful suggestion ...
> >
> > The kinds of questions I read from you are missing many critical details.
> > The posts say: "I wrote/used some code, it did not work, fix it for me."
> > Often the posts seem to indicate your not really sure about what the
> > application
> >
> > is expected to do.
> >
> > What would be much better ...
> > --I used such and such a code example. (or here is a snipit of the
> > code that I think is giving a problem). --this is how I set up the
> > surrounding hardware .... --when I ran the application it did not work
> > as expected. --here is what the application did do .... --I used ...
> > equipment, and did ... to debug the application. --This is what I
> > found in my debug efforts .... --Given the above, what do you suggest
> > I look at next?
> >
> > R. Williams
> >
> > ---------- Original Message -----------
> > From: B S
> > To: Richard Williams , c...
> > Sent: Tue, 19 Oct 2010 00:22:28 -0700 (PDT)
> > Subject: Re: [c6x] Code for ADS7881EVM
> >
> > > R. Williams,
> > >
> > > Yes I applied analog signal from external source and when I run the
> > > code, processor does processing but data buffers are always 0s.
> > >
> > > I think there is some thing wrong with interfacing. I am using default
> > > jumper setting for ADS7881EVM, I wasn't sure to change them as stated
> > > in the document because some of the jumper settings are same as
> > > defined in the document and some aren't. In the following document,
> > > Table # 1 and Table # 2 shows jumper settings for ADS7881EVM and 5-6K
> > > Interface Board respectively.
> > >
> > > http://focus.ti.com/lit/an/slaa257/slaa257.pdf
> > >
> > > Should I change all of them accoring to document ? I didn't have any
> > > prior knowledge of interfacing, can you give me some guidance if you
> > > don't mind.
> > >
> > > I will appreciate your help.
> > >
> > > Regards.
> > >
> > > ________________________________
> > > From: Richard Williams
> > > To: B S ; c...
> > > Sent: Mon, October 18, 2010 4:11:23 PM
> > > Subject: Re: [c6x] Code for ADS7881EVM
> > >
> > > B.S.
> > >
> > > Have you read the referenced code?
> > >
> > > It skips the first buffer of data.
> > > Then it simply resets the EDMA and INT and continues.
> > > SO the best it can do is have the second buffer of data modified and
> > > moved to the data* buffers.
> > >
> > > It does not (although comments say it does) fire a software interrupt
> > > for processing of the data.
> > >
> > > The code assumes this is being run under the BIOS.
> > >
> > > Do you have a steady stream of data being fed into the A/D converter
> > > from some external source? With out any data coming in, the buffers
> > > will always be full of 0s.
> > >
> > > This code is NOT a normal ping/pong buffer operation.
> > > rather it reads two 16bit values from the A/D converter and places
> > > those values into two buffers. Then reads the next two 16 bit values.
> > >
> > > R. Williams
> > >
> > > ---------- Original Message -----------
> > > From: B S
> > > To: c...
> > > Sent: Mon, 18 Oct 2010 01:12:19 -0700 (PDT)
> > > Subject: [c6x] Code for ADS7881EVM
> > >
> > > > Hi Guys,
> > > >
> > > > I am using ADS7811EVM and 5-6 Interface board to interface with C6713
> > > > DSK. I have attached the ADC as stated in the guide and used the C
> > > > code given in zipped folder on the following website.
> > > >
> > > > http://focus.ti.com/dsp/docs/litabsmultiplefilelist.tsp?
> > >
sectionId=3&tabId@9&literatureNumber=slaa257&docCategoryId=1&familyId27
> > > >
> > > > I don't know whats wrong, when I run the code, processor seem to work
> > > > but Ping and Pong buffers are all zero when I check by putting break
> point.
> > > >
> > > > Can any one please provide me working code OR help me with this code ?
> > > >
> > > > I will appreciate your kind support.
> > > >
> > > > BR,
> > > > BAS
> > > ------- End of Original Message -------
> > ------- End of Original Message -------
> ------- End of Original Message -------
------- End of Original Message -------

_____________________________________