IBM H8 user manual Init sci with 9600Baud, 8N1

Page 40

HTEB1

User manual

return TRUE;

}

return FALSE;

}

 

u8 V24PutChar(u8 c)

// simple PutChar via V24

{

 

if (IS_SCI_TX_FREE)

// Tx register free ?

{

 

TDR = c;

// yes, put data in tx register

return TRUE;

 

}

 

return FALSE;

 

}

 

u8 V24Write(u8 *s)

// simple Write(string) via V24

{

 

while (*s != 0)

// while not end of string

{

 

if (V24PutChar(*s) == TRUE) s++; // PutChar

}

 

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\rGreat! This was '1'");

}

else if (c=='2')

{

V24WriteLn("\n\n\rSuper! '2'");

}

else

{

V24WriteLn("\n\n\rSorry! Only '1' or '2' are supported!");

}

ShowUse();

}

}

}

Issue 0.2

Page 40

07/2002

Image 40
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