Friday, January 06, 2006

2 - RTDX – Real Time Data eXchange (Yahoo Chat)

Aim

To configure and use RTDX – Real Time Data eXchange (Yahoo Chat).

Theory

Compared to PC’s, Digital Signal Processors (DSP’s) are super-efficient when it comes to executing Signal Processing algorithms. Thus they are of immense use in the industry. But when it comes to the simple but essential task of display, the good old PC is miles ahead.

For example, you may run a complex algorithm and get a numerical result, ten times faster on the DSP than the PC. However, you cannot see the calculated value, as the DSP does not provide us any sort of Visual Display Unit (monitor, in simpler terms).

But wait! There is still hope. Texas Instruments DSP provides a mechanism called RTDX which can throw some light (literally!) on this problem. By this method, data is exchanged between the PC and DSP. A two way communication channel is set up. Using that, the result of any complex algorithm as calculated by the ‘super-fast’ but ‘visually disabled’ DSP can be sent to the ‘slow’ but ‘visually able’ PC. This experiment shows just how to do that.

Apparatus / Setup

Texas Instruments DSP – MATLAB & Simulink – Custom application for RTDX (e.g. – “General Purpose Display” provided by T.I.).

Procedure

1. Circuit

We make a simple circuit as shown below. The expected output is the constant 302, but we intend to generate it on the DSP and receive it on the PC screen. Set parameter ‘ochan1’ within the ‘To RTDX’ box.

2. Setup from MATLAB

Build the above circuit from MATLAB Simulink. (Note that you should choose the option ‘Build’ and NOT ‘Build & Run’ from the Simulation Parameters box. This can be accessed by the following steps.

After opening a new file in Simulink, go to the Simulation menu -> Simulation Parameters -> choose Real Time Workshop tab -> in Target Selection area, press Browse -> list of available tabs comes up, select Target for Texas Instruments TMS320C6000 Processor. The Build button should now show Build and Run. (Same procedure as Experiment 1).

Then, within the Category drop-down menu, choose “TI C6000 Runtime-> then choose the Build Action : Build. The Build and Run button should again show Build.

3. Setup from CCS

During the Build process, Code Composer Studio (CCS) opens up. A new project is created and the executable for the above circuit is made. However it is still not loaded and remains on the PC awaiting further instructions.

RTDX has to be enabled next. This has to be done from CCS. Follow following steps to do so.

  • From CCS, go to Tools Menu -> RTDX -> Configuration control
  • Current Settings window opens up
  • Uncheck the Enable RTDX checkbox
  • Press the Configure button
  • RTDX Configuration Control Window pops up
  • Choose RTDX mode : continuous mode
  • Press OK
  • Check the Enable RTDX checkbox

This slideshow illustrates the above process. Zoom in and locate the mouse within these screenshots to view the changes.

Step 1

Step 2

Step 3

Step 4

After enabling RTDX, load the executable onto the DSP from CCS. From File menu -> choose Load Program. Do not execute it yet.

4. External Application Required

At this point, if you run the program on DSP, the value 302 will be generated on DSP and sent to the PC via parallel/ USB port. However we need an application to read the buffer where these sent values are stored. TI provides one such tool – General Purpose Display (GPD). (Search for this app within the folder where CCS is installed on your comp). Within GPD, Select Add Channel and provide the same channel name (ochan1). See Figures below.

Fig. General Purpose Display Program

Fig. Options for Adding Channel

Then run the executable on DSP. Just after that, press the Start button on GPD. You should see some familiar values popping up on screen.

Discussion

Provided everything ran successfully before, you can try other variations of the previous program.

For example, you may log the values of the DSP's digital clock using RTDX like in Fig. below.

22 comments:

Anonymous said...

Hi,

I am a begineer in Matlab an CSS. I tried to follow your tutorial, but I faced a problem during did the configuration setting in Matlab. I uses Matlab 7.0.
" There are unapplied changes in the Configuration parameter dialog".

- Cannot be used variable-step solver....
- Error using ==> RTW.makertw.make_rtw
- Error using ==> RTW.makertw.LocMapSolverToTargetType
- Error using ==> slbuild

would you inform me the solution, please?

I have a task to send the stream of characters from matlab to CCS and viseversa.
I don't have any idea to do this.

Thank you very much,

tatahd

kriti said...

hi tatahd

one suggestion, u will find a choice in the "Configuration parameter dialog".. where u can choose Fixed-Step Solver instead of Variable Step Solver.. choose that and try again....

unfortunately, i cannot supply u with the exact solution... this is because i have not worked with MATLAB 7... in fact i worked on Matlab6.5 ... the screenshot on my site is of Version7 (Ver7)... because i had heard that my juniors in IIT Kgp were working on Ver7, so i thought i should give an updated screenshot... later i heard that my juniors faced problems interfacing CCS with Ver7... i wonder whether they faced similar problems...

but on second thoughts, Ver7 should be more upgraded.. hopefully, there must be some options that u r not choosing properly.. and after choosing them properly, u will be able to proceed smoothly with ur work.. all these version changes do create an initial blockage... but overcoming these is a major part of the work of us engineers, right??

Anonymous said...

Dear Kriti,

Thank you very much for your explanation. This blog is very useful. Now, I'm trying to get previous version (V_6.5)to see what happen.
Actually, I would like to send some characters (less or more 128-bit) to my CCS to be processed in advance. I have a difficulty how to manage the characters to be sent through the RTDX channel. I mean, how to make a dialog box to get some charachters were typed by user using keyboard and then I send them to CCS in character data type (not integer). Do you have some experiences on this matter?
Well, thank you very much in advance.

Josema said...

It's really good what you do helping us...

But I am still unable to even use the RTDX in a simulation (We don't have a board, so we have to do everything in a simulation inside the PC)

Is there any special consideration to have taken in account=??

kriti said...

I have never ran RTDX in simulation... in fact, I am doubtful whether RTDX can be simulated since it's sole purpose is to interact with the hardware (board)

Anonymous said...

Hey I am geting a value 16368 when I run ocnstant 1 example you have mentioned......wt is 16368?

kriti said...

@akash

is the value of 16368 coming for any value that you put as a constant?

check with a few numbers in the Constant block, and note the outputs that you get for each input... see if you can find a trend...

keep me updated. and best of luck.

Unknown said...

Hello Kriti,

thanks for the reply.

No, it is not coming for any value. It is just coming for'1'. For 2:16384, 3:16392, 4:16400, 5:16404, 6:16408, 7:16412, 8:16416, 9:16418, 10:16420, 11:16422, 12:16424, 13:16426,14:16428,17:16433, 18:16435,19:16436,20:16437.

Although it looks to be linear but it is not......the later values differ just by 1.....I am unable to find any trend in this by which I can predict any value.
I also wanted to know that when you ran your 1 constant experiment what did u c at GPD?

Thanks
AKash

Unknown said...

Hello Kriti,

I am facing another problem. When I run the RTDX in the continious mode, after a while I get an error :

RTDX Detected error : Host Buffers are full. Incoming data has been lost.

I just want to know that how do you drain the host buffers once you have seen the output in the GPD?

Looking forward for ur reply

Thanks

Akash

kriti said...

@Akash

Sorry I do not seem to recall any such error. Thus I cannot give you any solution off the cuff.

I would suggest reading the RTDX help manual as a possible source of information. Also you may google on key-phrases like "RTDX error" etc.

Best of luck with the work.

Anonymous said...

i'm programming TMS320F2808 with simulink and i need to edit parameters during simulation without halt program.how cn i do this???

kriti said...

@Anonymous:

I do not know of any method to change parameters while running a program on the board. I did this work for my BTech project (4 years ago) and I needed to tabulate results for various parameter configurations - and for this I went the laborious way i.e. change parameters in SIMULINK file, build the program, load the program on the board and then run the board... again and again...

That was what I did. But you might be able to find a more elegant method. Best of luck with your work and I would be glad to know how you did your work.

Anonymous said...

OK thank you so much
about visualisation i tried this methode and it' worked but the problem is that the value encoding in 16-bits forme, and i dont know if it's possible to get them in decimal mode (1-2..9)
of course, if i know how to change parameters during simulation i well tell every one... hope me good chance.

kriti said...

@Anonymous

Having values in any format should not bother you much.. You would be getting the same output nevertheless. Only interpretation would differ.

Anyway, best of luck with your work.

Unknown said...

hey
i have a c2000 dsp card
can i use this tutorial even thoguh it's for c6000?

kriti said...

@roger:
Sorry I cannot answer your question. I have not been using these cards for 4 years now and I do not know the differences between C2000 and C6000. However some of the concepts explained here hold true for all DSP-s e.g. the concept of Real time data exchange (though the actual software might have changed). And the exercises described here (lighting up LED, number game) are good to understand the working of DSP-s.

Hope you are able to figure out a solution soon. If you find a good resource, you are welcome to share the link here.

Thanks.

sergio said...

hello kirti i want to know what is actually the function of to rtdx and from rtdx block in simulink???
help me

kriti said...

@sergio:
RTDX is Real Time Data Exchange.

To RTDX sends data from DSP board -> PC.

From RTDX sends data from PC->DSP board.

You need to run some software on the PC to capture and interpret the data sent by DSP board. Right now I do not remember the software I used but best source that I can provide are the tutorials on this blog itself.

Marco said...

Hellow, i would like to know if you can send me the post, because i can't view the images, it doesn't appear in the post.

My e-mail es marcodifeo1@hotmail.com.

Tanks you!!

Anonymous said...

Hi all,

I am a beginner in Matlab and CCS. I am using Matlab 2012a and CCS v3.3. When I try to run a program with RTDX, I am getting an error. The error is:

Error using Link.ccs/OpenRtdxChannel
Error opening the RTDX channel.


Please help me go through with this error.

Thanks in advance

Manideep

kriti said...

@Manideep:
Sorry but I have not been using these instruments for a while, so I would not be able to help you with your query. Best of luck anyway.

Unknown said...

first, thank you much...

but what is RTDX General Purpose Display (GPD) application ? and how to get it ?

thank you

Your Sincerely,

Hakeem