					uC/OS-II, The Real-Time Kernel

						Hitachi SH2 Port

						Read Me File

********************************MCS Compiler*************************************************

1.  The current version of the Hitachi SH2 port is based on:

	MCS SH C		V4.1b
	MCS SH Assembler	V3.1
	MCS SH Linker	V5.3a

2.  The MCS compiler toolchain requires that the environment variables 'SHC_LIB', 'SHC_TMP'
and 'SHC_INC' are intialised with the relevant MCS compiler directory paths.

3.  The example code, in the 'test' directory, was written for and tested using Hitachi's
European low cost evaluation board, EVB7045F, and HDI-M monitor debugging environment.


********************************SH2 Port Notes***********************************************

1.  The files for the SH2 port of UCOS-II should be placed in the UCOS-II 'SOFTWARE' directory.
To install the files create a directory called 'SH2' in the '\SOFTWARE\UCOS-II\' path.  The
zipped file will then create subdirectories 'MCS\SOURCE\' and 'MCS\TEST'.  The overall directory
structure should then be:
\SOFTWARE\UCOS-II\SH2\MCS\SOURCE\
\SOFTWARE\UCOS-II\SH2\MCS\TEST\

The 'SOURCE' directory contains the SH2 specific files:
'OS_CFG.H'
'OS_CPU.H'
'OS_CPU_A.SRC'
'OS_CPU_C.C'

The 'TEST' directory contains this file and a simple demonstration program using the kernel
to flash the EVB7045F user LED at 1Hz.  The file 'TEST.ABS' is the debug file which can be
loaded in to the HDI-M debugger.

2. The test program was written for the Hitachi EVB7045F evaluation board running
the debugger HDI-M.  The HDI-M monitor program occupies internal flash memory
on the SH7045F with the user program running from external 32-bit RAM in area 1.
For this reason the vector base register (VBR) must point to the user vector table
in RAM.  Before the VBR can be changed the vectors used by the HDI-M monitor must
be copied up into the user vector base.  Routines to do this are included in the file
'test.c' but should be removed when building for an non-EVB7045F environment.

The linker memory map has also been modified for use with the EVB7045F and so will need
to be modified when building for an non-EVB7045F environment.

3.  The port has been tested on the EVB7045F evaluation board running HDI-M and so the
SH2 specific files should not need modification.

4.  The port uses the second available trap vector via the 'trapa()' intrinsic function as
the first trap vector is used by HDI-M.  TRAPA(33) vectors 'OsCtxSw()' (see 'OS_CPU_A.SRC').
OS_TASK_SW() is #defined to the MCS compiler intrinsic function 'trapa(UCOS)'.

5.  OS_CRITICAL_METHOD #2 is supported in this port via assembly routines (see 'OS_CPU_A.SRC').
The SH2 microcontroller provides 16 levels of interrupt priority.

6.  The SH7045F compare match timer 0 (CMT0) is used to provide the system clock tick.  The
CMT0 related functions and defines can be found in 'cmt.c'.  The xtal frequency of the EVB7045F
is 29.4912MHz and the compare match timer is set to generate an interrupt every 10ms.

7.  The CCR register is initialised to 0 for every task so each task starts with interrupts
enabled.

8.  Note that only the port is provided and it is assumed that you have the rest of the
source for C/OS-II from the book.

********************************Contact Details********************************************

This port is provided as is and without guarantee.  Although this port has been tested there
is no warranty implied of any kind.

If you have any questions about this port I can be contacted via the Internet at:
i.hall@virgin.net and I will try to help.  If you find this port useful then drop me a lne
and let me know.


********************************Acknowledgements********************************************
MicroC/OS-II The Real-Time Kernal - Jean J. Labrosse, R&D Books, 1999, ISBN 0-87930-543-6
UCOS port for the SH1 - Michael C. Garrett (Available from www.ucos-ii.com).

********************************Hitachi SH2 Port Release Note********************************

June 25th 1999
--------------

1.  First release of the SH2 port.

July 28th 1999
--------------

V1.01

2.  Modified 'OS_CPU_A.SRC' so, in the interrupt routine '_OSTickISR', the code to clear the tick
timer interrupt is called before 'OSTimeTick' is called.

 