Specifications
Adding DSP/BIOS Files to a Project
Developing a DSP/BIOS Program
3-5
5) In the Project View area, right-click on the vectors.asm source file and
choose Remove from project in the pop-up menu. The hardware interrupt
vectors are automatically defined by the DSP/BIOS configuration file.
6) Right-click on the RTS6201.lib library file and remove it from the project.
This library is automatically included by the myhellocfg.cmd file.
7) Double-click on the hello.c program to open it for editing. If the assembly
instructions are shown, choose View
→
Mixed Source/ASM to hide the
assembly code.
8) Change the source file’s contents to the following. (You can copy and
paste this code from c:\ti\c6000\tutorial\hello2\hello.c if you like.) Make
sure you replace the existing main function (which has the puts() function)
with the main shown below, because puts() and LOG_printf use the same
resources.
/* ======== hello.c ======== */
/* DSP/BIOS header files*/
#include <std.h>
#include <log.h>
/* Objects created by the Configuration Tool */
extern far LOG_Obj trace;
/* ======== main ======== */
Void main()
{
LOG_printf(&trace, "hello world!");
/* fall into DSP/BIOS idle loop */
return;
}
9) Notice the following parts of this code:
a) The code includes the std.h and log.h header files. All programs that
use the DSP/BIOS API must include the std.h file and header files for
any modules the program uses. The log.h header file defines the
LOG_Obj structure and declares the API operations in the LOG
module. The std.h file must be included first. The order of the
remaining modules you include is not important.
b) The code then declares the LOG object you created in the
configuration file.
c) Within the main function, this example calls LOG_printf and passes
it the address of the LOG object (&trace) and the hello world
message.
d) Finally main returns, which causes the program to enter the
DSP/BIOS idle loop. Within this loop, DSP/BIOS waits for software