File "serial.c"
Full Path: /home/analogde/www/68hc11/serial.c
File size: 1.35 KB
MIME-type: text/x-c
Charset: utf-8
/*============================================================================
Motorola 68HC11
This is a simple program to show serial port and timer polling..
Author: Dusty Nidey, Axiom Mfg.
Date: 11\22\1996
Tools: ImageCraft C Compiler V3.5
==============================================================================*/
#include <hc11.h>
// Constants, not used in this example
const unsigned char SSTRING[] = "Simple String Data";
const unsigned char ANDMASK[] = {0xFB,0xF7,0xEF,0xDF};
// Function Prototypes
char FlashOnOff; // 1 = flash on time, 0 = flash off time
char Ibuf[18]; // serial input buffer
char count;
char count4;
char Rcount;
char Ibyte;
// this function only used for debugging in buffalo monitor
// it is handy to set a breakpoint here, and just call this in your program,
// this way the breakpoint always stays the same
void break_here(){
count=count;
}
// Toggle flashing pins for example
Handle_Timer(){
FlashOnOff ^= 0x01; // toggle flash state, example
}
// After executing STARTUP code on reset, exeas follows
puts("hello"); // send string
putchar(0x0D); // send CR
*/
}
if(TFLG2 & 0x80){ // if timer overflow
TFLG2 |= 0x80; // clear timer overflow flag
if(++count4 > 31){ // if time to flash
count4=0;
Handle_Timer(); // flash output pins in flash mode
}
}
}
}