Getting into DSP. - Page 1
Forum section: electronics / beginners

author: s3c
author_rank: Contributor
timestamp: July 07, 2010, 01:25:02 am
content: I'm currently trying to get started in DSP, not the theory mind you, the physical side. Could anyone recommend a small chip that's easy to wrap your mind around when starting or perhaps a good starter development board?

author: EEVblog
author_rank: Unknown
timestamp: July 07, 2010, 03:21:31 am
content: Microchip have their dsPIC range, so uses all the usual MPLAB PICkit tools etc.DSPisessentially all about the theory though, DSP chips are nothing more than regular micros that are optimised for DSP calculations.Dave.

author: Unknown
author_rank: Unknown
timestamp: July 07, 2010, 05:02:18 am
content: Could I ask what are DSP calculations?

author: Time
author_rank: Frequent Contributor
timestamp: July 07, 2010, 05:04:22 am
content: digital signal processing

author: KTP
author_rank: Frequent Contributor
timestamp: July 07, 2010, 05:15:32 am
content: heh, I think he actually meant what type of calculations are specific to dsp devices vs generic microcontrollers.FFT? low cycle multiply and divides? Dsp also usually have a programmable DMA unit too don't they?

author: RayJones
author_rank: Frequent Contributor
timestamp: July 07, 2010, 05:24:18 am
content: The most common special instruction is a multiply accumulate.This is extensively used in FFT and FIR/IIR filter algorithms.Note that due to pipelining, the multiply and accumulate processing may be on different registers within the one clock cycle.That brings up another thing that DSPs are built about.Execution pipelines.You also usually need to be aware of pipeline delays in reading and writing to external memory, ie data read from memory may only available after X lines of code.Certainly a lot more thought is required to conquer a DSP at the assembly level, but that is where you can truly unleash their full potential.Many C compilers are good though at producing efficient pipelined code.PIC ASM is a breeze in comparison, never tried a dsPIC though.

author: jahonen
author_rank: Super Contributor
timestamp: July 07, 2010, 08:53:53 am
content: I usually say that if you can multiply and add, then you know the very essence of DSPThe rest is just elaborate arrangement of those operations.Traditional characteristic of DSP processor has been indeed the capability to do efficient MAC operations, one MAC per machine cycle. Of course, to be able to sustain that, it is required in addition of 1-cycle multiplier-adder that next operands can be fetched simultaneously. Another thing is automatic saturation in aritmethic, so small overflows of accumulator cause just small clipping instead of wrapping over to opposite sign extreme (which would be disastrous in control applications). This requirement of operand fetches usually excludes Von Neumann-type architectures with one data and code memory (although there exists some kludges to make simultaneous accesses, like in TI DSP).The first DSP chip I learned about was the Motorola (Now Freescale) DSP56002, where you could write the following assembly line which I think condenses the very essence of FIR-filter into one instruction:mac x0, y0, a X:(r0)+,x0 y:(r4)+,y0That performs quite many simultaneous operations in one machine cycle. First, it multiplies x0 and y0 registers and adds the result to the accumulator a. Second, it pre-fetches x0 and y0 from x and y data memories (yes, there were 3 independent memory spaces, code, X-data and Y-data). Third, it postincrements index registers r0 and r4 after the fetches, while taking care of the modulo (index registers reset back to buffer beginning automagically without separate if()'s). When combined with REP instruction (which repeated following instruction n times without any software loops), this makes very machine cycle efficient code. The whole FIR-filter could be written in, IIRC, 4 assembly instructions (excluding possible initializations). I wonder how you could achieve that in C without resorting to inline assembly. But in the other hand, it usually only makes sense to optimize the most time-intensive partitions of code and program rest in C.dsPIC actually looks like that it has gotten some ideas from 56k, there are even x and y data spacesRecently, I have done some experiments with Altera FPGA multipliers (3-way phase linear active crossover), and they make too quite nice platform to do these things, as FPGA is a parallel beast in nature, and many DSP operations parallelize easily.Another other closely DSP-related area is digital control, especially advanced AC-motor control (like FOC) is very important nowadays to improve energy efficiency of motor drives. I believe that motor control applications is one of the most important application area of the dsPICs.Regards,Janne

author: RayJones
author_rank: Frequent Contributor
timestamp: July 07, 2010, 09:18:38 am
content: I've used the AT&T DSP32C (now Lucent, and virtually extinct!), and the TI TMS320C6201.The latter was a ball tearer when we first got it going almost 10 years ago.It uses a 256bit Very Large Instruction Word (VLIW).The processor can execute 8 instructions in parallel ie 8 x 8bit OP codes, all at a somewhat lowly 160MHz.There are two identical halves, with some limited cross coupling.For our purpose at the time, we were performing digital down conversion from a 70MHz IF to baseband IQ.The identical halves helped enormously for IQ processing.Once we conquered the beast, it was performing 1500 multiply/accumulates in 10us ie digital down conversion and low pass filtering.I thought back to my earlier days with the Z80, and how it may have managed one or two simple instructions, in that time. Certainly not a single multiply.To keep the beast going though you need to feed its memory with DMA sourced data, and likewise dispose of the results with DMA.Accessing external memory directly from the CPU hurts big time with wait state insertions, the DMA gets the data into/out of internal memory, allowing the processor to fly.Other penalties were accessing the same memory bank with two instructions in the one VLIW - that incurs a conflict wait state and the processing time effectively doubles.Care with (logical) memory layout solves that problem.It all works great when dialled in correctly, but there are many pitfalls to catch you unawares.but yes, you need to know the mathematics.

author: s3c
author_rank: Contributor
timestamp: July 07, 2010, 12:13:47 pm
content: It hit me that my question may have been misleading right after I hit post. Let me clarify, I am familiar with basic DSP concepts and have written a number of PC side scripts to implement simple filters. What I'm looking for now is a low cost (as in student low cost) entry point into the hardware side. I was looking into the dsPIC range and was hoping to hear about alternatives.

author: jahonen
author_rank: Super Contributor
timestamp: July 07, 2010, 12:33:33 pm
content: I guess that you are looking something DSC-like. TI has C2000-series microcontrollers (you can get even floating point one, like TMS320F28335), and Freescale has 56800-series. These have motor control oriented peripherals, but naturally you can use them any way you like. The math does not careIf you want to just experiment then my personal preference would be the floating point TI DSC. Floating point makes life somewhat easier, unless you need the extreme speed.Regards,Janne