Designer Reference Manual
USB08 Evaluation Board
118
Source Code Files
MOTOROLA
Source Code Files
// *** calibration cycle ***
PTD &= ~0x78;
// PTD[3..6] = L
DDRD |= 0x78;
// Output
PTE |= 0x07;
// PTE[0..2] = H;
DDRE |= 0x07;
// Output
for(zz=0;zz<1000;zz--) ;
DDRE &= ~0x07;
// PTE HiZ (Input)
t0 = TCNT;
while((PTE & channel) != 0) ;
t1 = TCNT;
t1 -= t0;
// *** acquisition cycle ***
DDRD &= ~0x38;
// PTD[3..5] = HiZ
DDRE |= 0x07;
// Output
for(zz=0;zz<1000;zz--) ;
DDRE &= ~0x07;
// PTE HiZ (Input)
t0 = TCNT;
while((PTE & channel) != 0) ;
t2 = TCNT;
t2 = t2 - t0 - t1 - 100;
if(t2 > 50000u) t2=0;
// underflow
if(t2 >= t1) t2 = t1-1;
// overflow
// *** calculate scaled result ***
t2 = scaleSADC(t1,t2);
return t2;
}
//============================================================================
Содержание MC68HC908JB8
Страница 2: ...blank ...
Страница 6: ...Designer Reference Manual USB08 Evaluation Board 6 List of Sections MOTOROLA List of Sections ...
Страница 16: ...Designer Reference Manual USB08 Evaluation Board 16 List of Tables MOTOROLA List of Tables ...
Страница 42: ...Designer Reference Manual USB08 Evaluation Board 42 Hardware Description MOTOROLA Hardware Description ...
Страница 88: ...Designer Reference Manual USB08 Evaluation Board 88 USB08 Descriptors MOTOROLA USB08 Descriptors ...
Страница 243: ...blank ...