DSPRelated.com
Forums

Sample code for data acquisition

Started by sanjana July 16, 2003
Thanks Bhasker,Jim,Jerry

Sorry for the slang used....thatz how we call at the office.....yes
thatz a active sonar pulse.....why we r using ext.mem is....for a
period of 6.67ms we will be getting back scattered data....and we want
to perform some processing on the data(FFt)...but for a 1024 point the
blackfin processor takes 35micro.sec....for the total 6.67msec we get
400,200 samples from the adc.....
(ie 400200/1024=391)....we cant perform the entire processing of the
400200 points within 6.67ms,when the adc is sending the samples into
the adc...)..so we using ext.mem....is it possible I can send the data
from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to
be clear for example ext.mem has already 1024 points and i want to dma
that data from the ext.mem to int.mem for processing while the adc
sends in another set of 1024 points into the ext.mem......how do both
of the channels share the bandwidth.....

can the procedure be... when the adc DMAes(by autobuffering mode) 1024
points into the ext.mem(to a memorry pointer) generate an interrupt
and the interrupt handler stores the data from the pointer into a
receive memory buffer and initiate a transfer to int.mem and reset the
pointer....(this where i m confused regarding the timing
considerations)......and the data from the adc is comingin
continously.......


Any suggestions
Thanks
Sanjana
"Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>...
> "sanjana" <sanjana0706@yahoo.com> wrote in message > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > To be elaborate...the thing is to fire a ping(10 cycles of > > sine)....and we have data coming in for 6.67ms...then we again fire a > > ping......since we r using DMA to xfer data...we want to process some > > of data thatz already in ..inorder not to keep the processor idle for > > 6.67ms(since we are doing the entire procedure for 20 times...we plan > > not to lose 6.67ms*20 time..)....so we keep on moving in the data into > > ext.mem and try to dma the data some of that data for processing in > > that time..... > > Firstly, please do not abbreviate your words so much - it makes for very > difficult reading. > If your goal is to not waste time waiting for data, you don't need this > complicated setup of sending data to external memory and copying that into > internal memory for processing. > Setup a chained DMA transfer from A/D to internal memory. You will have 2 > buffers that are being fed by the chained DMA alternately. When 1 buffer is > full, it notifies your main program and automatically switches to filling > data into the 2nd buffer. Your main program takes the data from the 1st > buffer and processes it. The same process repeats with the 2nd buffer and > the DMA switches back to the 1st buffer. > > BTW, what is a 'ping'? - never heard of it in contexts other than networking > and table tennis. The 2 buffers I mention are sometimes referred to as > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > Is it possible to DMA the data from the ext.mem-->int.mem(previouly > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i m > > using Blackfin... > > so how do the two channels share the bandwidth.....on blackfin the max > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > initited the xfer > > simultaneouly....the peripheral DMA takes prority... > > > > Any suggestions.. > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > news:<3F17FE4E.D0792417@bittware.com>... > > > sanjana wrote: > > > > > > > > I m sorry for the confusion..i should not have added that......the > > > > task is like i have store the data from the ADC to external memory > > > > using peripheral DMA...and DMA the data into the internal mem from the > > > > external memory and perform FFT......while the ADC in the backgound > > > > keeps sending the data into the ext.mem....when there are 1024 points > > > > and i will have to DMA the data into the int.mem and do the FFt > > > > routine..... > > > > > > You could DMA it from the A/D directly to internal memory (which is what > > > I'd do). But since you asked, I'll describe the 2-step operation: > > > > > > First, get your user manual ready and open it up to the chapter on DMA. > > > If you don't have a manual, download one from ADI. Pay special > > > attention to external port DMA's and DMA chaining. > > > > > > Set up a chained DMA to transfer data from the A/D to external memory. > > > You should use two transfer control blocks (TCB's), and have them chain > > > to one another (so when xfer A completes, it starts xfer B, and when > > > xfer B completes, it starts xfer A). Set both of these up so that an > > > interrupt is generated when the transfer completes. > > > > > > When the DMA completes, your interrupt service routine (isr) should > > > start another DMA on another channel to move the data from external > > > memory to internal memory. That DMA should also generate an interrupt, > > > and THAT isr should perform (or trigger) the processing of the data in > > > internal memory. The ext->int DMA should also involve two cross-chained > > > TCB's so you can overlap the DMA and the processing.
Hi
      I could not understand why this complex structure is needed for
data acquisition. Taking data in to the external memory and transfer
to the internal memory for processing is effectively increases the
overall processing time, if you could not achieve any real time
(core)processing benefit by this. My second question regarding the
timing constraints. From your calculation, what I understood was more
than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I am
quoting "but for a 1024 point the blackfin processor takes
35micro.sec....for the total 6.67msec we get 400,200 samples from the
adc.....(ie 400200/1024=391)...." Then how a real time processing will
takes place. Every 17 microsecs, you will get 1024 points, then how it
can process with a processor which needs a 35 micro secs for FFT. It
is the case of real time processing. If you want to save the data and
process it later, it does not have a problem. I don&#8217;t think that
the 2 DMAing can be done simultaneously. You can use the DMA in
interleaved fashion. But make sure that there would not be any data
loss from the real time peripheral device. The ext.mem to internal
memory transfer should complete before the next request from the
peripheral device. I am not sure how much fit the chain insertion mode
in this situation.

rgds
ajith

sanjana0706@yahoo.com (sanjana) wrote in message news:<ef48202a.0307191534.5ba6167f@posting.google.com>...
> Thanks Bhasker,Jim,Jerry > > Sorry for the slang used....thatz how we call at the office.....yes > thatz a active sonar pulse.....why we r using ext.mem is....for a > period of 6.67ms we will be getting back scattered data....and we want > to perform some processing on the data(FFt)...but for a 1024 point the > blackfin processor takes 35micro.sec....for the total 6.67msec we get > 400,200 samples from the adc..... > (ie 400200/1024=391)....we cant perform the entire processing of the > 400200 points within 6.67ms,when the adc is sending the samples into > the adc...)..so we using ext.mem....is it possible I can send the data > from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to > be clear for example ext.mem has already 1024 points and i want to dma > that data from the ext.mem to int.mem for processing while the adc > sends in another set of 1024 points into the ext.mem......how do both > of the channels share the bandwidth..... > > can the procedure be... when the adc DMAes(by autobuffering mode) 1024 > points into the ext.mem(to a memorry pointer) generate an interrupt > and the interrupt handler stores the data from the pointer into a > receive memory buffer and initiate a transfer to int.mem and reset the > pointer....(this where i m confused regarding the timing > considerations)......and the data from the adc is comingin > continously....... > > > Any suggestions > Thanks > Sanjana > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>... > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > sine)....and we have data coming in for 6.67ms...then we again fire a > > > ping......since we r using DMA to xfer data...we want to process some > > > of data thatz already in ..inorder not to keep the processor idle for > > > 6.67ms(since we are doing the entire procedure for 20 times...we plan > > > not to lose 6.67ms*20 time..)....so we keep on moving in the data into > > > ext.mem and try to dma the data some of that data for processing in > > > that time..... > > > > Firstly, please do not abbreviate your words so much - it makes for very > > difficult reading. > > If your goal is to not waste time waiting for data, you don't need this > > complicated setup of sending data to external memory and copying that into > > internal memory for processing. > > Setup a chained DMA transfer from A/D to internal memory. You will have 2 > > buffers that are being fed by the chained DMA alternately. When 1 buffer is > > full, it notifies your main program and automatically switches to filling > > data into the 2nd buffer. Your main program takes the data from the 1st > > buffer and processes it. The same process repeats with the 2nd buffer and > > the DMA switches back to the 1st buffer. > > > > BTW, what is a 'ping'? - never heard of it in contexts other than networking > > and table tennis. The 2 buffers I mention are sometimes referred to as > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > Is it possible to DMA the data from the ext.mem-->int.mem(previouly > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i m > > > using Blackfin... > > > so how do the two channels share the bandwidth.....on blackfin the max > > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > > initited the xfer > > > simultaneouly....the peripheral DMA takes prority... > > > > > > Any suggestions.. > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > news:<3F17FE4E.D0792417@bittware.com>... > > > > sanjana wrote: > > > > > > > > > > I m sorry for the confusion..i should not have added that......the > > > > > task is like i have store the data from the ADC to external memory > > > > > using peripheral DMA...and DMA the data into the internal mem from the > > > > > external memory and perform FFT......while the ADC in the backgound > > > > > keeps sending the data into the ext.mem....when there are 1024 points > > > > > and i will have to DMA the data into the int.mem and do the FFt > > > > > routine..... > > > > > > > > You could DMA it from the A/D directly to internal memory (which is what > > > > I'd do). But since you asked, I'll describe the 2-step operation: > > > > > > > > First, get your user manual ready and open it up to the chapter on DMA. > > > > If you don't have a manual, download one from ADI. Pay special > > > > attention to external port DMA's and DMA chaining. > > > > > > > > Set up a chained DMA to transfer data from the A/D to external memory. > > > > You should use two transfer control blocks (TCB's), and have them chain > > > > to one another (so when xfer A completes, it starts xfer B, and when > > > > xfer B completes, it starts xfer A). Set both of these up so that an > > > > interrupt is generated when the transfer completes. > > > > > > > > When the DMA completes, your interrupt service routine (isr) should > > > > start another DMA on another channel to move the data from external > > > > memory to internal memory. That DMA should also generate an interrupt, > > > > and THAT isr should perform (or trigger) the processing of the data in > > > > internal memory. The ext->int DMA should also involve two cross-chained > > > > TCB's so you can overlap the DMA and the processing.
Thanks Ajith for ur reply....
The operation is a both a sort of real time and non.real time
too....confusing to me too...
The thing is we fire a burst of 10micro.sec(sonar pulse)...and we get
6.67msec of back scattered data coming in....the sequence is fire the
pulse,collect the back scattered ......for 20 times.....and perform
fft on the back scattered data that has come in....we want to repeat
the procedure for 3 times and accomplish everything in 1 sec
period.....
so when the pulses are sent..and after then when we obtain the data
from adc into the ext.mem...since the dma acts independant to the
core...we want to do dome amont of data processing at that
time...(since 6.67m.sec*20*3)is lot of a time for us....
i have thought of procedure but dont know whether that is feasible or
not...
peripheral dma bus operate at max
fsclk/2(fsclk=133MHz)...memDMA@fsclk......

1.set the dma peripheral count register to 1024 onto a 1024 buffer in
ext.mem.....
2.store the data points from the buffer to memory pointer in the
ext.mem itself and reset the count register....
3.the interrupt service routinr starts a dma transfer from the
ext.mem-->int.em...and returns back to the dma transfer from
adc-->ext.mem..
4.when the dma transfer from the ext.mem-->int.mem gets completed it
generates a interrupt and routine starts the processing of data..
5.when the total inflow of data(6.67ms has been lapsed)....i finsih of
the data processing of the remaining points left....

not sure whether its gonna work....i worry about the timings much....
any suggestions....
 
Thank U all 
Sanjana

ajith_pc@yahoo.com (Ajith Kumar P C) wrote in message news:<18eae751.0307202322.145ce5f2@posting.google.com>...
> Hi > I could not understand why this complex structure is needed for > data acquisition. Taking data in to the external memory and transfer > to the internal memory for processing is effectively increases the > overall processing time, if you could not achieve any real time > (core)processing benefit by this. My second question regarding the > timing constraints. From your calculation, what I understood was more > than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I am > quoting "but for a 1024 point the blackfin processor takes > 35micro.sec....for the total 6.67msec we get 400,200 samples from the > adc.....(ie 400200/1024=391)...." Then how a real time processing will > takes place. Every 17 microsecs, you will get 1024 points, then how it > can process with a processor which needs a 35 micro secs for FFT. It > is the case of real time processing. If you want to save the data and > process it later, it does not have a problem. I don&#8217;t think that > the 2 DMAing can be done simultaneously. You can use the DMA in > interleaved fashion. But make sure that there would not be any data > loss from the real time peripheral device. The ext.mem to internal > memory transfer should complete before the next request from the > peripheral device. I am not sure how much fit the chain insertion mode > in this situation. > > rgds > ajith > > sanjana0706@yahoo.com (sanjana) wrote in message news:<ef48202a.0307191534.5ba6167f@posting.google.com>... > > Thanks Bhasker,Jim,Jerry > > > > Sorry for the slang used....thatz how we call at the office.....yes > > thatz a active sonar pulse.....why we r using ext.mem is....for a > > period of 6.67ms we will be getting back scattered data....and we want > > to perform some processing on the data(FFt)...but for a 1024 point the > > blackfin processor takes 35micro.sec....for the total 6.67msec we get > > 400,200 samples from the adc..... > > (ie 400200/1024=391)....we cant perform the entire processing of the > > 400200 points within 6.67ms,when the adc is sending the samples into > > the adc...)..so we using ext.mem....is it possible I can send the data > > from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to > > be clear for example ext.mem has already 1024 points and i want to dma > > that data from the ext.mem to int.mem for processing while the adc > > sends in another set of 1024 points into the ext.mem......how do both > > of the channels share the bandwidth..... > > > > can the procedure be... when the adc DMAes(by autobuffering mode) 1024 > > points into the ext.mem(to a memorry pointer) generate an interrupt > > and the interrupt handler stores the data from the pointer into a > > receive memory buffer and initiate a transfer to int.mem and reset the > > pointer....(this where i m confused regarding the timing > > considerations)......and the data from the adc is comingin > > continously....... > > > > > > Any suggestions > > Thanks > > Sanjana > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>... > > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > > sine)....and we have data coming in for 6.67ms...then we again fire a > > > > ping......since we r using DMA to xfer data...we want to process some > > > > of data thatz already in ..inorder not to keep the processor idle for > > > > 6.67ms(since we are doing the entire procedure for 20 times...we plan > > > > not to lose 6.67ms*20 time..)....so we keep on moving in the data into > > > > ext.mem and try to dma the data some of that data for processing in > > > > that time..... > > > > > > Firstly, please do not abbreviate your words so much - it makes for very > > > difficult reading. > > > If your goal is to not waste time waiting for data, you don't need this > > > complicated setup of sending data to external memory and copying that into > > > internal memory for processing. > > > Setup a chained DMA transfer from A/D to internal memory. You will have 2 > > > buffers that are being fed by the chained DMA alternately. When 1 buffer is > > > full, it notifies your main program and automatically switches to filling > > > data into the 2nd buffer. Your main program takes the data from the 1st > > > buffer and processes it. The same process repeats with the 2nd buffer and > > > the DMA switches back to the 1st buffer. > > > > > > BTW, what is a 'ping'? - never heard of it in contexts other than networking > > > and table tennis. The 2 buffers I mention are sometimes referred to as > > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > > > > Is it possible to DMA the data from the ext.mem-->int.mem(previouly > > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i m > > > > using Blackfin... > > > > so how do the two channels share the bandwidth.....on blackfin the max > > > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > > > initited the xfer > > > > simultaneouly....the peripheral DMA takes prority... > > > > > > > > Any suggestions.. > > > > > > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > news:<3F17FE4E.D0792417@bittware.com>... > > > > > sanjana wrote: > > > > > > > > > > > > I m sorry for the confusion..i should not have added that......the > > > > > > task is like i have store the data from the ADC to external memory > > > > > > using peripheral DMA...and DMA the data into the internal mem from the > > > > > > external memory and perform FFT......while the ADC in the backgound > > > > > > keeps sending the data into the ext.mem....when there are 1024 points > > > > > > and i will have to DMA the data into the int.mem and do the FFt > > > > > > routine..... > > > > > > > > > > You could DMA it from the A/D directly to internal memory (which is what > > > > > I'd do). But since you asked, I'll describe the 2-step operation: > > > > > > > > > > First, get your user manual ready and open it up to the chapter on DMA. > > > > > If you don't have a manual, download one from ADI. Pay special > > > > > attention to external port DMA's and DMA chaining. > > > > > > > > > > Set up a chained DMA to transfer data from the A/D to external memory. > > > > > You should use two transfer control blocks (TCB's), and have them chain > > > > > to one another (so when xfer A completes, it starts xfer B, and when > > > > > xfer B completes, it starts xfer A). Set both of these up so that an > > > > > interrupt is generated when the transfer completes. > > > > > > > > > > When the DMA completes, your interrupt service routine (isr) should > > > > > start another DMA on another channel to move the data from external > > > > > memory to internal memory. That DMA should also generate an interrupt, > > > > > and THAT isr should perform (or trigger) the processing of the data in > > > > > internal memory. The ext->int DMA should also involve two cross-chained > > > > > TCB's so you can overlap the DMA and the processing.
"sanjana" <sanjana0706@yahoo.com> wrote in message
news:ef48202a.0307211354.7b00c470@posting.google.com...
> Thanks Ajith for ur reply.... > The operation is a both a sort of real time and non.real time > too....confusing to me too... > The thing is we fire a burst of 10micro.sec(sonar pulse)...and we get > 6.67msec of back scattered data coming in....the sequence is fire the > pulse,collect the back scattered ......for 20 times.....and perform > fft on the back scattered data that has come in....we want to repeat > the procedure for 3 times and accomplish everything in 1 sec > period..... > so when the pulses are sent..and after then when we obtain the data > from adc into the ext.mem...since the dma acts independant to the > core...we want to do dome amont of data processing at that > time...(since 6.67m.sec*20*3)is lot of a time for us.... > i have thought of procedure but dont know whether that is feasible or > not... > peripheral dma bus operate at max > fsclk/2(fsclk=133MHz)...memDMA@fsclk...... > > 1.set the dma peripheral count register to 1024 onto a 1024 buffer in > ext.mem..... > 2.store the data points from the buffer to memory pointer in the > ext.mem itself and reset the count register....
I don't understand why DMA-ing the data into internal memory directly using chained DMA won't work for you. While the data is being DMA-ed into internal memory, you can perform your FFTs on the previous (internal memory) buffer that is full. Seems to me that you are complicating the data acquisition (and hence the software) unnecessarily.
> 3.the interrupt service routinr starts a dma transfer from the > ext.mem-->int.em...and returns back to the dma transfer from > adc-->ext.mem.. > 4.when the dma transfer from the ext.mem-->int.mem gets completed it > generates a interrupt and routine starts the processing of data.. > 5.when the total inflow of data(6.67ms has been lapsed)....i finsih of > the data processing of the remaining points left.... > > not sure whether its gonna work....i worry about the timings much.... > any suggestions.... > > Thank U all > Sanjana > > ajith_pc@yahoo.com (Ajith Kumar P C) wrote in message
news:<18eae751.0307202322.145ce5f2@posting.google.com>...
> > Hi > > I could not understand why this complex structure is needed for > > data acquisition. Taking data in to the external memory and transfer > > to the internal memory for processing is effectively increases the > > overall processing time, if you could not achieve any real time > > (core)processing benefit by this. My second question regarding the > > timing constraints. From your calculation, what I understood was more > > than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I am > > quoting "but for a 1024 point the blackfin processor takes > > 35micro.sec....for the total 6.67msec we get 400,200 samples from the > > adc.....(ie 400200/1024=391)...." Then how a real time processing will > > takes place. Every 17 microsecs, you will get 1024 points, then how it > > can process with a processor which needs a 35 micro secs for FFT. It > > is the case of real time processing. If you want to save the data and > > process it later, it does not have a problem. I don&#8217;t think that > > the 2 DMAing can be done simultaneously. You can use the DMA in > > interleaved fashion. But make sure that there would not be any data > > loss from the real time peripheral device. The ext.mem to internal > > memory transfer should complete before the next request from the > > peripheral device. I am not sure how much fit the chain insertion mode > > in this situation. > > > > rgds > > ajith > > > > sanjana0706@yahoo.com (sanjana) wrote in message
news:<ef48202a.0307191534.5ba6167f@posting.google.com>...
> > > Thanks Bhasker,Jim,Jerry > > > > > > Sorry for the slang used....thatz how we call at the office.....yes > > > thatz a active sonar pulse.....why we r using ext.mem is....for a > > > period of 6.67ms we will be getting back scattered data....and we want
> > > to perform some processing on the data(FFt)...but for a 1024 point the > > > blackfin processor takes 35micro.sec....for the total 6.67msec we get > > > 400,200 samples from the adc..... > > > (ie 400200/1024=391)....we cant perform the entire processing of the > > > 400200 points within 6.67ms,when the adc is sending the samples into > > > the adc...)..so we using ext.mem....is it possible I can send the data > > > from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to > > > be clear for example ext.mem has already 1024 points and i want to dma > > > that data from the ext.mem to int.mem for processing while the adc > > > sends in another set of 1024 points into the ext.mem......how do both > > > of the channels share the bandwidth..... > > > > > > can the procedure be... when the adc DMAes(by autobuffering mode) 1024 > > > points into the ext.mem(to a memorry pointer) generate an interrupt > > > and the interrupt handler stores the data from the pointer into a > > > receive memory buffer and initiate a transfer to int.mem and reset the > > > pointer....(this where i m confused regarding the timing > > > considerations)......and the data from the adc is comingin > > > continously....... > > > > > > > > > Any suggestions > > > Thanks > > > Sanjana > > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message
news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>...
> > > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > > > sine)....and we have data coming in for 6.67ms...then we again
fire a
> > > > > ping......since we r using DMA to xfer data...we want to process
some
> > > > > of data thatz already in ..inorder not to keep the processor idle
for
> > > > > 6.67ms(since we are doing the entire procedure for 20 times...we
plan
> > > > > not to lose 6.67ms*20 time..)....so we keep on moving in the data
into
> > > > > ext.mem and try to dma the data some of that data for processing
in
> > > > > that time..... > > > > > > > > Firstly, please do not abbreviate your words so much - it makes for
very
> > > > difficult reading. > > > > If your goal is to not waste time waiting for data, you don't need
this
> > > > complicated setup of sending data to external memory and copying
that into
> > > > internal memory for processing. > > > > Setup a chained DMA transfer from A/D to internal memory. You will
have 2
> > > > buffers that are being fed by the chained DMA alternately. When 1
buffer is
> > > > full, it notifies your main program and automatically switches to
filling
> > > > data into the 2nd buffer. Your main program takes the data from the
1st
> > > > buffer and processes it. The same process repeats with the 2nd
buffer and
> > > > the DMA switches back to the 1st buffer. > > > > > > > > BTW, what is a 'ping'? - never heard of it in contexts other than
networking
> > > > and table tennis. The 2 buffers I mention are sometimes referred to
as
> > > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > > > > > > > Is it possible to DMA the data from the
ext.mem-->int.mem(previouly
> > > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i
m
> > > > > using Blackfin... > > > > > so how do the two channels share the bandwidth.....on blackfin the
max
> > > > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > > > > initited the xfer > > > > > simultaneouly....the peripheral DMA takes prority... > > > > > > > > > > Any suggestions.. > > > > > > > > > > > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > > news:<3F17FE4E.D0792417@bittware.com>... > > > > > > sanjana wrote: > > > > > > > > > > > > > > I m sorry for the confusion..i should not have added
that......the
> > > > > > > task is like i have store the data from the ADC to external
memory
> > > > > > > using peripheral DMA...and DMA the data into the internal mem
from the
> > > > > > > external memory and perform FFT......while the ADC in the
backgound
> > > > > > > keeps sending the data into the ext.mem....when there are 1024
points
> > > > > > > and i will have to DMA the data into the int.mem and do the
FFt
> > > > > > > routine..... > > > > > > > > > > > > You could DMA it from the A/D directly to internal memory (which
is what
> > > > > > I'd do). But since you asked, I'll describe the 2-step
operation:
> > > > > > > > > > > > First, get your user manual ready and open it up to the chapter
on DMA.
> > > > > > If you don't have a manual, download one from ADI. Pay special > > > > > > attention to external port DMA's and DMA chaining. > > > > > > > > > > > > Set up a chained DMA to transfer data from the A/D to external
memory.
> > > > > > You should use two transfer control blocks (TCB's), and have
them chain
> > > > > > to one another (so when xfer A completes, it starts xfer B, and
when
> > > > > > xfer B completes, it starts xfer A). Set both of these up so
that an
> > > > > > interrupt is generated when the transfer completes. > > > > > > > > > > > > When the DMA completes, your interrupt service routine (isr)
should
> > > > > > start another DMA on another channel to move the data from
external
> > > > > > memory to internal memory. That DMA should also generate an
interrupt,
> > > > > > and THAT isr should perform (or trigger) the processing of the
data in
> > > > > > internal memory. The ext->int DMA should also involve two
cross-chained
> > > > > > TCB's so you can overlap the DMA and the processing.
Bhaskar Thiagarajan wrote:
>
...
> > I don't understand why DMA-ing the data into internal memory directly using > chained DMA won't work for you. > While the data is being DMA-ed into internal memory, you can perform your > FFTs on the previous (internal memory) buffer that is full. > Seems to me that you are complicating the data acquisition (and hence the > software) unnecessarily. >
And wasting memory in the process. ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Hi
       I am not sure about the Blackfin architecture. I think the only
core processing which is not use the external port can be executes,
while an external device to external memory DMA progresses. If you
access the external port buffers during the DMA, would corrupt the DMA
data. I think you are continuously getting data from ADC (that means
DMA operation is progressing at background), then how you could use
another DMA or simple data transfer which uses external port. So
either you can use as Bhasker mentioned (DMA to internal memory), but
in this case storing may be a problem or use the same structure (DMA
to ext. mem) and process the data at offline (needs good amount of
secondary storage). Think of it. I may be wrong. The other method
which I think feasible is a hardware solution and it is based on SHARC
architecture. In SHARC, SPORT DMA are available and which are
independent of core processing (core can access both internal and
external memory while SPORT DMA). I don&#8217;t know whether Blackfin
supports this. If it supports, connect the ADC to the SPORT and try.

rgds
ajith
"Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:<bfhtso$fcujg$1@ID-82263.news.uni-berlin.de>...
> "sanjana" <sanjana0706@yahoo.com> wrote in message > news:ef48202a.0307211354.7b00c470@posting.google.com... > > Thanks Ajith for ur reply.... > > The operation is a both a sort of real time and non.real time > > too....confusing to me too... > > The thing is we fire a burst of 10micro.sec(sonar pulse)...and we get > > 6.67msec of back scattered data coming in....the sequence is fire the > > pulse,collect the back scattered ......for 20 times.....and perform > > fft on the back scattered data that has come in....we want to repeat > > the procedure for 3 times and accomplish everything in 1 sec > > period..... > > so when the pulses are sent..and after then when we obtain the data > > from adc into the ext.mem...since the dma acts independant to the > > core...we want to do dome amont of data processing at that > > time...(since 6.67m.sec*20*3)is lot of a time for us.... > > i have thought of procedure but dont know whether that is feasible or > > not... > > peripheral dma bus operate at max > > fsclk/2(fsclk=133MHz)...memDMA@fsclk...... > > > > 1.set the dma peripheral count register to 1024 onto a 1024 buffer in > > ext.mem..... > > 2.store the data points from the buffer to memory pointer in the > > ext.mem itself and reset the count register.... > > I don't understand why DMA-ing the data into internal memory directly using > chained DMA won't work for you. > While the data is being DMA-ed into internal memory, you can perform your > FFTs on the previous (internal memory) buffer that is full. > Seems to me that you are complicating the data acquisition (and hence the > software) unnecessarily. > > > 3.the interrupt service routinr starts a dma transfer from the > > ext.mem-->int.em...and returns back to the dma transfer from > > adc-->ext.mem.. > > 4.when the dma transfer from the ext.mem-->int.mem gets completed it > > generates a interrupt and routine starts the processing of data.. > > 5.when the total inflow of data(6.67ms has been lapsed)....i finsih of > > the data processing of the remaining points left.... > > > > not sure whether its gonna work....i worry about the timings much.... > > any suggestions.... > > > > Thank U all > > Sanjana > > > > ajith_pc@yahoo.com (Ajith Kumar P C) wrote in message > news:<18eae751.0307202322.145ce5f2@posting.google.com>... > > > Hi > > > I could not understand why this complex structure is needed for > > > data acquisition. Taking data in to the external memory and transfer > > > to the internal memory for processing is effectively increases the > > > overall processing time, if you could not achieve any real time > > > (core)processing benefit by this. My second question regarding the > > > timing constraints. From your calculation, what I understood was more > > > than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I am > > > quoting "but for a 1024 point the blackfin processor takes > > > 35micro.sec....for the total 6.67msec we get 400,200 samples from the > > > adc.....(ie 400200/1024=391)...." Then how a real time processing will > > > takes place. Every 17 microsecs, you will get 1024 points, then how it > > > can process with a processor which needs a 35 micro secs for FFT. It > > > is the case of real time processing. If you want to save the data and > > > process it later, it does not have a problem. I don&#8217;t think that > > > the 2 DMAing can be done simultaneously. You can use the DMA in > > > interleaved fashion. But make sure that there would not be any data > > > loss from the real time peripheral device. The ext.mem to internal > > > memory transfer should complete before the next request from the > > > peripheral device. I am not sure how much fit the chain insertion mode > > > in this situation. > > > > > > rgds > > > ajith > > > > > > sanjana0706@yahoo.com (sanjana) wrote in message > news:<ef48202a.0307191534.5ba6167f@posting.google.com>... > > > > Thanks Bhasker,Jim,Jerry > > > > > > > > Sorry for the slang used....thatz how we call at the office.....yes > > > > thatz a active sonar pulse.....why we r using ext.mem is....for a > > > > period of 6.67ms we will be getting back scattered data....and we want > > > > > to perform some processing on the data(FFt)...but for a 1024 point the > > > > blackfin processor takes 35micro.sec....for the total 6.67msec we get > > > > 400,200 samples from the adc..... > > > > (ie 400200/1024=391)....we cant perform the entire processing of the > > > > 400200 points within 6.67ms,when the adc is sending the samples into > > > > the adc...)..so we using ext.mem....is it possible I can send the data > > > > from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to > > > > be clear for example ext.mem has already 1024 points and i want to dma > > > > that data from the ext.mem to int.mem for processing while the adc > > > > sends in another set of 1024 points into the ext.mem......how do both > > > > of the channels share the bandwidth..... > > > > > > > > can the procedure be... when the adc DMAes(by autobuffering mode) 1024 > > > > points into the ext.mem(to a memorry pointer) generate an interrupt > > > > and the interrupt handler stores the data from the pointer into a > > > > receive memory buffer and initiate a transfer to int.mem and reset the > > > > pointer....(this where i m confused regarding the timing > > > > considerations)......and the data from the adc is comingin > > > > continously....... > > > > > > > > > > > > Any suggestions > > > > Thanks > > > > Sanjana > > > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message > news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>... > > > > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > > > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > > > > sine)....and we have data coming in for 6.67ms...then we again > fire a > > > > > > ping......since we r using DMA to xfer data...we want to process > some > > > > > > of data thatz already in ..inorder not to keep the processor idle > for > > > > > > 6.67ms(since we are doing the entire procedure for 20 times...we > plan > > > > > > not to lose 6.67ms*20 time..)....so we keep on moving in the data > into > > > > > > ext.mem and try to dma the data some of that data for processing > in > > > > > > that time..... > > > > > > > > > > Firstly, please do not abbreviate your words so much - it makes for > very > > > > > difficult reading. > > > > > If your goal is to not waste time waiting for data, you don't need > this > > > > > complicated setup of sending data to external memory and copying > that into > > > > > internal memory for processing. > > > > > Setup a chained DMA transfer from A/D to internal memory. You will > have 2 > > > > > buffers that are being fed by the chained DMA alternately. When 1 > buffer is > > > > > full, it notifies your main program and automatically switches to > filling > > > > > data into the 2nd buffer. Your main program takes the data from the > 1st > > > > > buffer and processes it. The same process repeats with the 2nd > buffer and > > > > > the DMA switches back to the 1st buffer. > > > > > > > > > > BTW, what is a 'ping'? - never heard of it in contexts other than > networking > > > > > and table tennis. The 2 buffers I mention are sometimes referred to > as > > > > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > > > > > > > > > > Is it possible to DMA the data from the > ext.mem-->int.mem(previouly > > > > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i > m > > > > > > using Blackfin... > > > > > > so how do the two channels share the bandwidth.....on blackfin the > max > > > > > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > > > > > initited the xfer > > > > > > simultaneouly....the peripheral DMA takes prority... > > > > > > > > > > > > Any suggestions.. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > news:<3F17FE4E.D0792417@bittware.com>... > > > > > > > sanjana wrote: > > > > > > > > > > > > > > > > I m sorry for the confusion..i should not have added > that......the > > > > > > > > task is like i have store the data from the ADC to external > memory > > > > > > > > using peripheral DMA...and DMA the data into the internal mem > from the > > > > > > > > external memory and perform FFT......while the ADC in the > backgound > > > > > > > > keeps sending the data into the ext.mem....when there are 1024 > points > > > > > > > > and i will have to DMA the data into the int.mem and do the > FFt > > > > > > > > routine..... > > > > > > > > > > > > > > You could DMA it from the A/D directly to internal memory (which > is what > > > > > > > I'd do). But since you asked, I'll describe the 2-step > operation: > > > > > > > > > > > > > > First, get your user manual ready and open it up to the chapter > on DMA. > > > > > > > If you don't have a manual, download one from ADI. Pay special > > > > > > > attention to external port DMA's and DMA chaining. > > > > > > > > > > > > > > Set up a chained DMA to transfer data from the A/D to external > memory. > > > > > > > You should use two transfer control blocks (TCB's), and have > them chain > > > > > > > to one another (so when xfer A completes, it starts xfer B, and > when > > > > > > > xfer B completes, it starts xfer A). Set both of these up so > that an > > > > > > > interrupt is generated when the transfer completes. > > > > > > > > > > > > > > When the DMA completes, your interrupt service routine (isr) > should > > > > > > > start another DMA on another channel to move the data from > external > > > > > > > memory to internal memory. That DMA should also generate an > interrupt, > > > > > > > and THAT isr should perform (or trigger) the processing of the > data in > > > > > > > internal memory. The ext->int DMA should also involve two > cross-chained > > > > > > > TCB's so you can overlap the DMA and the processing.
Thanks for ur replies....if i use internal memory...
ADC--->int.mem(using peripheral DMA)it takes for for 1024 points
1024*1/66.5MHZ..(15.398micro.sec)...but the fft on the
processor(blackfin 532 takes 1024@13938*1/400MHZ=35micro.sec....so
when the dma is loading another 1024 points(takes 15.3micro.sec)the
fft routine on the previous 1024 pints will be not be done...the
management of the incoming points is what that worries me.....i m
confused about how the dma bus is shared by the peripheral dma and
memory dma....how does the priority works..may be a fundamental
question......
Regards
sanjana

"Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message news:<bfhtso$fcujg$1@ID-82263.news.uni-berlin.de>...
> "sanjana" <sanjana0706@yahoo.com> wrote in message > news:ef48202a.0307211354.7b00c470@posting.google.com... > > Thanks Ajith for ur reply.... > > The operation is a both a sort of real time and non.real time > > too....confusing to me too... > > The thing is we fire a burst of 10micro.sec(sonar pulse)...and we get > > 6.67msec of back scattered data coming in....the sequence is fire the > > pulse,collect the back scattered ......for 20 times.....and perform > > fft on the back scattered data that has come in....we want to repeat > > the procedure for 3 times and accomplish everything in 1 sec > > period..... > > so when the pulses are sent..and after then when we obtain the data > > from adc into the ext.mem...since the dma acts independant to the > > core...we want to do dome amont of data processing at that > > time...(since 6.67m.sec*20*3)is lot of a time for us.... > > i have thought of procedure but dont know whether that is feasible or > > not... > > peripheral dma bus operate at max > > fsclk/2(fsclk=133MHz)...memDMA@fsclk...... > > > > 1.set the dma peripheral count register to 1024 onto a 1024 buffer in > > ext.mem..... > > 2.store the data points from the buffer to memory pointer in the > > ext.mem itself and reset the count register.... > > I don't understand why DMA-ing the data into internal memory directly using > chained DMA won't work for you. > While the data is being DMA-ed into internal memory, you can perform your > FFTs on the previous (internal memory) buffer that is full. > Seems to me that you are complicating the data acquisition (and hence the > software) unnecessarily. > > > 3.the interrupt service routinr starts a dma transfer from the > > ext.mem-->int.em...and returns back to the dma transfer from > > adc-->ext.mem.. > > 4.when the dma transfer from the ext.mem-->int.mem gets completed it > > generates a interrupt and routine starts the processing of data.. > > 5.when the total inflow of data(6.67ms has been lapsed)....i finsih of > > the data processing of the remaining points left.... > > > > not sure whether its gonna work....i worry about the timings much.... > > any suggestions.... > > > > Thank U all > > Sanjana > > > > ajith_pc@yahoo.com (Ajith Kumar P C) wrote in message > news:<18eae751.0307202322.145ce5f2@posting.google.com>... > > > Hi > > > I could not understand why this complex structure is needed for > > > data acquisition. Taking data in to the external memory and transfer > > > to the internal memory for processing is effectively increases the > > > overall processing time, if you could not achieve any real time > > > (core)processing benefit by this. My second question regarding the > > > timing constraints. From your calculation, what I understood was more > > > than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I am > > > quoting "but for a 1024 point the blackfin processor takes > > > 35micro.sec....for the total 6.67msec we get 400,200 samples from the > > > adc.....(ie 400200/1024=391)...." Then how a real time processing will > > > takes place. Every 17 microsecs, you will get 1024 points, then how it > > > can process with a processor which needs a 35 micro secs for FFT. It > > > is the case of real time processing. If you want to save the data and > > > process it later, it does not have a problem. I don&#8217;t think that > > > the 2 DMAing can be done simultaneously. You can use the DMA in > > > interleaved fashion. But make sure that there would not be any data > > > loss from the real time peripheral device. The ext.mem to internal > > > memory transfer should complete before the next request from the > > > peripheral device. I am not sure how much fit the chain insertion mode > > > in this situation. > > > > > > rgds > > > ajith > > > > > > sanjana0706@yahoo.com (sanjana) wrote in message > news:<ef48202a.0307191534.5ba6167f@posting.google.com>... > > > > Thanks Bhasker,Jim,Jerry > > > > > > > > Sorry for the slang used....thatz how we call at the office.....yes > > > > thatz a active sonar pulse.....why we r using ext.mem is....for a > > > > period of 6.67ms we will be getting back scattered data....and we want > > > > > to perform some processing on the data(FFt)...but for a 1024 point the > > > > blackfin processor takes 35micro.sec....for the total 6.67msec we get > > > > 400,200 samples from the adc..... > > > > (ie 400200/1024=391)....we cant perform the entire processing of the > > > > 400200 points within 6.67ms,when the adc is sending the samples into > > > > the adc...)..so we using ext.mem....is it possible I can send the data > > > > from ADC-->ext.mem nd from the ext.mem--->int.mem simultanoeously(to > > > > be clear for example ext.mem has already 1024 points and i want to dma > > > > that data from the ext.mem to int.mem for processing while the adc > > > > sends in another set of 1024 points into the ext.mem......how do both > > > > of the channels share the bandwidth..... > > > > > > > > can the procedure be... when the adc DMAes(by autobuffering mode) 1024 > > > > points into the ext.mem(to a memorry pointer) generate an interrupt > > > > and the interrupt handler stores the data from the pointer into a > > > > receive memory buffer and initiate a transfer to int.mem and reset the > > > > pointer....(this where i m confused regarding the timing > > > > considerations)......and the data from the adc is comingin > > > > continously....... > > > > > > > > > > > > Any suggestions > > > > Thanks > > > > Sanjana > > > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message > news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>... > > > > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > > > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > > > > sine)....and we have data coming in for 6.67ms...then we again > fire a > > > > > > ping......since we r using DMA to xfer data...we want to process > some > > > > > > of data thatz already in ..inorder not to keep the processor idle > for > > > > > > 6.67ms(since we are doing the entire procedure for 20 times...we > plan > > > > > > not to lose 6.67ms*20 time..)....so we keep on moving in the data > into > > > > > > ext.mem and try to dma the data some of that data for processing > in > > > > > > that time..... > > > > > > > > > > Firstly, please do not abbreviate your words so much - it makes for > very > > > > > difficult reading. > > > > > If your goal is to not waste time waiting for data, you don't need > this > > > > > complicated setup of sending data to external memory and copying > that into > > > > > internal memory for processing. > > > > > Setup a chained DMA transfer from A/D to internal memory. You will > have 2 > > > > > buffers that are being fed by the chained DMA alternately. When 1 > buffer is > > > > > full, it notifies your main program and automatically switches to > filling > > > > > data into the 2nd buffer. Your main program takes the data from the > 1st > > > > > buffer and processes it. The same process repeats with the 2nd > buffer and > > > > > the DMA switches back to the 1st buffer. > > > > > > > > > > BTW, what is a 'ping'? - never heard of it in contexts other than > networking > > > > > and table tennis. The 2 buffers I mention are sometimes referred to > as > > > > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > > > > > > > > > > Is it possible to DMA the data from the > ext.mem-->int.mem(previouly > > > > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes on...i > m > > > > > > using Blackfin... > > > > > > so how do the two channels share the bandwidth.....on blackfin the > max > > > > > > for peripheral DMA is 133MHz and for memory DMA is 66.5Mhz....if > > > > > > initited the xfer > > > > > > simultaneouly....the peripheral DMA takes prority... > > > > > > > > > > > > Any suggestions.. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > news:<3F17FE4E.D0792417@bittware.com>... > > > > > > > sanjana wrote: > > > > > > > > > > > > > > > > I m sorry for the confusion..i should not have added > that......the > > > > > > > > task is like i have store the data from the ADC to external > memory > > > > > > > > using peripheral DMA...and DMA the data into the internal mem > from the > > > > > > > > external memory and perform FFT......while the ADC in the > backgound > > > > > > > > keeps sending the data into the ext.mem....when there are 1024 > points > > > > > > > > and i will have to DMA the data into the int.mem and do the > FFt > > > > > > > > routine..... > > > > > > > > > > > > > > You could DMA it from the A/D directly to internal memory (which > is what > > > > > > > I'd do). But since you asked, I'll describe the 2-step > operation: > > > > > > > > > > > > > > First, get your user manual ready and open it up to the chapter > on DMA. > > > > > > > If you don't have a manual, download one from ADI. Pay special > > > > > > > attention to external port DMA's and DMA chaining. > > > > > > > > > > > > > > Set up a chained DMA to transfer data from the A/D to external > memory. > > > > > > > You should use two transfer control blocks (TCB's), and have > them chain > > > > > > > to one another (so when xfer A completes, it starts xfer B, and > when > > > > > > > xfer B completes, it starts xfer A). Set both of these up so > that an > > > > > > > interrupt is generated when the transfer completes. > > > > > > > > > > > > > > When the DMA completes, your interrupt service routine (isr) > should > > > > > > > start another DMA on another channel to move the data from > external > > > > > > > memory to internal memory. That DMA should also generate an > interrupt, > > > > > > > and THAT isr should perform (or trigger) the processing of the > data in > > > > > > > internal memory. The ext->int DMA should also involve two > cross-chained > > > > > > > TCB's so you can overlap the DMA and the processing.
"sanjana" <sanjana0706@yahoo.com> wrote in message
news:ef48202a.0307242146.365a4360@posting.google.com...
> Thanks for ur replies....if i use internal memory... > ADC--->int.mem(using peripheral DMA)it takes for for 1024 points > 1024*1/66.5MHZ..(15.398micro.sec)...but the fft on the
Think about it... if you have a problem in internal memory, it won't go away in external memory. You are basically saying that the data is coming in too fast for your processor to keep up real-time processing. So it doesn't matter what you do. Now, let me correct your calculations...
>1024*1/66.5MHZ..(15.398micro.sec)...but the fft on the
This is *not* the time it takes the DSP to collect 1024 points since you are using the processor clock to calculate the time taken to acquire 1024 points. This means your sampled data rate is equal to the processor clock, which I doubt it true. If it is, then you'd better think about using an FPGA. You need to use your sample rate from the A/D to figure how long it will take to collect 1024 samples. Hope this helps Cheers Bhaskar
> processor(blackfin 532 takes 1024@13938*1/400MHZ=35micro.sec....so > when the dma is loading another 1024 points(takes 15.3micro.sec)the > fft routine on the previous 1024 pints will be not be done...the > management of the incoming points is what that worries me.....i m > confused about how the dma bus is shared by the peripheral dma and > memory dma....how does the priority works..may be a fundamental > question...... > Regards > sanjana > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message
news:<bfhtso$fcujg$1@ID-82263.news.uni-berlin.de>...
> > "sanjana" <sanjana0706@yahoo.com> wrote in message > > news:ef48202a.0307211354.7b00c470@posting.google.com... > > > Thanks Ajith for ur reply.... > > > The operation is a both a sort of real time and non.real time > > > too....confusing to me too... > > > The thing is we fire a burst of 10micro.sec(sonar pulse)...and we get > > > 6.67msec of back scattered data coming in....the sequence is fire the > > > pulse,collect the back scattered ......for 20 times.....and perform > > > fft on the back scattered data that has come in....we want to repeat > > > the procedure for 3 times and accomplish everything in 1 sec > > > period..... > > > so when the pulses are sent..and after then when we obtain the data > > > from adc into the ext.mem...since the dma acts independant to the > > > core...we want to do dome amont of data processing at that > > > time...(since 6.67m.sec*20*3)is lot of a time for us.... > > > i have thought of procedure but dont know whether that is feasible or > > > not... > > > peripheral dma bus operate at max > > > fsclk/2(fsclk=133MHz)...memDMA@fsclk...... > > > > > > 1.set the dma peripheral count register to 1024 onto a 1024 buffer in > > > ext.mem..... > > > 2.store the data points from the buffer to memory pointer in the > > > ext.mem itself and reset the count register.... > > > > I don't understand why DMA-ing the data into internal memory directly
using
> > chained DMA won't work for you. > > While the data is being DMA-ed into internal memory, you can perform
your
> > FFTs on the previous (internal memory) buffer that is full. > > Seems to me that you are complicating the data acquisition (and hence
the
> > software) unnecessarily. > > > > > 3.the interrupt service routinr starts a dma transfer from the > > > ext.mem-->int.em...and returns back to the dma transfer from > > > adc-->ext.mem.. > > > 4.when the dma transfer from the ext.mem-->int.mem gets completed it > > > generates a interrupt and routine starts the processing of data.. > > > 5.when the total inflow of data(6.67ms has been lapsed)....i finsih of > > > the data processing of the remaining points left.... > > > > > > not sure whether its gonna work....i worry about the timings much.... > > > any suggestions.... > > > > > > Thank U all > > > Sanjana > > > > > > ajith_pc@yahoo.com (Ajith Kumar P C) wrote in message > > news:<18eae751.0307202322.145ce5f2@posting.google.com>... > > > > Hi > > > > I could not understand why this complex structure is needed
for
> > > > data acquisition. Taking data in to the external memory and transfer > > > > to the internal memory for processing is effectively increases the > > > > overall processing time, if you could not achieve any real time > > > > (core)processing benefit by this. My second question regarding the > > > > timing constraints. From your calculation, what I understood was
more
> > > > than 13 ms needed for simply taking FFT of the 6.67ms data &#8211;I
am
> > > > quoting "but for a 1024 point the blackfin processor takes > > > > 35micro.sec....for the total 6.67msec we get 400,200 samples from
the
> > > > adc.....(ie 400200/1024=391)...." Then how a real time processing
will
> > > > takes place. Every 17 microsecs, you will get 1024 points, then how
it
> > > > can process with a processor which needs a 35 micro secs for FFT. It > > > > is the case of real time processing. If you want to save the data
and
> > > > process it later, it does not have a problem. I don&#8217;t think
that
> > > > the 2 DMAing can be done simultaneously. You can use the DMA in > > > > interleaved fashion. But make sure that there would not be any data > > > > loss from the real time peripheral device. The ext.mem to internal > > > > memory transfer should complete before the next request from the > > > > peripheral device. I am not sure how much fit the chain insertion
mode
> > > > in this situation. > > > > > > > > rgds > > > > ajith > > > > > > > > sanjana0706@yahoo.com (sanjana) wrote in message > > news:<ef48202a.0307191534.5ba6167f@posting.google.com>... > > > > > Thanks Bhasker,Jim,Jerry > > > > > > > > > > Sorry for the slang used....thatz how we call at the
office.....yes
> > > > > thatz a active sonar pulse.....why we r using ext.mem is....for a > > > > > period of 6.67ms we will be getting back scattered data....and we
want
> > > > > > > to perform some processing on the data(FFt)...but for a 1024 point
the
> > > > > blackfin processor takes 35micro.sec....for the total 6.67msec we
get
> > > > > 400,200 samples from the adc..... > > > > > (ie 400200/1024=391)....we cant perform the entire processing of
the
> > > > > 400200 points within 6.67ms,when the adc is sending the samples
into
> > > > > the adc...)..so we using ext.mem....is it possible I can send the
data
> > > > > from ADC-->ext.mem nd from the ext.mem--->int.mem
simultanoeously(to
> > > > > be clear for example ext.mem has already 1024 points and i want to
dma
> > > > > that data from the ext.mem to int.mem for processing while the adc > > > > > sends in another set of 1024 points into the ext.mem......how do
both
> > > > > of the channels share the bandwidth..... > > > > > > > > > > can the procedure be... when the adc DMAes(by autobuffering mode)
1024
> > > > > points into the ext.mem(to a memorry pointer) generate an
interrupt
> > > > > and the interrupt handler stores the data from the pointer into a > > > > > receive memory buffer and initiate a transfer to int.mem and reset
the
> > > > > pointer....(this where i m confused regarding the timing > > > > > considerations)......and the data from the adc is comingin > > > > > continously....... > > > > > > > > > > > > > > > Any suggestions > > > > > Thanks > > > > > Sanjana > > > > > "Bhaskar Thiagarajan" <bhaskart@deja.com> wrote in message > > news:<bf9neu$cml76$1@ID-82263.news.uni-berlin.de>... > > > > > > "sanjana" <sanjana0706@yahoo.com> wrote in message > > > > > > news:ef48202a.0307181204.5b8f9676@posting.google.com... > > > > > > > To be elaborate...the thing is to fire a ping(10 cycles of > > > > > > > sine)....and we have data coming in for 6.67ms...then we again > > fire a > > > > > > > ping......since we r using DMA to xfer data...we want to
process
> > some > > > > > > > of data thatz already in ..inorder not to keep the processor
idle
> > for > > > > > > > 6.67ms(since we are doing the entire procedure for 20
times...we
> > plan > > > > > > > not to lose 6.67ms*20 time..)....so we keep on moving in the
data
> > into > > > > > > > ext.mem and try to dma the data some of that data for
processing
> > in > > > > > > > that time..... > > > > > > > > > > > > Firstly, please do not abbreviate your words so much - it makes
for
> > very > > > > > > difficult reading. > > > > > > If your goal is to not waste time waiting for data, you don't
need
> > this > > > > > > complicated setup of sending data to external memory and copying > > that into > > > > > > internal memory for processing. > > > > > > Setup a chained DMA transfer from A/D to internal memory. You
will
> > have 2 > > > > > > buffers that are being fed by the chained DMA alternately. When
1
> > buffer is > > > > > > full, it notifies your main program and automatically switches
to
> > filling > > > > > > data into the 2nd buffer. Your main program takes the data from
the
> > 1st > > > > > > buffer and processes it. The same process repeats with the 2nd > > buffer and > > > > > > the DMA switches back to the 1st buffer. > > > > > > > > > > > > BTW, what is a 'ping'? - never heard of it in contexts other
than
> > networking > > > > > > and table tennis. The 2 buffers I mention are sometimes referred
to
> > as > > > > > > ping-pong buffers - but one doesn't fire pings (or pongs). > > > > > > > > > > > > > > > > > > > > Is it possible to DMA the data from the > > ext.mem-->int.mem(previouly > > > > > > > stored data say 1024 points)when the ADC-->ext.mem DMA goes
on...i
> > m > > > > > > > using Blackfin... > > > > > > > so how do the two channels share the bandwidth.....on blackfin
the
> > max > > > > > > > for peripheral DMA is 133MHz and for memory DMA is
66.5Mhz....if
> > > > > > > initited the xfer > > > > > > > simultaneouly....the peripheral DMA takes prority... > > > > > > > > > > > > > > Any suggestions.. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Jim Thomas <jthomas@bittware.com> wrote in message > > news:<3F17FE4E.D0792417@bittware.com>... > > > > > > > > sanjana wrote: > > > > > > > > > > > > > > > > > > I m sorry for the confusion..i should not have added > > that......the > > > > > > > > > task is like i have store the data from the ADC to
external
> > memory > > > > > > > > > using peripheral DMA...and DMA the data into the internal
mem
> > from the > > > > > > > > > external memory and perform FFT......while the ADC in the > > backgound > > > > > > > > > keeps sending the data into the ext.mem....when there are
1024
> > points > > > > > > > > > and i will have to DMA the data into the int.mem and do
the
> > FFt > > > > > > > > > routine..... > > > > > > > > > > > > > > > > You could DMA it from the A/D directly to internal memory
(which
> > is what > > > > > > > > I'd do). But since you asked, I'll describe the 2-step > > operation: > > > > > > > > > > > > > > > > First, get your user manual ready and open it up to the
chapter
> > on DMA. > > > > > > > > If you don't have a manual, download one from ADI. Pay
special
> > > > > > > > attention to external port DMA's and DMA chaining. > > > > > > > > > > > > > > > > Set up a chained DMA to transfer data from the A/D to
external
> > memory. > > > > > > > > You should use two transfer control blocks (TCB's), and have > > them chain > > > > > > > > to one another (so when xfer A completes, it starts xfer B,
and
> > when > > > > > > > > xfer B completes, it starts xfer A). Set both of these up
so
> > that an > > > > > > > > interrupt is generated when the transfer completes. > > > > > > > > > > > > > > > > When the DMA completes, your interrupt service routine (isr) > > should > > > > > > > > start another DMA on another channel to move the data from > > external > > > > > > > > memory to internal memory. That DMA should also generate an > > interrupt, > > > > > > > > and THAT isr should perform (or trigger) the processing of
the
> > data in > > > > > > > > internal memory. The ext->int DMA should also involve two > > cross-chained > > > > > > > > TCB's so you can overlap the DMA and the processing.
sanjana wrote:
> i have thought of procedure
ta taa ta ta
> but dont know whether that is feasible or not...
ta taa ta ta
> not sure whether its gonna work....
ta taa ta ta
> i worry about the timings much....
ta taa ta ta etc. :)
Andor wrote:
> > sanjana wrote: > > i have thought of procedure > > ta taa ta ta > > > but dont know whether that is feasible or not... > > ta taa ta ta > > > not sure whether its gonna work.... > > ta taa ta ta > > > i worry about the timings much.... > > ta taa ta ta > > etc. > > :)
What's with you, Andor? A good rule -- few of us are good enough to follow it all the time -- is to say nothing when there is nothing good to say. It's the other end of the spectrum to indulge in unprovoked ridicule when you have nothing to say at all, good or ill. I trust it was an aberration, or humor gone awry. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;