
Designer Reference Manual USB08 Evaluation Board
98 Source Code Files MOTOROLA
Source Code Files
// Things that should be done immediately after Reset
// (this is called by t he C-Startup Module)
//
void _HC08Setup() {
CONFIG = 0x21; // USB Reset Disable, COP Disable
TSC = 0x00; // clear TSTOP, Presca ler=0
}
//--------------------- ------------------------ ----------------------- --------
// Dummy Interrupt Hand ler
// Place a Breakpoint h ere in case you are look ing for spurious Interr upts
//
@interrupt void isrDumm y() {
nop(); // just for Debugging
}
//--------------------- ------------------------ ----------------------- --------
void main() {
uchar n, a;
uchar io_buffer[8];
uchar adc[3];
initPipe(); // init RS232 or USB Pipe
initLED(); // init LED Output
initKey(); // init Key Input
initSADC(); // init Soft ADC
cli();
a = 0;
while(1) {
// update ADC results (1 out of 3 at one time)
adc[a] = getSADC(a+1);
if(++a==3) a=0;
// get data from input pipe
n=0;
do {io_buffer[n++] = getPip e( );
} while(n<8);
// process input data
if(io_buffer[0]==0) off LED(1);
else onLED(1);
if(io_buffer[1]==0) off LED(2);
else onLED(2);
if(io_buffer[2]==0) off LED(3);
else onLED(3);