All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations. Microsoft is a registered trademark and Windows and Windows NT are trademarks of Microsoft Corporation. IBM is a registered trademark of International Business Machines Corporation. Cautions This document may be, wholly or partially, subject to change without notice.
HTEB1 User manual 1 Overview 1.1 System Development Kit content Thank you for purchasing our product. If you take care on the different hints in this manual you will have great success in software development with this microcontroller. Please refer to the documents listed in appendix. The System Development Kit contains the following parts: Evaluation-Board HTEB1...
HTEB1 User manual 1.3 Features • Contains H8/3664F microcontroller • In-Circuit serial Flash programming • All resources available for evaluation • All pins routed to connectors • 9.8304 MHz main crystal • 32.768 kHz sub crystal • UART interface with MAX232 level converter and SubD-9 (female) connector •...
HTEB1 User manual 1.5 Jumpers and switches JP1 is used for switching the serial interface from 1:1 to crossed connection. If you connect a 1:1 cable (like the cable that comes with the kit) use the default setting. If you connect a crossed cable set the jumper to alternate setting.
Page 8
HTEB1 User manual S_PROG/RUN switches between RUN- and PROG(PROGRAMMING) mode. KEY_1 (T1) to KEY_4 (T4) are user keys. RESET_KEY (T7) is for reset. Orientation Operation LEFT PROG(programming) mode RIGHT RUN mode Main crystal (Q1) can be changed to another frequency. Therefore a crystal socket is provided. Please refer to the microcontroller hardware documentation for recommended devices.
HTEB1 User manual 1.7 Start-Up instructions 1.7.1 Installing the HTEB1 Installing the HTEB1 requires a power supply and a serial connection to a host computer (common PC). The serial communications cable for connecting the HTEB1 to a host computer is supplied and has 1:1 connectivity.
Page 13
HTEB1 User manual 1.7.3 Test program The HTEB1 is supplied with a short demo application when delivered. If you power up the eval-board for the first time, you will see a start up message and some LEDs lighting. If no message appear, please set the switch “Prog/Run” to “Run-Mode” (right position) and power up the board or, if already done, press the reset-button.
HTEB1 User manual 1.7.4 Software Installation Software development on embesso-HTEB1 requires some software tools to be installed on your PC. All tools can be found on CD-R. Some of them must be installed separately. Please refer on installation / setup requirements.
HTEB1 User manual 2 Development Environment 2.1 Creating a program using IAR-EWH8 Software development can be done with a integrated embedded workbench like IAR-EWH8. This software contains an editor, some tools for organization and a tool chain for compiling, assembling and linking programs.
Page 16
HTEB1 User manual Press OK and a file window will appear. Here first create a new directory (e.g. c:\MyTinyTest) and type the project filename “MyTinyTest”. After that click CREATE. Now a new project is created and we must do some settings. In the window select under targets: “RELEASE”.
Page 17
HTEB1 User manual Now select release with the right mouse button. A popup appears. Select Options… and do the following settings: In selection ICCH8/List select the List file box. In section XLINK/Output select under Format “motorola” as the output format. Issue 0.2 Page 17 07/2002...
Page 18
HTEB1 User manual On the CD-R you will find a file called “hteb1.xcl”. That file must be used as the xlink input file. Please copy it to your target directory and select in section Input/XCL file name the file hteb1.xcl. Issue 0.2 Page 18 07/2002...
Page 19
HTEB1 User manual All other options can be changed later. Click on OK. Now select File/new/source file and type in the following program: /* MyTinyTest */ #include "ioh83664.h" void main(void) unsigned int x=0; unsigned char c=0; PCR8 = 0xff; PDR8 = c; while (1) while (--x);...
Page 20
HTEB1 User manual After that save it under MyTinyTest.c Now we must add this file to our project. Please select Project/Files and add the file MyTinyTest.c. Issue 0.2 Page 20 07/2002...
Page 21
HTEB1 User manual After that click on DONE. Now you can select Projet/Build ALL (or F9) and all files are compiled and linked. The message window shows if your project is error free or if there are any errors. Issue 0.2 Page 21 07/2002...
Page 22
HTEB1 User manual The target file for download can be found in directory c:\mytinytest\release\exe\mytinytest.a37. Please see chapter “FDT” for information about downloading this file to target system. Issue 0.2 Page 22 07/2002...
HTEB1 User manual 2.2 Download the code using FDT After compiling and linking (error free!), the target code (mytinytest.mot) should be downloaded to target board. Therefore we use a freeware tool from HMSE : FDT. Even FDT must be prepared for a new workspace. Issue 0.2 Page 23 07/2002...
Page 24
HTEB1 User manual Please start FDT and select „New Workspace“. Here we use the project name “MyTinyTest”. You can choose a location for all workspace files. Select on subdirectory from „MyTinyTest“. Click ok and a further window will appear: Select „Yes“ Issue 0.2 Page 24 07/2002...
Page 25
HTEB1 User manual First time users should use the wizard! Fill in the following things: Issue 0.2 Page 25 07/2002...
Page 26
HTEB1 User manual Issue 0.2 Page 26 07/2002...
Page 27
HTEB1 User manual Issue 0.2 Page 27 07/2002...
Page 28
HTEB1 User manual Now a workspace is created and you can add your target file to „TargetFiles“: Select Project/Add new files to project… and search for file: c:\hew2\mytinytest\mytinytest\release\mytinytest.mot. Issue 0.2 Page 28 07/2002...
Page 29
HTEB1 User manual Now make a double click on \targetfiles\mytinytest and the file content of mytinytest.mot will appear in hex format in the right window. First press the reset button at the target board, hold it down and move Prog/Run-switch to prog position (left). After that release the reset button. With Image/Download image (Ctrl-P) you one can start the connection setup to target board and start downloading image file.
Page 30
HTEB1 User manual Now you can do some additional functions in HEW. After compiling and linking only go to FDT, update your download file with the command Freshen all Target files (Ctrl-T), reconnect the link and repeat the download process. Issue 0.2 Page 30 07/2002...
HTEB1 User manual 3 Examples HTEB1 is provided with some demonstration code. On the supplied CD-R you should find a complete prepared workspace for IAR-EWH8. \examples\demoapp\demoapp.prj Please copy the complete directory to your hard disk in a directory c:\H8TinyIAR, so you will finally have the following directory (per example) “c:\H8TinyIAR\examples\demoapp\”...
HTEB1 User manual 3.1 Key’s and LED’s The first demo program shows the usage of LEDs and keys on HTEB1. For time-controlling we use TIMER_A as an periodic interval timer. The interrupt service routine (isr) is checking the state of the keys, actualising the LED port and reading out the AD1-channel to determine the running light speed.
Page 34
HTEB1 User manual if (LED_Speed) LED_Speed--; if (!LED_Speed) LED_Speed = LED_SPEED_INIT; if (LED_Run) if (LED_Dir) LED_Out >>= 1; if (!LED_Out) LED_Out = 0x80; // if empty, set to 0x80 else LED_Out <<= 1; if (!LED_Out) LED_Out = 0x01; // if empty, set to 0x01 PDR8 = ~LED_Out;...
Page 35
HTEB1 User manual RunningLightInit(); Timer_A_Init(); while(1); Issue 0.2 // Init key's and LEDs // init & start timer_A // just wait ... Page 35 07/2002...
HTEB1 User manual 3.2 LCD One of the highlights of the HTEB1 is the 2*16 character LCD with backlight. Simple functions are provided here to demonstrate the usage of the LCD. Please refer to the LCD manual for further information (e.g. commands, other character sets etc.).
HTEB1 User manual 3.3 SCI SCI is used here for a simple RS232 (V24) terminal connection. Please use a terminal program like HyperTerm (included in Windows), select Baudrate 9600 Baud, 8 Databits, No Parity and 1 Stopbit (8N1). After connection and setup, hit some keys and you will see a message responding on every keycode sent.
Page 40
HTEB1 User manual return TRUE; return FALSE; u8 V24PutChar(u8 c) if (IS_SCI_TX_FREE) TDR = c; return TRUE; return FALSE; u8 V24Write(u8 *s) while (*s != 0) if (V24PutChar(*s) == TRUE) s++; return TRUE; u8 V24WriteLn(u8 *s) u8 ret = FALSE; = V24Write(s);...
HTEB1 User manual 3.4 A/D + PWM This sample shows the usage of the A/D converter. We sample the voltage of P1/P2, filter it and show the result on the LCD. On D/A-Con you will see a reversed voltage at P2 – built with a RC-filter from TOW (P76). /*------------------------------------------------------------------ ** AD_PWM Demo shows some funcions of the A/D converter ** and the use of PWM (= inverse output from P2) at D/A-Con...
HTEB1 User manual 3.5 AT-Keyboard-Interface This demo shows the usage of the PS2 (mini-DIN) interface on HTEB1. Please connect an AT-keyboard (MF102) to this port. You will see the keycodes, provided by the keyboard on the LCD. Please refer to the code table for keycode translation in your own projects.
Page 49
HTEB1 User manual Main- Scan-Code Keypad Set 1 Make-Code <-(Backspace) ->| (Tab) Return CAPS-Lock left Shift < right Shift Ctrl Left Win Space AltGr Strg+Alt Right Win Menu Issue 0.2 Scan-Code Set 2 Break- Break- Make-Code Code Code F0-0E F0-16 F0-1E F0-26 F0-25...
Page 50
HTEB1 User manual Function- Scan-Code and other Set 1 keys Make- Code E0-2A- Print E0-37 Scroll E1-1D- Pause 45-E1- 9D-C5 E0-52 E0-53 Pos1 E0-47 E0-4F PgUp E0-49 PgDn E0-51 Arrow left E0-4B Arrow up E0-48 Arrow down E0-50 Arrow right E0-4D Issue 0.2 Scan-Code...