HTEB1
User manual
Issue 0.2
Page 40
07/2002
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 ( 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();
}
}
}
Summary of Contents for H8/Tiny 3664F
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 31: ...HTEB1 User manual Issue 0 2 Page 31 07 2002 2 3 Workflow ...
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 ...