IBM H8 user manual Examples

Page 32

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\” with all application notes included.

Then start IAR-Ewh8 and select “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 here

#include "inh8.h"

 

#include "icclbutl.h"

 

#define CPU_CLK 9830400

// select clk for diff. calc.

#ifndef NULL

 

#define NULL 0x00

 

#endif

 

#ifndef FALSE

 

#define FALSE 0x00

 

#endif

 

#ifndef TRUE

 

#define TRUE 0x01

 

#endif

 

typedef unsigned char u8;

 

typedef unsigned int u16;

 

#endif

 

 

 

Issue 0.2

Page 32

07/2002

Image 32
Contents Hitachi H8/Tiny 3664F Preface Table of Contents System Development Kit content Hardware descriptionFeatures Board overview Board overviewJumpers and switches JP4, D/A CONOrientation Operation Connectors X1 SubD9, Pin Operation RemarkX3 LCD-CON SV1 SV2 SV3 SV4 PIN Installing the HTEB1 Start-Up instructionsTest program Software Installation Creating a program using IAR-EWH8 Development EnvironmentHTEB1 HTEB1 HTEB1 HTEB1 HTEB1 HTEB1 HTEB1 Download the code using FDT HTEB1 HTEB1 HTEB1 HTEB1 HTEB1 HTEB1 HTEB1 Workflow Examples Key’s and LED’s LEDSPEEDINIT4PMR1 &= ~KEYALL RunningLightInit Init keys and LEDs TimerAInit LCD Clearlcdrs Setlcdrw Lcddatactrl = Lcdin Setlcden HTEB1 SCI IsscitxfreeInit sci with 9600Baud, 8N1 A/D + PWM Lcddatactrl = Lcdin Setlcden Calculate av of last 15 values AT-Keyboard-Interface Setlcdrw Lcddatactrl = Lcdin Setlcden Mask = Msg buffer Tables Scan-Codes MFII-Keyboard Numeric Keypad Main Scan-Code Keypad Function Scan-Code Datasheets ProgramsExamples DemoAppendix B Schematic Appendix C Board layout HTEB1 HTEB1 HTEB1