48
Chapter 4. Programming
/*-----------------------------------------------
putchar replacement for external UART.
-----------------------------------------------*/
char putchar (char c)
{
extsio_putchar (c);
return (c);
}
/*-----------------------------------------------
Wait dummy function
-----------------------------------------------*/
void wait (void)
{
; /* just to waits some time */
}
/*-----------------------------------------------
Setup the external UART for 57600 baud, write the
string "Hello World nnn", and repeat.
-----------------------------------------------*/
void main (void)
{
unsigned int counter = 0;
extsio_setup (57600);
for (counter = 0; ; +)
{
unsigned long i;
printf ("Hello World %u\r\n", (unsigned) counter % 100);
for (i = 0; i < DELAY; i++) wait ();
}
}
/*-----------------------------------------------
-----------------------------------------------*/
Use the following command line to compile the external UART example
program:
C251 EXTSIO.C DEBUG MODSRC
Since this example program uses the external UART, you must generate a HEX
file and program an EPROM. Use the following command line to link:
L251 EXTSIO.OBJ
and the following command line to generate an Intel HEX file:
OH251 EXTSIO
You may then use the EXTSIO.HEX file to program an EPROM.
Summary of Contents for MCB251
Page 6: ...vi Contents...
Page 18: ...12 Chapter 2 Setup...
Page 24: ...18 Chapter 3 Hardware Schematics...
Page 25: ...MCB251 Evaluation Board User s Guide 19...
Page 26: ...20 Chapter 3 Hardware...
Page 27: ...MCB251 Evaluation Board User s Guide 21...