HYADFVK195

所属分类:通讯编程
开发工具:Others
文件大小:8KB
下载次数:1
上传日期:2017-12-31 15:29:29
上 传 者fyxto!085627
说明:  提供了一些ADSP-217x或ADSP-218x DSP芯片的编程事例,运行在uC OS-II平台下,

文件列表:
MAKE.BAT (219, 2000-09-06)
includes.h (1214, 2000-07-11)
os_cfg.h (3514, 2000-09-06)
os_cpu.h (2742, 2000-09-06)
example_c.c (4250, 2000-09-06)
os_cpu_c.c (7138, 2000-09-06)
32186.des (164, 2000-07-10)
2example_a.dsp (2229, 2000-09-06)
os_cpu_a.dsp (11608, 2000-09-06)

/******************************************************************************************************** * uC/OS-II * The Real-Time Kernel * ADSP-21xx Specific Code version 1.0 * * By : Jaap de Jong (jdj@nedap.nl) * Nedap Retail Support * Parallelweg 2d * Postbox 102 * 7140 AC Groenlo * Netherlands * Based on 'ADSP-21065L SHARC Specific Code version 1.0' by Bertrand Hurst, Francois Veuve, Cedric Bornand ********************************************************************************************************/ This file contains: 1) "ADSP-21xx Specific Code" package content description 2) Short explanations about the provided files 3) Used resources, software restrictions 4) How to compile and run 5) Common timing and memory usage 6) License agreement 7) Warranty disclaimer ********************************************************************************************************* 1) "ADSP-21xx specific Code" package content description This package contains all the files needed to make uC/OS-II running on an ADSP-217x or ADSP-218x DSP from Analog Devices. There should be 8 files in this package: readme.txt This file 2186.des Architecture file os_cfg.h Config file os_cpu.h Type definition file os_cpu_c.c C functions for the 21xx port os_cpu_a.dsp Assembly functions for the 21xx port example_c.c A small example program, that toggles two lines example_a.dsp Extra functions the example program includes.h Includes file make.bat Build this demo ********************************************************************************************************* 2) Short explanations about the provided files 2.1) File 2186.des Description of the hardware. No further comments. Change this for other 21xx processors. 2.2) File os_cfg.h This code is only suitable for 217x and 218x processors due to the usage of ENA/DIS INTS. 2.3) File os_cpu.h There is not much to tell about that file. It contains the definition of all the types used in the other files, to ensure that the C source code of uC/OS-II may be compiled. Just note that all registers and the memory are 16-bits wide in the 21xx DSPs, so 8-bits types are mapped in 16-bits. 2.4) File os_cpu_c.c This file just contains the OSTaskStkInit function. Some registers must have a special value because the compiler counts on it. Please have a look to the section 3 below, it gives some important information about stack usage. The empty hook functions described in that file are called accordingly to uC/OS-II standard, and may be used for any purpose that you'll find suitable. 2.5) File os_cpu_a.dsp One heavy macro to put (almost) all registers on the stack, and one heavy routine to restore them. Finally, there are four functions, all reasonably straightforward. A special label, named ___lib_tmri_ctrl, pointing at OSTickISR_, is used to get the interruptvectors in its place. This is done by the compiler. This code is suitable for any 21xx processor. 2.6) File example_c.c This file is provided to help compiling a first program. It toggles the PF2 and PF3 outputs at a different rate. Just note in the TaskStart function that the timer_*() functions are called to initialize the DSP timer. 2.7) File example_a.dsp Some simple assembly routines needed to toggle the outputs and a routine to enable timerinterrupts. 2.8) File includes.h No comment. 2.9) File make.bat Just to make it a bit easy... Note the -mno-doloops option for g21.exe. This will disable the generation of DO-UNTILS in the code. Beware: this is only for the compiler, library functions will still contain DO-UNTILS... ********************************************************************************************************* 3) Used resources, software restrictions The only resource used by the OS is the timer. There are some restrictions about the application software. As saving all registers takes a LOT of time (about 60 registers!), some optimizations have been made: the stacks does not contain every registers. Here is the list of the unsaved registers: Registers Meaning... --------- ------------------ I4 Stack ptr, used by C compiler L4 Always 0 IMASK Global use MSTAT Global use STATUS STACK Don't use POP/PUSH STS LOOP regs Since the loopstack can't be read by the processor, there are no DO-UNTIL's allowed. Beware of library functions!! Secondary regs Don't use If you want to use any of these registers, disable interrupts while using them. All these restrictions are also made by the C compiler, so, as long as you don't code anything in assembly, you won't have to worry. WARNING!!! Pay attention to the provided C runtime library!!! It contains assembly functions that may use some of the above registers!!! So be very carefull when using runtime library functions... Here is a list of library functions that use DO-UNTILS: BIQUAD.DSP CALLOC.DSP DEMEAN.DSP DI_DIV.DSP DSI_DIV.DSP FFT.DSP FIR.DSP FIRB.DSP FREE.DSP GSMSH.DSP IIR.DSP LIB_FPDI.DSP MALLOC.DSP MATADD.DSP MATMUL.DSP MATSMLT.DSP MATSUB.DSP MEMCMP.DSP MEMCPY.DSP MEMCPYDP.DSP MEMCPYPD.DSP MEMCPYPP.DSP MEMSET.DSP MFIR.DSP NEW_DIV.DSP PLATT.DSP SIN.DSP STRCAT.DSP STRCMP.DSP STRCPY.DSP STRLEN.DSP STRNCAT.DSP STRNCMP.DSP STRNCPY.DSP ZLATT.DSP Most of them can easily be rewritten... Left as an exercise to the reader... ********************************************************************************************************* 4) How to compile and run All test have been made with ADDS-21XX-SW-PC-v6.1 Just doubleclick make.bat and download the image to your target or use the debugger. ********************************************************************************************************* 5) Common timings and memory usage With all uC/OS-II functions enabled, the generated code takes about 5500 instructions. With a 32 MHz DSP, a task switch takes about 6 to 10 microsecond (think about the huge amount of registers to save!). ********************************************************************************************************* 6) License agreement THE TERMS AND CONDITIONS THAT APPLY TO C/OS-II ALSO APPLY TO THE ADSP-21xx Specific Code. ********************************************************************************************************* 7) Warranty disclaimer YOU USE THIS SOFTWARE AT YOUR OWN RISK. THE AUTHORS WON'T BE LIABLE FOR ANY SPECIAL OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO LOSS OF PROFITS) WHILE USING OR MISUSING THIS SOFTWARE. *********************************** End of file **********************************************************

近期下载者

相关文件


收藏者