background image

HTEB1

User manual

Issue 0.2

Page 21

07/2002

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.

Summary of Contents for H8/Tiny 3664F

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

Page 2: ...artially subject to change without notice All rights reserved No one is permitted to reproduce or duplicate in any form a part or this entire document without embesso GmbH written permission Restrictions Please refer to the restrictions of all components and tool suppliers Hardware Considerations Grounding This hardware is designed for use with equipment that is fully grounded Ensure that all equi...

Page 3: ...oard overview 6 1 5 Jumpers and switches 7 1 6 Connectors 9 1 7 Start Up instructions 12 2 Development Environment 15 2 1 Creating a program using IAR EWH8 15 2 2 Download the code using FDT 23 2 3 Workflow 31 3 Examples 32 3 1 Key s and LED s 33 3 2 LCD 36 3 3 SCI 39 3 4 A D PWM 41 3 5 AT Keyboard Interface 44 Appendix A CD R content 51 Appendix B Schematic 52 Appendix C Board layout 53 ...

Page 4: ... on the evaluation board 1 2 Hardware description The Hitachi Tiny Eval Board HTEB1 is a low cost multifunctional evaluation board for the Hitachi Tiny H8 3664F microcontroller It can be used stand alone for software development and testing or as a simple target board You can use the Flash Download Tool FDT for programming the target code or work with a debug system E10T at the provided connector ...

Page 5: ... 9 8304 MHz main crystal 32 768 kHz sub crystal UART interface with MAX232 level converter and SubD 9 female connector 8 User LEDs 2 16 characters LCD with LED backlight switchable Additional connector for external LCD 4 user keys PC AT Keyboard interface 2 potentiometer connected to A D channel 0 1 Reset button 1 switch user prog programming E10T debug connector 5V voltage regulator on board ...

Page 6: ...oard overview 8 user LEDs 2 16 char LCD with LED backlight DA connector RS232 connector SubD0 female Power 7 5 V 9V DC Ext LCD connector E10T connector I2C connector Contrast AT PS2 keyboard connector Prog Run switch 4 user keys Reset button P1 ADC 0 P2 ADC 1 Crystal socket ...

Page 7: ...e jumper to alternate setting JP3 is used for the LCD LED backlight If the jumper is closed 1 2 the backlight will be ON Remove the jumper open if backlight operation is not necessary JP2 is used for I2C interface JP4 is used as an output for the DAC or for PWM JP1 Operation 1 3 2 4 1 1 operation 1 2 3 4 Crossed connection JP3 Operation Closed LED backlight ON Open LED backlight OFF JP2 I2C CON Op...

Page 8: ...IGHT 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 The crystal type should be a HC49 HC49U type Eventually change the capacitors C6 C7 if necessary If you change the crystal frequency take care on possible changes by flash download tool see FDT manual Figure 1 5 ...

Page 9: ...7 5 9 VDC approx 180mA with LED backlight X1 SubD9 Pin Operation Remark 1 DTR DSR DTS Connected to X1 4 X1 6 2 TXD Connected to JP1 1 3 RXD Connected to JP1 3 4 DTR Connected to X1 1 X1 6 5 GND 6 DSR Connected to X1 1 X1 4 7 RTS Connected to X1 8 8 CTS Connected to X1 7 9 n c Not connected X4 Mini Din Pin µC Pin Operation 1 P17 can be Data or Clk 5 P16 can be Clk or Data 3 GND 4 Vcc 2 6 n c ...

Page 10: ... 4 2 Vcc 5 3 contrast P3 6 4 P75 RS register select 7 5 P74 R W read write 8 6 P20 EN enable 9 7 P50 D0 10 8 P51 D1 11 9 P52 D2 12 10 P53 D3 13 11 P54 D4 14 12 P55 D5 15 13 P56 D6 16 14 P57 D7 1 15 Backlight 2 16 GND X5 SYS CON pin µC pin Operation 1 P87 Debug pin 5 P86 Debug pin 7 NMI NMI 11 P85 Debug pin 13 RESET reset control 8 Vcc 2 4 6 10 12 14 GND 3 9 n c Not connected X3 pinout X5 pinout ...

Page 11: ...3 n c 3 n c 3 n c 3 P51 4 n c 4 n c 4 n c 4 P50 5 P14 5 P22 5 P76 5 n c 6 P15 6 P21 6 P75 6 n c 7 P16 7 P20 7 P74 7 n c 8 P17 8 P87 8 P57 8 n c 9 AN4 9 P86 9 P56 9 n c 10 AN5 10 P85 10 P12 10 n c 11 AN6 11 P84 11 P11 11 n c 12 AN7 12 P83 12 P10 12 n c 13 AN3 13 P82 13 P55 13 GND 14 AN2 14 P81 14 P54 14 RESET 15 AN1 15 P80 15 P53 15 VCL 16 AN0 16 NMI 16 P52 16 n c 17 18 Vcc 17 18 Vcc 17 18 Vcc 17 1...

Page 12: ...Power Supply The HTEB1 hardware requires a power supply of 7 5V DC at minimum Please don t use a power supply with more the 9V DC because the on board voltage regulator becomes very hot The HTEB1 power consumption is about 180mA with LCD backlight ON Since total power consumption can vary widely due to external connectors H8 3664F port state use a power supply capable of providing at least 300mA a...

Page 13: ...tains a small Running Light application The keys can be used for control the state P2 is used as speed control First press the key T3 RUN for starting demo application Then you can check the functionality by pressing the keys KEY T1 to KEY T4 or change the value of potentiometer P2 Figure of the Demo application Running Light Any time you want to reset the application press the reset button If you...

Page 14: ...xe Follow the instructions in setup and look at the readme txt file FDT Next install programs fdt ftd15 exe Then the plugin fdt3664f exe must be installed Follow the setup instructions A documentation will be found in fdt_man pdf If you have installed these tools please refer to the next lessons for workflow NOTE Most freeware tools are unsupported versions Please refer to manuals or hints on webs...

Page 15: ...are 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 Start IAR Embedded Workbench on your PC The following window will appear Now select File New and select Project ...

Page 16: ... 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: ...07 2002 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 ...

Page 18: ...sue 0 2 Page 18 07 2002 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 ...

Page 19: ...lick 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 counter unsigned char c 0 holds port output PCR8 0xff port is output PDR8 c all LED s on inverse while 1 while x wait c increment c PDR8 c to port ...

Page 20: ...HTEB1 User manual Issue 0 2 Page 20 07 2002 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 ...

Page 21: ...ual Issue 0 2 Page 21 07 2002 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 ...

Page 22: ... manual Issue 0 2 Page 22 07 2002 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 ...

Page 23: ...7 2002 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 ...

Page 24: ...24 07 2002 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 ...

Page 25: ...HTEB1 User manual Issue 0 2 Page 25 07 2002 First time users should use the wizard Fill in the following things ...

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: ...ual Issue 0 2 Page 28 07 2002 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 ...

Page 29: ...e reset button With Image Download image Ctrl P you one can start the connection setup to target board and start downloading image file Now press Ctrl P Download on FDT and the download process will start Watch on progress bar while download When the download is finished press Alt C to disconnect the PC connection On target board move Prog Run switch to run position right press down the reset butt...

Page 30: ...age 30 07 2002 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 ...

Page 31: ...HTEB1 User manual Issue 0 2 Page 31 07 2002 2 3 Workflow ...

Page 32: ...ect open existing workspace Select one of the projects and do your exercises For all projects we need the same header file containing some definitions and the include file for the target microcontroller H8 3664F So if you want to work with these files don t forget to include the file mydefs h first in your project file ifndef _MYDEFS_H_ define _MYDEFS_H_ include ioh83664 h select processortype her...

Page 33: ...n TinyEvalBoard in addition Timer_A is used for timer tick with irq include mydefs h for all nec includes defines define KEY_1 0x10 define KEY_2 0x20 define KEY_3 0x04 define KEY_4 0x02 define KEY_ALL KEY_1 KEY_2 KEY_3 KEY_4 define KEY_RELEASED 0x40 define KEY_PROCESSED 0x80 define LED_SPEED_INIT4 4 32 1 8s 125ms variables u8 KeyCode 0 u8 LED_Out LED_Dir LED_Run LED_Speed functions void KeyCheck v...

Page 34: ...htInit void prepare LED port and vars PrepKeyPort PDR8 0xff all LED s off PCR8 0xff all out s LED_Out 0x01 start value LED_Run 0x01 run LED_Dir 0x00 dir left LED_Speed LED_SPEED_INIT start speed TimerA Interrupt 1s increments var c and output the value of c to LED s inverted interrupt TIMER_A void Timer_A_Isr void static u8 c KeyCheck check for key pressed RunningLightUpdate IRR1 0x40 clear irq fl...

Page 35: ...HTEB1 User manual Issue 0 2 Page 35 07 2002 RunningLightInit Init key s and LEDs Timer_A_Init init start timer_A while 1 just wait ...

Page 36: ...find further includes there void wait u16 wastetime local LCD port delay while wastetime LCD Port Bits on TinyEvalBoard RS P75 R W P74 EN P20 DATA P5 some defines for easy access define CLEAR_LCD_RS PDR7 0x20 define SET_LCD_RS PDR7 0x20 define CLEAR_LCD_RW PDR7 0x10 define SET_LCD_RW PDR7 0x10 define CLEAR_LCD_EN PDR2 0x01 define SET_LCD_EN PDR2 0x01 define LCD_DATA_PORT PDR5 define LCD_DATA_CTRL ...

Page 37: ...7 character font while cnt LCDWriteCmd 0x38 8Bit IF 2 Lines 5x7 character font while cnt LCDWriteCmd 0x01 Display Clear LCDReadStatus LCDWriteCmd 0x0f DisplayOn CursorOn BlinkingOn LCDWriteCmd 0x0c DisplayOn CursorOff BlinkingOff LCDReadStatus LCDWriteCmd 0x06 Enter Mode AutoIncrement LCDReadStatus LCDWriteCmd 0x14 MoveCursor right LCDReadStatus LCDWriteCmd 0x80 Set DD RAM Address 0x00 LCDReadStat...

Page 38: ... void while 1 do forever LCDWriteLine 0 Text1 0 display msgs 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 init ports and LCD LCDLoopMsg go to LoopMsg ...

Page 39: ... 0x40 define TE 0x20 define RE 0x10 define MPIE 0x08 define TEIE 0x04 define CK_INT 0x00 define CK_INT_OUT 0x01 define CK_EXT 0x02 define IS_SCI_RDF SSR 0x40 define CLEAR_SCI_RDF SSR SSR 0x40 define IS_SCI_TX_FREE SSR 0x80 define V24_BRR x unsigned char CPU_CLK 16 x 32 x 1 void V24Init u16 Baudrate SCR3 0x00 disable all SSR 0x00 clear all errorbits SMR 0x00 8N1 1 clock BRR V24_BRR Baudrate set bau...

Page 40: ...utChar return TRUE u8 V24WriteLn u8 s simple WriteLine string CR LF u8 ret FALSE ret V24Write s ret V24Write n r return ret void ShowUse void simple menu V24WriteLn n n rV24 DemoProgram V24WriteLn 1 Line 1 V24WriteLn 2 Line 2 V24Write make your choise void main void char c V24Init 9600 init sci with 9600Baud 8N1 ShowUse display start msg while 1 loop if V24GetChar c TRUE if c 1 V24WriteLn n n rGre...

Page 41: ...TinyEvalBoard RS P75 R W P74 EN P20 DATA P5 some defines for easy access define CLEAR_LCD_RS PDR7 0x20 define SET_LCD_RS PDR7 0x20 define CLEAR_LCD_RW PDR7 0x10 define SET_LCD_RW PDR7 0x10 define CLEAR_LCD_EN PDR2 0x01 define SET_LCD_EN PDR2 0x01 define LCD_DATA_PORT PDR5 define LCD_DATA_CTRL PCR5 define LCD_OUT 0xff define LCD_IN 0x00 define LCD_WAIT wait 100 void LCDWriteCmd u8 cmd write cmd to ...

Page 42: ...eCmd 0x0c DisplayOn CursorOff BlinkingOff LCDReadStatus LCDWriteCmd 0x06 Enter Mode AutoIncrement LCDReadStatus LCDWriteCmd 0x14 MoveCursor right LCDReadStatus LCDWriteCmd 0x80 Set DD RAM Address 0x00 LCDReadStatus writesomedata from 1st position in line 0 1 void LCDWriteLine u8 line u8 data LCDWriteCmd 0x80 line 0x40 select line while data LCDWriteData data data define ADDR_A volatile unsigned sh...

Page 43: ...ldval channel adval 10 oldval channel adval else oldval channel oldval channel 15 adval 4 return oldval channel TimerV Test setup CLK 8 1µs 8MHz PWM Output at TMOV P76 void Test_Timer_V void TCRV0 0x08 0x01 Clear by CompMatchA IntClk 8 TCRV1 0x01 Clk 2 no external Trigger TCSRV 0x08 0x01 0 onCompMatchA 1 onCompMatchB output on P76 TCORA 100 set periode to 100 10 000Hz TCORB 75 set init dutycycle t...

Page 44: ...valBoard RS P75 R W P74 EN P20 DATA P5 some defines for easy access define CLEAR_LCD_RS PDR7 0x20 define SET_LCD_RS PDR7 0x20 define CLEAR_LCD_RW PDR7 0x10 define SET_LCD_RW PDR7 0x10 define CLEAR_LCD_EN PDR2 0x01 define SET_LCD_EN PDR2 0x01 define LCD_DATA_PORT PDR5 define LCD_DATA_CTRL PCR5 define LCD_OUT 0xff define LCD_IN 0x00 define LCD_WAIT wait 100 void LCDWriteCmd u8 cmd write cmd to LCD p...

Page 45: ...F 2 Lines 5x7 character font while cnt LCDWriteCmd 0x0c DisplayOn CursorOff BlinkingOff LCDReadStatus LCDWriteCmd 0x06 Enter Mode AutoIncrement LCDReadStatus LCDWriteCmd 0x14 MoveCursor right LCDReadStatus LCDWriteCmd 0x80 Set DD RAM Address 0x00 LCDReadStatus writesomedata from 1st position in line 0 1 void LCDWriteLine u8 line u8 data LCDWriteCmd 0x80 line 0x40 select line while data LCDWriteDat...

Page 46: ...TA val 0x0200 cnt if cnt 11 if OddParStopCheck val TRUE KeyCodeBuf keyWriteIndex val keyWriteIndex if keyWriteIndex cKeyBufSize keyWriteIndex 0 cnt 0 val 0 IRR1 0x04 clear IRQ Flag void SendKeyBoard u8 data send data to keyboard u8 pcnt 0 u8 mask 0x80 outval data 0x0600 stopbit clkbit internal while mask calculate odd parity if mask data pcnt mask 1 if pcnt 0x01 outval 0x0100 set parity bit PDR1 c...

Page 47: ...0 chk for value if c 10 data 0 c 0 9 else data A c 10 a f data next digit code 4 LCDWriteLine 1 buffer show result void KeyTest void u8 c u16 KeyCode PMR1 cKEYCLK P16 irq input PMR1 cKEYDATA P17 i o pin IEGR1 0x04 IRQ_2 on falling edge IENR1 0x04 enable IRQ_2 set_interrupt_mask 0 enable all interrupts LCDWriteLine 0 PC Keyboard Test LCDWriteLine 1 press any key while 1 if kbhit if new key KeyCode ...

Page 48: ... 6B 6B Make Break 1 4F CF 69 F0 69 69 Make Break E0 35 E0 B5 E0 4A E0 F0 4A 77 Make Break 8 48 C8 75 F0 75 75 Make Break 5 4C CC 73 F0 73 73 Make Break 2 50 D0 72 F0 72 72 Make Break 0 52 D2 70 F0 70 70 Make Break 37 B7 7C F0 7C 7E Make Break 9 49 C9 7D F0 7D 7D Make Break 6 4D CD 74 F0 74 74 Make Break 3 51 D1 7A F0 7A 7A Make Break Del 53 D3 71 F0 71 71 Make Break 4A CA 7B F0 7B 84 Make Break 4E...

Page 49: ...B 5B F0 5B 5B Typematic Return 1C 9C 5A F0 5A 5A Typematic CAPS Lock 3A BA 58 F0 58 58 Make Break a 1E 9E 1C F0 1C 1C Typematic s 1F 9F 1B F0 1B 1B Typematic d 20 A0 23 F0 23 23 Typematic f 21 A1 2B F0 2B 2B Typematic g 22 A2 34 F0 34 34 Typematic h 23 A3 33 F0 33 33 Typematic j 24 A4 3B F0 3B 3B Typematic k 25 A5 42 F0 42 42 Typematic l 26 A6 4B F0 4B 4B Typematic 27 A7 4C F0 4C 4C Typematic 28 A...

Page 50: ... D7 78 F0 78 56 Make Break F12 58 D8 07 F0 07 5E Make Break Print E0 2A E0 37 E0 B7 E0 AA E0 12 E0 7C E0 F0 7C E0 F0 12 57 Make Break Scroll 46 C6 7E F0 7E 5F Make Break Pause E1 1D 45 E1 9D C5 Not available E1 14 77 E1 F0 14 F0 77 Not available 62 Make Break Ins E0 52 E0 D2 E0 70 E0 F0 70 67 Make Break Del E0 53 E0 D3 E0 71 E0 F0 71 64 Typematic Pos1 E0 47 E0 C7 E0 6C E0 F0 6C 6E Make Break End E...

Page 51: ...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 ...

Page 52: ...HTEB1 User manual Issue 0 2 Page 52 07 2002 Appendix B Schematic ...

Page 53: ...HTEB1 User manual Issue 0 2 Page 53 07 2002 Appendix C Board layout ...

Page 54: ...HTEB1 User manual Issue 0 2 Page 54 07 2002 NOTES ...

Page 55: ...HTEB1 User manual Issue 0 2 Page 55 07 2002 NOTES ...

Page 56: ...HTEB1 User manual Issue 0 2 Page 56 07 2002 ...

Reviews: