<< Chapter < Page
  Ti dsp/bios lab   Page 1 / 1
Chapter >> Page >
This module is a lab assignment to better understand the TI DSP/BIOS QUE module.


This lab module will help you become familiar with the TI DSP/BIOS v5.x QUE module. Code Composer Studio v4 is used in this module.


  • SPRU423 TMS320 DSP/BIOS Users Guide: Read the section title Queues

Lab module prerequisites

This lab module uses aspects of the TSK and SEM modules.


Part 1

  • In this part you will be creating two TSKs were one will generate some data and send it to the other TSK in a queue. The transmitting TSK will generate 5 messages to send to the receiving TSK which will print out the content of the message.
  • Follow the procedure in Code Composer Studio v4 DSP/BIOS Project to create a new CCS DSP/BIOS project. Your project should have a DSP/BIOS v5.x configuration file using the ti.platforms.sim67xx template (or another appropriate template).
  • Create a LOG object by right clicking on Instrumentation->LOG and selecting Insert LOG. Change the name to trace . Set its properties to have a length of 512 and be a fixed buffer.
  • Change the LOG_system object to have a length of 512.
  • If using the simulator then change the RTDX interface to Simulator by right clicking on Input/Output->RTDX and bringing up the properties. Change the RTDX mode to Simulator. If you do not do this then when you load your program you will see the error RTDX application does not match emulation protocol . If you are loading onto an EVM or DSK you leave the setting on JTAG.
  • Create a QUE object by right clicking on Syncronization->QUE and selecting Insert QUE. This will create a queue called QUE0 . There are no properties to set (unless you want to change the comment).
  • Create two TSKs with the following properties
  • Name: TSK0 , priority: 1, function: _funTSK0 .
  • Name: TSK1 , priority: 1, function: _funTSK1 .
  • On the priority list make sure that TSK0 is first.
  • Create a main.c file and include a main function that does nothing.
  • At the top of main.c make a global structure for your message as follows:
typedef struct MsgObj { QUE_Elem elem; /* first field for QUE */Int val; /* message value */ } MsgObj, *Msg;
  • In the main.c file make functions for your TSKs, funTSK0 and funTSK1 .
  • In funTSK0 , which will generate the data, create a loop that will loop 5 times and in the loop have it:
  1. Allocate memory for a new message
  2. Fill the message value with the message number. Use a command like: "msg->val = ..."
  3. Print to the trace LOG which message is being generated
  4. Put the message on the queue QUE0
  • In funTSK1 , which will receive the data, create a loop that will loop 5 times and in the loop have it:
  1. Check to see if there is a message on the queue and if not then print an error message to the trace LOG and return . This will cause the task to be done running and enter the terminated state.
  2. Get the message from the queue QUE0
  3. Print which message number was read
  4. Free the buffer that was used for the message
  • Start the debug session.
  • Open the log view by selecting Tools->RTA->Printf Logs .
  • Run the program and record the results.
  • Describe in detail the processing that is occurring.

Part 2

  • Change the priority of TSK1 to 2.
  • Start the debug session.
  • Run the program and record the results.
  • How does the execution change? Describe in detail.

Part 3

  • In this part you will be adding a semaphore to synchronize the two tasks using the queue. The semaphore will keep track of how many messages are in the queue.
Setup for Part 3
  • Copy the main.c file from above to a new file main3.c . Remove the main.c from your project and add main3.c .
  • Add a semaphore to your configuration file and call it QUE0_SEM . It should be initialized to 0.
  • Keep the priority of TSK0 set to 1 and TSK1 set to 2.
  • In main3.c change the following:
  1. In funTSK0 after the QUE_put add a SEM_post for QUE0_SEM .
  2. In funTSK1 delete the code that checks to see if there is a message on the queue and replace it with a SEM_pend for QUE0_SEM . Use SYS_FOREVER for the timeout on the pend.
  • Start the debug session.
  • Run the program and record the results.
  • Describe in detail the processing that is occurring.

Part 4

  • Notice that in Part 3 that if the program ran for a long time that the code would have to continually allocate memory for a message and then de-allocate it when it was done using the message. This could take up a substantial amount of time and could cause fragmentation of the memory space. A better method is to have two queues where one queue holds messages that are free and one holds messages that contain data being transmitted from one task to another. In this part you will be adding another queue which will be initialized by adding some free messages to it. Also, another semaphore will be added to track the number of free messages on the free queue.
Setup for Part 4 with a free message queue
  • Copy the main3.c file from above to a new file main4.c . Remove the main3.c from your project and add main4.c .
  • Add another semaphore to your configuration file and call it QUE_Free_SEM . It should be initialized to 0.
  • Create a QUE object and call it QUE_Free .
  • Change the priority of TSK1 to 1 and make sure TSK0 is first in the list.
  • To the main function add code that loops 3 times and adds 3 messages to the queue QUE_Free . You will need to allocate memory for the messages. Be sure to post to QUE_Free_SEM after adding the message to the queue. This will set up the free messages to be used in the program. These messages can then be used and reused without having to allocate and free memory over and over again.
  • In the function funTSK0 delete the code that allocates a message and replace it will code that pends on QUE_Free_SEM and then gets a message from QUE_Free .
  • In the function funTSK1 delete the code that frees the message buffer and replace it will code that puts the message on QUE_Free and then posts to QUE_Free_SEM .
  • Start the debug session.
  • Run the program and record the results.
  • Describe in detail the processing that is occurring.

Questions & Answers

can someone help me with some logarithmic and exponential equations.
Jeffrey Reply
sure. what is your question?
okay, so you have 6 raised to the power of 2. what is that part of your answer
I don't understand what the A with approx sign and the boxed x mean
it think it's written 20/(X-6)^2 so it's 20 divided by X-6 squared
I'm not sure why it wrote it the other way
I got X =-6
ok. so take the square root of both sides, now you have plus or minus the square root of 20= x-6
oops. ignore that.
so you not have an equal sign anywhere in the original equation?
Commplementary angles
Idrissa Reply
im all ears I need to learn
right! what he said ⤴⤴⤴
what is a good calculator for all algebra; would a Casio fx 260 work with all algebra equations? please name the cheapest, thanks.
Kevin Reply
a perfect square v²+2v+_
Dearan Reply
kkk nice
Abdirahman Reply
algebra 2 Inequalities:If equation 2 = 0 it is an open set?
Kim Reply
or infinite solutions?
The answer is neither. The function, 2 = 0 cannot exist. Hence, the function is undefined.
Embra Reply
if |A| not equal to 0 and order of A is n prove that adj (adj A = |A|
Nancy Reply
rolling four fair dice and getting an even number an all four dice
ramon Reply
Kristine 2*2*2=8
Bridget Reply
Differences Between Laspeyres and Paasche Indices
Emedobi Reply
No. 7x -4y is simplified from 4x + (3y + 3x) -7y
Mary Reply
is it 3×y ?
Joan Reply
J, combine like terms 7x-4y
Bridget Reply
im not good at math so would this help me
Rachael Reply
I'm not good at math so would you help me
what is the problem that i will help you to self with?
how do you translate this in Algebraic Expressions
linda Reply
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
Crystal Reply
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Chris Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
many many of nanotubes
what is the k.e before it land
what is the function of carbon nanotubes?
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
what is system testing
what is the application of nanotechnology?
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
anybody can imagine what will be happen after 100 years from now in nano tech world
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
silver nanoparticles could handle the job?
not now but maybe in future only AgNP maybe any other nanomaterials
can nanotechnology change the direction of the face of the world
Prasenjit Reply
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
Ali Reply
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
bamidele Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Ti dsp/bios lab. OpenStax CNX. Sep 03, 2013 Download for free at http://cnx.org/content/col11265/1.8
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ti dsp/bios lab' conversation and receive update notifications?