Motorola USB08 Reference Manual page 118

Universal serial bus evaluation board using the mc68hc908jb8
Table of Contents

Advertisement

Source Code Files
// *** calibration cycle ***
PTD &= ~0x78;
DDRD |= 0x78;
PTE |= 0x07;
DDRE |= 0x07;
for(zz=0;zz<1000;zz--) ;
DDRE &= ~0x07;
t0 = TCNT;
while((PTE & channel) != 0) ;
t1 = TCNT;
t1 -= t0;
// *** acquisition cycle ***
DDRD &= ~0x38;
DDRE |= 0x07;
for(zz=0;zz<1000;zz--) ;
DDRE &= ~0x07;
t0 = TCNT;
while((PTE & channel) != 0) ;
t2 = TCNT;
t2 = t2 - t0 - t1 - 100;
if(t2 > 50000u) t2=0;
if(t2 >= t1) t2 = t1-1;
// *** calculate scaled result ***
t2 = scaleSADC(t1,t2);
return t2;
}
//============================================================================
Designer Reference Manual
118
// PTD[3..6] = L
// Output
// PTE[0..2] = H;
// Output
// PTE HiZ (Input)
// PTD[3..5] = HiZ
// Output
// PTE HiZ (Input)
// underflow
// overflow
Source Code Files
USB08 Evaluation Board
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mc68hc908jb8

Table of Contents