Motorola USB08 Reference Manual page 98

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Source Code Files
// Things that should be done immediately after Reset
// (this is called by the C-Startup Module)
//
void _HC08Setup() {
CONFIG = 0x21;
TSC
= 0x00;
}
//----------------------------------------------------------------------------
// Dummy Interrupt Handler
// Place a Breakpoint here in case you are looking for spurious Interrupts
//
@interrupt void isrDummy() {
nop();
}
//----------------------------------------------------------------------------
void main() {
uchar n, a;
uchar io_buffer[8];
uchar adc[3];
initPipe();
initLED();
initKey();
initSADC();
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++] = getPipe();
} while(n<8);
// process input data
if(io_buffer[0]==0) offLED(1);
else onLED(1);
if(io_buffer[1]==0) offLED(2);
else onLED(2);
if(io_buffer[2]==0) offLED(3);
else onLED(3);
Designer Reference Manual
98
// USB Reset Disable, COP Disable
// clear TSTOP, Prescaler=0
// just for Debugging
// init RS232 or USB Pipe
// init LED Output
// init Key Input
// init Soft ADC
Source Code Files
USB08 Evaluation Board
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents