Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
Hi all! I am currently working on a real-time speech codec using ADSP21065L. I am having trouble with real-time data acquisition. I have tried most of the sample programs provided by analog devices on real-time processing. However, most, if not all, of the applications operate on a per-sample basis (i.e. after one sample of data is received, processing is already done). What I need to do is operate on a per-frame basis. After one frame of data is collected, then processing is done. Also, while the DSP processes this current frame of data, it should also be collecting the next frame of data. This also means that all the processes/functions should be performed within the time it takes to collect the next frame. I need help in this part -- the real-time data acquisition. i am thinking of using interrupts. however, i cant find sample programs to guide me through it. if there are people who have already done this and you can help me out, that would be very much appreciated! thanks, Dae Everything happens for the good! Amadea Paula Q. Unisa Teaching Associate Department of Electrical and Electronics Engineering University of the Philippines - Diliman --------------------------------- Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
On Mon, 27 Aug 2007, dae unisa wrote: > Hi all! > > I am currently working on a real-time speech codec using ADSP21065L. I >am having trouble with real-time data acquisition. I have tried most of >the sample programs provided by analog devices on real-time processing. >However, most, if not all, of the applications operate on a per-sample >basis (i.e. after one sample of data is received, processing is already >done). > > What I need to do is operate on a per-frame basis. After one frame of >data is collected, then processing is done. Also, while the DSP processes >this current frame of data, it should also be collecting the next frame >of data. This also means that all the processes/functions should be >performed within the time it takes to collect the next frame. > > I need help in this part -- the real-time data acquisition. i am >thinking of using interrupts. however, i cant find sample programs to >guide me through it. if there are people who have already done this and >you can help me out, that would be very much appreciated! Howdy Dae, Basicly you want a "ping-pong" double buffer. You can use the dma engine to help with this. It can transfer a fixed count of data from one location to a block of memory, then generate an interrupt when the block is full. In the interrupt service routine, you reset the dma engine to point to the other buffer and tell it to go, and then set a flag for the main routine. The main routine checks to see when the flag for each buffer is set, then goes and processes it. As long as your routine can process the data in less time than it takes to collect the data, you are ok. It's a good idea to measure this using a GPIO and a scope - you set and clear a bit at the start and end of processing and another bit when each interrupt happens from the dma. It's really easy to tell when things screw up! You don't have to use dma - it's just that it saves you processor cycle time. Patience, persistence, truth, Dr. mike