What should I do as a DSP programming beginner? - signal-processing

I'd like to learn TI DSP programming. I am a beginner.
I have the processors : TMS320VC5505 and TMX320VC5505DZCH
What hardware should I have ?
and
How can I program the DSP ? (c or assembly)
Thank you

Get a low cost DSP evaluation board/module, such as this one form Spectrum Digital. These typically come with a cable which you can connect to a PC or Mac, and suitable development software (Code Composer Studio, in the case of TI DSPs).

DSP programming using tools like Code Composer studio is not too different from any other kind of programming. You can develop your algorithms in C, make sure they run correctly, and the profile them to see if you need to speed anything up. If you do, the first step is to use the compiler's built in optimization options. The next two steps are more DSP-specific: there might be C-callable pragma's to speed up particular math operations, like fractional fixed-point math. And finally, you can get down into the assembly language level and use the DSP-specific capabilities like circular addressing, bit-reversed addressing, and single-cycle multply-accumulate.
TI might be able to provide libraries to do some of the more common tasks, like FFT, FIR filtering, and IIR filtering, so you might be able to avoid writing (and debugging) your own assembly.

Related

Microcontroller Programming in Delphi

I've been searching for some information regarding microcontroller programming but the info I find is either way over my head or doesn't appear to exist. I'm looking for something easier to digest! I'm relatively new to programming and come from an SQL DBA background and decided that it would be quicker for me to learn some programming fundamentals and then teach myself Delphi than it would to get some changes implemented through my company's insane design change note system!
After a couple of years of Delphi programming I can cope with writing database applications without too much bother and I want to be able to move on a level.
We use PIC microcontrollers on our PCBs; mainly the PIC18F family. The software on the PICS is written in C but there are parameters values that are written to by a Delphi application that interface with the PIC using an ActiveX control.
Basically, SQL Database holds parameter info, Delphi client app retrieves those values, passes them to the ActiveX controll which does all the low level stuff on the PIC. For example the internal EEPROM will have a map and within any particular address a value will be stored to switch something on or off or hold an integer value etc.
I've gotten hold of an MPLAB kit which has an ICD2 device that can read and write values to the internal EEPROM and I understand how to change these hexadecimal values using MPLAB software.
My hope isn't to learn embedded microcontroller programming; rather that I can write a Delphi app that will do something similar to MPLAB software. E.g read and write values to certain memory addresses within the EEPROM.
I'd be very gratefull if anyone can point me in the right direction of any libraries or components that may already exist for bridging this gap between simple Delphi form application and writing low level PIC EEPROM. I doubt such any easy interface exists but I thought I'd ask. To summarise I want to be able to have a simple form app, with some edit boxes that the user types in or selects from dropdown boxes, parameter values, to click on a button and to assign those parameter values to specific EEPROM memory addresses. Thank you for reading and any comments would be gratefully received.
Regards
KD
I'm a big fan of MikroElectronika and have used their Pascal tools for pic16 series MCU with great success (touch screen interfaces, ZigBee, ...).
http://www.mikroe.com/
Updated 2015 Answer:
Why not a Raspberry Pi with FreePascal and Lazarus? The boards cost from $5 to $25 US, as of this date, and the development tools are free.
Original 2012 Answer:
If you like to use Pascal, you might find Free Pascal useful on small embedded systems, but the minimum I believe you will find it can compile on is a Linux-based ARM embedded system. The fact that you use pascal on both sides is very unlikely to help you accomplish anything major.
If you want to go all the way down the the smallest PIC microcontrollers, you'll find that it's almost always a variant of C that you'll be using. Frankly, at that level, the differences aren't that much. If you can write Pascal, you can learn enough C in a day, to use with microcontrollers.
Don't be scared to use the native language that most microcontrollers support. My personal favorites are the Rabbit microcontrollers, formerly from Z-World, now from digi -- I think I paid about $100 US for the first board and development toolkit.
Interfacing such an application with delphi is pretty easy, usually these days, I would interface using TCP/IP over either wired Ethernet, or wireless (Wifi). But if you really want to you could use RS-232 or RS-485 serial links. (RS-485 has the advantage that you can wire it up to 5 miles long.) If I was using a serial link, I'd probably implement something like Modbus on both sides, if I just wanted to send some numeric data back and forth, and if I was doing something text-oriented, I think I'd write a mini HTTP web server on the embedded controller, and most boards these days come with enough HTTP server demos to make that drop-dead easy.
Delphi outputs Win32 and Win64 native applications you can write software that can interact with certain devices if the PCB has serial comunication or I2C you can write software that in Delphi that it will interact with the physical device.
But if you want to programm the devices yourself , write software that will run on this devices you can't do it in Delphi. I suggest you buy an Arduino it's an excellent envoirment for beginners in microcontroller programming.
If you have the source code of your pic microcontroller then you can implement the code in C to read from Serial, USB or some other interface available in your hardware and write it to the eeprom. This way its easy to write the app in any high level language like delphi, c++, etc.
Or you can write your PIC application using the mikropascal compiler from mikroeletronika that its very good and I've been using for a long time, but as you can see you will have to implement some mecanism to read from the interface and write to your eeprom as I've mentioned before.
This compiler comes with a lote of librarys to work with many devices. You should take a look on it, its not free but the price is low and in their site you can find samples and sample boards to test it.
One option, if you want a simple interface to write to the PIC EEPROM, is to use the ICD command line utility. Unfortunately it is not available for the ICD2, but the PICkit 2 and 3 (which are cheap), ICD3, and RealICE have command line utilities that give you the ability to write to the EEPROM (google pk2cmd). In Delphi, you could just wrap a very simple set of command line calls to pk2cmd.

What language and compiler to write ATI GPU code for?

I know Nvidia has CUDA, but what does ATI have? I dont want to use OpenCL because I want to keep as low level to the hardware as possible.
Is it brook, or stream?
The documentation available is pretty pathetic! CUDA seems easy to get programming, but I want to use ATI specifically because of their hardware.
OpenCL is AMD's currently preferred GPU/compute language.
Brook is deprecated.
However, you can write code at a very low level, using AMD's
shader and kernel analyzer
http://developer.amd.com/tools/shader/Pages/default.aspx.
http://developer.amd.com/tools/AMDAPPKernelAnalyzer/Pages/default.aspx
E.g. http://developer.amd.com/tools/shader/PublishingImages/GSA.png
shows OpenCL code, and the Radeon 5870 assembly produced.
You can actually code directly in several forms of "assembly".
Or at least you could - the webpages no longer mention this.
(I used to have this installed for tuning and testing, but do not at the moment.)
More usually, you can code in any of several forms of AMD IL, Intermediate Language,
which is closer to the machine than OpenCL. The kernel analyzer web page says
"If your kernel is an IL kernel Stream, KernelAnalyzer will automatically compile the IL..."
I would recommend that you use OpenCL, and then look at the disassembly and tweak the OpenCL code to be better tuned. But you can work in IL, and probably still can work at an even lower level.

iOS assembly code

I would like to try some ARM assembly code with apple iOS just for educational purpose. I would like to start with some in line code within Xcode.
My understanding is that I need to compile for a iOS device, for example for my iPhone, which means that I need to pay $99/year for membership.
I don't think I can use ASM assembly code with a iOS phone simulator.
I am having an hard time on finding examples, books or documentation on ARM assembly code in Xcode env with an iPhone.
Am I doing this wrong? Maybe iOS is not the most user friendly environment to learn ARM Assembly.
Back up...
What are you trying to learn? Arm assembly or iOS programming? Pick one...
Do you have any assembly experience?
What is it you think you are wanting to learn in arm assembly? Jump in and write some full blown gui applications? You need to learn to put immediates in registers add and or and xor and save answers in registers. then read and write some memory locations. Learn to use the stack, make calls, etc. Then write your applications in C or whatever and use asm for hand tuning or use your asm skills to debug the compiler and or code. Writing applications or operating systems, etc in asm is for folks who want to make a statement, or have a specific reason, not for educational purposes.
There is some leaning toward a unified ARM assembly language that works both on the ARM based cores and the thumb2 based cores. Not for all of the assembly language needed but for places where you might want to write a module of code and not have to have a lot of if thumb elses littering the code. You can certainly get your feet wet with that here and take some of that code straight to full 32 bit ARM instructions on some other platform. thumbulator is thumb only, the common instruction set between the ARM based cores and the thumb2 based cores, basically it is the portable ARM instruction set, write the code once, it works on almost all of their cores.
If your goal is to learn iOS programming, get the kit or whatever and learn using whatever language they want you to learn, get proficient at that, learn the apis, etc. Then if you do some of the assembler stuff above then you can start to think about making calls to asm functions or inline assembler, etc, from your iOS programs. How much assembler, your choice. I wouldnt expect to see applications written in assembler for that platform I would instead search for how do I call this assembly code from my ios application or how do I do inline assembly. (dont learn inline assembly until you are good at real assembly).
There is no reason at all to pay for access to a simulator, there are many many arm simulators out there, one in mame, arms armulator in gdb and other places, a number of gameboy advance and nintendo ds simultators, etc, etc, etc. Of course there is qemu-arm. there are more simulators than you probably are willing to take the time to try, i am about 10 years or so into it myself and not tried them all.
learning assembly is not like C or python or java, I will write a minesweeper game to learn this language. You are learning the mechanics of moving the bits around, small steps, not writing usable applications. For example adding two 128 bit numbers using a 16 bit processor is a worthy assembly language project. Multiplying two numbers, any size, with a processor without a multiply instruction, that is another assembler type learning project. yes, I agree you CAN learn those things by calling asm from an iOS application, but if you dont already have the iOS developers kit and know how to write iOS applications, you have a lot of learning to do before you start thinking about assembler.
If I am way off the mark with what you were asking, no problem I will gladly remove this answer...
Even without a code signing cert, I think you should be able to go to the scheme pop-up menu (the right side of it) and choose "iOS Device"
Once you do that, then you can choose any .c or .m (or .cpp or .mm) file in your project, open the assistant editor, and choose "Assembly" from the assistant editor jumpbar. Then you can see your source code and assembly code side by side.
Or you can just go to Product menu and Generate Output -> assembly
You may find it easier to start with C code, where the function calls will be much easier to follow initially than Objective-C method calls.
What you need is an ARM development kit with a Linux-based programming toolkit. You can then install VirtualBox on your Mac, create a Linux virtual machine and install the ARM development tools on the virtual Linux machine. Make sure that when you buy an ARM dev kit, it comes with the ARM cpu, complete dev/test board, USB cables for software transfer/debugging and the complete Linux toolchain. You can find such kits for less than $99.
Another quick introduction to ARM assembly and reverse engineering: http://yurichev.com/writings/RE_for_beginners-en.pdf

SDR kit with 2.4GHz RF frontend?

Do you know a SDR (Software Defined Radio) kit with a 2.4GHz ISM band (2400MHz - 2483.5MHz) transceiver?
I need to perform some software defined radio including customised modulation. Also the price for one kit should be at maximum $1000. I know there are some extremely expensive solutions out there, but that is unfortunately not an option.
Also a low delay from reception to transmission is necessary, thus the GNU Radio + USRP solution is not usable.
Update:
I have taken a closer look at the USRP solution. From previous experience with the USRP + GNU Radio software I initially completely dismissed it as a solution in this case. I did that because I need to implement a packet radio protocol, thus I need precise bit synchronisation between input and output, and I need low delay that would allow me to transmit the next symbol following a received symbol, with a rate of 1000 kBaud.
From experience I know that the GNU Radio framework as default uses streaming chains of blocks, with very little synchronisation between TX and RX. Thus I suspect that using the USRP I would probably have to work directly with libusrp, and avoid most of the GNU Radio software. Am I mistaken in this?
I would suggest taking a look at the GNU Radio (gnuradio.org) SDR toolkit. Several projects (such as this one) have successfully used it for Bluetooth research.
There also exists development hardware designed for use with GNU Radio called the Universal Software Radio Peripheral which, with a suitable daughterboard for 2.4GHz development, costs around $1000.
I'd like to second GNU Radio. Specifically you are looking for the USRP not the USRP2. The USRP2 is still in heavy development(and out of stock) while the USRP is a stable platform for GNU Radio. The USRP motherboard cost $700. The daughterboard transceiver you want is the RX2400(2.4-2.9GHz, TX=50mW). You can find both of these boards at Ettus Research
Update six years later: USRPs come in the sub-1000$ range (B200/B210), they have very strict synchronization (ADC-rate accurate timed commands can control sampling) and coherency. GNU Radio supports these features through the gr-uhd interface.
Describing latency is quite a bit more complex, because it depends much more on how you deal with the data coming from any SDR frontend -- really, frontend latency isn't usually the problem when you try to do your processing on a general purpose OS, which makes no hard real-time guarantees. However, many just "hide" the latencies elegantly by employing timed commands and letting the frontend get the data early enough.
I recommend HackRF One wich is a half-duplex tranceiver form 1MHz to 6GHz and also has huge comunity support but is half the price of USRP.
EDIT
You now also have LimeSDR. It has 2 Rx and 2 Tx MIMO full-duplex channels and it's cheaper than tje HackRF. The only drawback may be the shipping time because at this moment there's no stock so you will have to pre-order.
We have successfully been using a professional development platform from Sundance Multiprocessor Technology (www.sundance.com). They do have some very affordable 2.4GHz/5GHz RF front-end solutions with integrated ADC/DAC and multiple DSP/FPGA processors.
University offers: http://www.sundance.com/docs/mimo_lte_booklet.pdf

Custom robotics for building an auto CD-loading arm

Where would you recommend that I find a company to develop or buy a CD/DVD loading arm similar to: http://www.dextimus.com/
Preferably programmable via USB but if I only can get one with a serial interface that would be fine. Drivers dont matter - I can interface directly with the unit as my situation is very unique.
If you have some experience with electronics, you can give it a shot and build it yourself, like this or this.
I should add that the schematics and the source code are included, and in more details in the first project.
I suppose I might just shorten this by giving a list of resources first:
http://www.embedinc.com/ I trust this company to do good work. Expensive (actually, they are reasonably priced in the design community, but would be considered expensive by most hobbyists and individuals). Not great at people skills, but very very very good at what they do.
You should check out the various microcontroller communities and forums for hobbyists and professionals that can do this. Search for microchip, atmel, msp430, arm, powerpc, etc.
Sparkfun is a supplier to the electronics community - they have great forums where you can post your request, and you'll find people who might do it for fun with only the cost of materials. Might take longer, might not be as 'professional' or well packaged and delivered, but it might be your best low cost option.
There are many electronic design companies that could do this (for instance, I can do this sort of thing).
But there are many questions you haven't answered (and may not have researched) that could prevent success:
Is this patented?
What CD loading/unloading methods are not patented, are out of patent, or otherwise available?
What is your design goal - a one off just for you, or a device that can be built in the hundreds for industrial use, or a device meant for general office workers/consumers that is built in the millions?
Do you realize that this design qould surely cost mroe than simply buying one, if one is all you need?
As an example, assuming you don't need the nice enclosure and don't mind a 'prototype' look, just the mechanicals, electronics, and firmware design (no software on the PC) would likely be 100-250 billable hours for a design firm. At a cheap $90/hr, that's $9k to nearly $25k for one prototype. Add PC software and the nice enclosure, etc and you'll double that.
If you can find a local 'Make' group (techshop, GoTech, or similar) then you might be able to find a hobbyist that is willing to play with this idea for the cost of materials.
But if you define what your goal is, and give us an idea of your resources you may find a better answer.
-Adam
You can create a very nice simple solution using radio control servos. They come in many sizes, but even the small ones have enough torque to move a big arm to move a cd.
The real bonus with servos is that they normally have 180 degrees of rotation and internally have a variable resistor (rheostat) for positioning feedback. Positioning accuracy is normally within 1 degree of rotation which should be fine for a cd loader.
For picking up the CDs, nothing will beat a vacuum. I recommend a small battery powered vacuum cleaner. Funnel the suction into a 1/4 inch pipe. At the other end of the pipe a one inch diameter cup should provide more than enough lift from the small amount of suction.
As for the pile of blank CDs to be burnt, I would advise in moving the pile up rather than an arm down to it. probably having the top blank cd about 1/4 inch higher than the cd tray - By doing this, the arm only needs to rotate in one axis and the vacuum should be enough to suck the cd back out of the tray.
Now, for the electronics. For the servo control I suggest an rs232 serial servo controller. I've used the one from http://www.basicx.com/Products/servo/servo8t.htm as it also gives back torque information from the current draw.
For the low sample rate digital i/o, i suggest (for windows) inpout32.dll which is a dll to give you direct access to the bits of a parallel port. This will allow you to turn on the vacuum at the correct time and possibly sense when cd's have run out. Note that a parallel port can sink more current than it sources so for outputs you should connect to the 5v power line and set the output pin to 0 to turn on the output and 1 to turn it off.
The other nice option, which is very, very simple to interface and very cheap is to get hold of a picaxe from http://www.rev-ed.co.uk/picaxe/. These use a very simple programming language (a BASIC spin off) allowing you to read serial data in and control the servos and digital I/O on one chip. Last time I used one, the language was a bit simple - if statements had to jumped labels, else didn't exist.
If you do use a microcontroller and servos, it is best to use a dual voltage power supply as servos are noisy and can cause the microcontrollers to reset.
As for switching loads such as the vacuum on, you'll need to use a mosfet or (if money is no object) the simpler option, a solid state relay.
All digital inputs you use on the microcontroller should be pulled either to +V or ground with say a 5k resistor so they never float.
I cannot stress how simple and cheap the picaxes are. They have a built in interpreter so although code space is minimal on the small 8 pin units, they are programmable via a simple serial lead.
Good luck. Once you get into automation control, you'll never be able to stop. I'm in the middle of building a 3 axis CNC router so I can cut parts for other projects (I tell my girlfriend it's so she can cut out xmas decorations!).
You might want to contact Aaron Shephard about his Florian project.
I've found that a really easy board to control stepper motors or sorvos are produced by phidgets - the API is incredibly easy, and available for a vast array of platforms.

Resources