Download DSP56KCC User's Manual
Transcript
The section v_bles contains the global variables which are set up in the C program in addition to data (control parameters) which are only utilized in the assembly program to perform the special effects digital signal processing. The C programs are provided in this appendix as an example of C programming techniques; the special effects assembly language routines are not needed to meet the intent of this appendix. The file var.asm on page F-38 contains the section v_bles. Notice that some of the variables are assigned to the same location. This multiple label of an address assignment is sometimes very helpful in the mixed language environment. For example, the label F_GAIN and VOLUME point to the same memory location. The label F_GAIN creates the C variable _GAIN for a C array. The subsequent variables STG_1G, STG_2G, and STG_3G can be accessed through the C array _GAIN[]. In assembly language the variables VOLUME, STG_1G, STG_2G, and STG_3G can be used directly while _GAIN[0], _GAIN[1], _GAIN[2], and _GAIN[3] are used to set up the same data in the C program (the function init_project() on page F-16). The special effects system contains a user-friendly menu (see page F-17) which can be used to program the parameter setups. A dumb terminal, e.g., a WYSE-60 sends and receives characters through an RS-232 port interfaced to the SCI of DSP56000 family processor. The C programs io_sci.c, io_scrn.c, io_host.c, io_atoi.c, and io_ctype.c on page F-25 through page F-35 are the low-level drivers to interface the standard I/O functions to the SCI. A makefile is provided on page F-4 to show a common tool which can be utilized for a complex computer software development project. The make utility is available both in UNIX and IBM-PC environments and it can be very helpful to organize programs. Through this tool, any modified files are recompiled or reassembled automatically with specific options. Notice that the program g56k is used for compilation, assembly, and linking of the source or link files. The option -ffixed-r7 on page F-4 is intended to facilitate the use of the fast interrupt facility of the DSP56000 family processors. This register, r7, is used for servicing fast interrupts, SCI interrupts in this example. The program vectors.asm on page F-41 shows the fast interrupt vectors of the routines which utilize the register r7. The option -mx-memory on page F-4 allows the C program to access the DSP56000 family peripheral control and status registers which are located in the upper 64 locations of on-chip X memory space. As an example, the function init_sci() on page F-15 uses this feature to initialize the SCI Clock Register and SCI Control Register. Notice that the variables sci, ssi, ports, A_control, and int_priority are set by referencing these X memory locations (see global.h and the main function on page F-11 and page F-14, respectively). F-2 DSP56KCC User’s Manual MOTOROLA