interfacing microcontroller and DSP card

Started by AdamB, December 03, 2007, 08:31:01 AM

Previous topic - Next topic

AdamB

Hi guys,

I have a TIDSK6713 dev. board and a phillips LPC2129 dev. board. Now, I can program each to do whatever I want really as I understand how they work individually, however how would one go about having the LPC2129 interface with the DSK6713 such that the microcontroller can pass variables to the DSP, such that the microcontroller can read in values from potentiometers, send the values to the DSP and the DSP have these values control the parameters of a distortion (or whatever program I'm running)?

Any web links or general info will be useful,

Cheers,
-Adam
[indifferent::engine]
http://www.indifferentengine.com

WLTerry

#1
Hi... this is my first post since I've registered many months ago, I didn't post anything because any question came out to my mind always was solved using the search engine  :icon_wink:

But now it's time to give back to forum members as a little help. I'm currently doing my project to get my EE degree and I'm working with the same c6713 DSK board as a guitar effects processor. I'm use a Microchip's PIC microcontroller to manage and interface the controls and switches to the effects programmed in the DSP, this PIC has a UART serial interface and I thought that it would be a very good idea using that... Luckily, my university's lab has a "daughtercard" which is a dual UART interface designed for TI DSK's and after months of struggling with this junk I finally could make the card work and communicate both the DSK and the PC Hyperterminal as a preliminary testing.

Now I'm trying to make the DSK understand the protocol I designed in the microcontroller's UART because the pots and switches attached to the PIC are sendidng glibberish.... I'll figure it out soon I guess.. With a full time job, an annoying girlfriend, lust for beer and my guitar geeking it's hard work to do in short time  :icon_mrgreen:.

Anyway... one solution is to get a UART daughtercard for DSK's and use the serial port of the microcontroller. The daughtercard is connected in a slot of the DSK, run a demo program and you're done, next you have to figure it out how it works and include this code to your main program, it's easy to understand.

I'm using a daughtercard form Windmill Innovations (a dutch company I guess) but there's another brands out thee I guess. Try looking at the following:

http://www.kanecomputing.co.uk/bf3_rs232.htm
http://www.kanecomputing.co.uk/dspg_uart_exp.htm

I'm using this one:
http://www.traquair.com/products/windmill/tidsk_uart.html

I googled your LPC2129 and looks like it have a UART RS232 port, It would work good enough. Hope you find what you need and hope it helps.

Will

AdamB

Awesome. That's what I'm building now, a guitar digital multifx for my final year dissertation. I've been looking for a daughter card for this 6713 for ages, TI's support is horrific.

So far I've got the DSP running some basic effects and the microcontroller reading in values from pots but yea, it's the bit where they connect together that is the real problem for me, hopefully this is a nudge in the right direction.

I'll try and get one of those daughtercards and let you know how it goes :)

[indifferent::engine]
http://www.indifferentengine.com

WLTerry

Cool ! Serial communication is a good choice, the only thing is the daughtercard is not cheap (US$395). Last weekend I finally tested one pot control and It works OK in a digital Wah I build in a DSP project in this board. It works perfectly with no noise or anything weird, but it was really hard for me (I'm not too smart as I want to be  :icon_redface:).

I build 6 effects: a Delay (max 300ms), Flanger, Chorus, Wah, 3-band EQ and an ugly nasty fuzz which I will exclude from the projet or figure it out how to fix it because I wanted to build a Overdrive, but I couldn't figure it out about oversampling and stuff... I also built a Reverb using the Schroeder algorithm, but this code is anything but optimal (again... I'm not too smart  :icon_redface:)

What effects did you build in your project? Maybe we can help each other with this.

Cheers
Will

AdamB

I'm working on a wah, tube overdrive and a delay at the moment. They delay was pretty straight forward, the wah and overdrive are a bit more tricky. I've not spent much time on it yet as I'm still sorting out my hardware problems, though once I get hold of one of those RS232 cards it'll all be sorted I think.

Yea those daughtercards are pretty steep and they dont give out samples. I suppose myself or the uni will have to buy one.

I'm definantly up for some sharing of information after the xmas period when I've got my hardware together, I was planning on putting all my stuff up on the web as open source any how as when it's finished it may be used as a student project by my uni. Maybe we can work on the overdrive together a bit if your having problems, as I built a pretty solid tube sounding overdrive plugin last year in xCode that I was hoping I could re-work to some degree for this.
[indifferent::engine]
http://www.indifferentengine.com

AdamB

Well I've ordered a RS232 daughtercard, it should be with me shortly. I'll take a look at the example code that it ships with and see what I can do and I'll let you know how I get on.
[indifferent::engine]
http://www.indifferentengine.com

WLTerry

Awesome Adam... now when you get the board you could make it work with the computer via Hyperterminal first. Once you are familiarized with the board, you can start attaching the board to your project and have fun with it.

Please let us know how you get on.
Will

AdamB

OK cool, it should be delievered this week, just waiting on DHL.
[indifferent::engine]
http://www.indifferentengine.com

AdamB

Well I think I've got the hang of the card on the DSP side, I've taken a look around the source for it, I'm working on the microcontroller side now.

So far my dsp is doing a simple cliping distortion, level control and echo so that I've got something simple to use for testing the passing of variables from ucontroller to dsp. hopefully I'll have the microcontroller doing something in the next day or two, then I can concentrate on designing all of this down into a single PCB and programming some decent effects. The source for the DSP is pretty much the same as xCode at the level I've got it to now, so I'm hoping I can just convert alot of the effects code I already have for tube sounding overdrive and filters/wah pedal etc. from there.
[indifferent::engine]
http://www.indifferentengine.com

WLTerry

Adam. Try the level control first, it's easier. I tested with the actual wah Hot Potz last week and it worked nice (it needs a follower with a 1-gain op-amp, for the PIC uC)... but still have lot of work to do with the other controls.

How you have made your tube OD? with downsampling/upsampling?

AdamB

Cool, I've got a level control on the dsp going, i'm working with the rs232 comunication, the hardware is now sending/recieving info but it's just receving junk data rather than the variables I'm sending, so I've goty some work to do.

The tube OD has upsampling/downsampling and has adjustable EQ functions and gain/level controls. I'm hoping to include a tube rolling function to model different tube sounds etc. The code for it is in xcode. however the code on xcode is pretty much identical to the dsp code now, i'm using dsk_app in the copy_data function. I'm going to just convert it over, when its done I'll share some code with you.
[indifferent::engine]
http://www.indifferentengine.com

WLTerry

I'm glad to hear your project is working... at least one control, once you got it work, the rest will be easier. Are you sure your microcontroller needs to receive data from the DSP? Mine is just sending data (from PIC to DSP only)... by the way, it's working perfectly, I have 3 pots to control Chorus/Flanger/3-band EQ/Delay parameters and one additional pot to control the Wah, with pushbuttons I select each effect. Next I should record parameters for two simultaneous effects in 4 banks and select those banks with SPST momentary Stompswitch (got them from Small Bear).

So you'll gonna build an amp modeller, that's really nice... and I'm sure that will be not so hard. By the way thanks for the offer, it will help me a lot. If you need some tips just let me know.

Will

AdamB

Right, so I've got two programs on the DSP, one is audio with level control and one is the RS232 communication working perfectly, the problem I'm having is putting the two together. I'm using the dsk_app audio program and the uart_loopback program modified from the daughtercard CD to just pass single characters from my ucontroller to the DSP. When I try to combine the two programs nothing works, is it something to do with the interupts clashing do you think? Did you have this problem?
[indifferent::engine]
http://www.indifferentengine.com

WLTerry

I had a different problem when I was trying to make the serial com work. That was the polarity of the interrupt of the daughter card and fixed easily in the DSP-BIOS config. Since you have both of your programs working, there's no problem with this interrupt polarity. But maybe you have created a new project from scratch or modified your audio project adding the RS232 stuff and maybe in both cases you have the interrupt polarity wrong. If that's the case, you should do this:

Go to the DSP-BIOS config and you'll find a *.cdb file, double click on that.
Double click in Scheduling.
Right click in HWI and click in Properties
The external interrupt Pin 4 polarity must be high-to-low

If the interrupts are the problem, you must check them. The daughter card uses the HWI_INT4, Check your program if the audio uses a different interrupt. For example, mine use the HWI_INT11. In the DSP-BIOS config, double click in HWI and click in the interrupts you're using if there's interrupt conflict or not.

Maybe this will help you, if you still have problems let me know.