Hitachi Network Adapter H8 User Manual

Lowcost evaluation board

Quick Links

HTEB1

User manual

Hitachi
H8/Tiny 3664F
LowCost
Evaluation Board
User Manual
Issue 0.2
Page 1
07/2002
Table of Contents
loading

Summary of Contents for Hitachi Network Adapter H8

  • Page 1: User Manual

    HTEB1 User manual Hitachi H8/Tiny 3664F LowCost Evaluation Board User Manual Issue 0.2 Page 1 07/2002...
  • Page 2: Preface

    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.
  • Page 3: Table Of Contents

    HTEB1 User manual Table of Contents PREFACE ... 2 Table of Contents ... 3 1 Overview ... 4 1.1 System Development Kit content... 4 1.2 Hardware description ... 4 1.3 Features... 5 1.4 Board overview ... 6 1.5 Jumpers and switches ... 7 1.6 Connectors ...
  • Page 4: Overview

    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...
  • Page 5: Features

    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 •...
  • Page 6: Board Overview

    HTEB1 User manual 1.4 Board overview 2*16 char LCD with LED backlight 8 user LEDs DA connector RS232 connector SubD0 female Power 7,5 V- 9V DC Figure 1 Board overview Issue 0.2 4 user keys Reset button Page 6 Ext.-LCD connector Contrast connector...
  • Page 7: Jumpers And Switches

    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.
  • Page 9: Connectors

    HTEB1 User manual 1.6 Connectors X1, Serial communication, SubD-9 female X2, Power connector, for cable connection X4, MiniDIN (PS2) X2, Pin Operation DC power supply, 7,5 – 9 VDC, approx. 180mA with LED backlight X1 (SubD9), Pin Operation (DTR,DSR, DTS) n.c.
  • Page 10 HTEB1 User manual OnBoard LCD (IC4) X3, external LCD-connector (057-016-1) X5, E10T debug connector (Sys-Con) LCD Modul X3 (LCD-CON) (IC4) pin (057-016-1) X5 (SYS-CON), µC-pin /NMI /RESET 2,4,6,10,12,14 n.c. Issue 0.2 µC- Operation contrast (=P3) RS (register select) R/W (read / write) EN (enable) Backlight + Operation...
  • Page 11 HTEB1 User manual SV1,SV2, SV3,SV4 connectors with microcontroller signals Operation PIN n.c. n.c. 17,18 Vcc 17,18 Vcc Issue 0.2 Operation PIN Operation PIN n.c. n.c. n.c. n.c. /NMI 17,18 Vcc Page 11 Operation n.c. n.c. n.c. n.c. n.c. n.c. n.c. n.c.
  • Page 12: Start-Up Instructions

    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.
  • Page 14: Software Installation

    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.
  • Page 15: Development Environment

    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...
  • Page 23: Download The Code Using Fdt

    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...
  • Page 31: Workflow

    HTEB1 User manual 2.3 Workflow Issue 0.2 Page 31 07/2002...
  • Page 32: Examples

    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\”...
  • Page 33: Key's And Led's

    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...
  • Page 36: Lcd

    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.).
  • Page 37 HTEB1 User manual u8 LCDReadStatus(void) u8 status; CLEAR_LCD_RS; SET_LCD_RW; LCD_DATA_CTRL = LCD_IN; SET_LCD_EN; status = LCD_DATA_PORT; CLEAR_LCD_EN; LCD_DATA_CTRL = LCD_OUT; return status; void LCDInit(void) u16 cnt=0; CLEAR_LCD_RS; CLEAR_LCD_RW; CLEAR_LCD_EN; PCR7 |= 0x30; PCR2 |= 0x01; LCD_DATA_CTRL = LCD_OUT; LCDWriteCmd(0x38); // 8Bit-IF, 2 Lines, 5x7 character font while(--cnt);...
  • Page 38 HTEB1 User manual void LCDLoopMsg(void) while(1) LCDWriteLine(0,&Text1[0]); LCDWriteLine(1,&Text2[0]); Delay(); LCDWriteLine(0,&Text3[0]); LCDWriteLine(1,&Text4[0]); Delay(); LCDWriteLine(0,&Text4[0]); LCDWriteLine(1,&Text5[0]); Delay(); void main(void) LCDInit(); LCDLoopMsg(); Issue 0.2 // do forever... // display msgs // init ports and LCD // go to LoopMsg Page 38 07/2002...
  • Page 39: Sci

    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);...
  • Page 41: A/D + Pwm

    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...
  • Page 42 HTEB1 User manual LCD_DATA_CTRL = LCD_IN; SET_LCD_EN; status = LCD_DATA_PORT; CLEAR_LCD_EN; LCD_DATA_CTRL = LCD_OUT; return status; void LCDInit(void) u16 cnt=0; CLEAR_LCD_RS; CLEAR_LCD_RW; CLEAR_LCD_EN; PCR7 |= 0x30; PCR2 |= 0x01; LCD_DATA_CTRL = LCD_OUT; // required 3 times pls. ref. data sheet LCDWriteCmd(0x38);...
  • Page 43 HTEB1 User manual u8 *data, *text, c,d; if (line==0) text = &Line0[0]; else text = &Line1[0]; data = text+14; d=3; while (d) *data = '0'; c = code & 0x000f; if (c) if (c < 10) *data = '0'+c; else *data = 'A'+c-10; data--;...
  • Page 44: At-Keyboard-Interface

    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 45 HTEB1 User manual SET_LCD_RW; LCD_DATA_CTRL = LCD_IN; SET_LCD_EN; status = LCD_DATA_PORT; CLEAR_LCD_EN; LCD_DATA_CTRL = LCD_OUT; return status; void LCDInit(void) u16 cnt=0; CLEAR_LCD_RS; CLEAR_LCD_RW; CLEAR_LCD_EN; PCR7 |= 0x30; PCR2 |= 0x01; LCD_DATA_CTRL = LCD_OUT; // required 3 times pls. ref. data sheet LCDWriteCmd(0x38);...
  • Page 46 HTEB1 User manual if (data & mask) pcnt++; mask >>= 1; if ((pcnt & 0x01) ^ (data & 0x0100)) return TRUE; return FALSE; interrupt [IRQ_2] void IRQ_2_Isr(void) static u8 cnt; static u16 val; if (outact) /* do some output? */ if (outval &...
  • Page 47 HTEB1 User manual keyReadIndex++; if (keyReadIndex >= cKeyBufSize) keyReadIndex = 0; return KeyCode; u8 buffer[17] = " KeyCode : 0000 \0"; // convert int to ASCII-HEX void ShowCode(u16 code) u8 *data, c; data = &buffer[14]; while (code) *data = '0'; c = code &...
  • Page 48 HTEB1 User manual Tables : Scan-Codes MFII-Keyboard Numeric Scan-Code Keypad Make- Code E0-35 Enter E0-1C Issue 0.2 Scan-Code Set 1 Set 2 Break- Make- Break- Code Code Code F0-77 F0-6C F0-6B F0-69 E0-B5 E0-4A E0-F0-4A F0-75 F0-73 F0-72 F0-70 F0-7C F0-7D F0-74 F0-7A...
  • 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...
  • Page 51: Appendix A: Cd-R Content

    HTEB1 User manual Appendix A: CD-R content Programs IAR-EWH8 \programs\iar\ FDT (flash development toolkit) \programs\fdt\ Examples \examples\demoapp\ Demo \examples\flashdemo\ Datasheets Tiny Hitachi H8/3664F hardware manual, H8 programming manual, Tiny Application notes, LCD-Module, \datasheets\ Documentation This manual as pdf \documentation\ HTEB1 board schematic \documentation\schematic\ Issue 0.2 Page 51...
  • Page 52: Appendix B: Schematic

    HTEB1 User manual Appendix B: Schematic Issue 0.2 Page 52 07/2002...
  • Page 53: Appendix C: Board Layout

    HTEB1 User manual Appendix C: Board layout Issue 0.2 Page 53 07/2002...
  • Page 54 HTEB1 User manual NOTES Issue 0.2 Page 54 07/2002...
  • Page 55 HTEB1 User manual NOTES Issue 0.2 Page 55 07/2002...
  • Page 56 HTEB1 User manual Issue 0.2 Page 56 07/2002...

This manual is also suitable for:

H8/tiny 3664fHteb1

Table of Contents