
ASDA-B2
Chapter 8 Communications
Revision May, 2018
8-17
void main() {
int I;
outportb(PORT+MCR,0x08);
/* interrupt enable */
outportb(PORT+IER,0x01);
/*
interrupt as data in */
outportb(PORT+LCR,( inportb(PORT+LCR) | 0x80 ) );
/* the BRDL/BRDH can be access as LCR.b7 == 1 */
outportb(PORT+BRDL,12);
outportb(PORT+BRDH,0x00);
outportb(PORT+LCR,0x06);
/* set prorocol
<7,E,1>
=
1AH,
<7,O,1>
=
0AH
<8,N,2>
=
07H <8,E,1>
=
1BH
<8,O,1>
=
0BH
*/
for( I = 0; I<=16; I++ ) {
while( !(inportb(PORT+LSR) & 0x20) ); /* wait until THR empty */
outportb(PORT+THR,tdat[I]);
/* send data to THR */
}
I = 0;
while( !kbhit() ) {
if( inportb(PORT+LSR)&0x01 ) { /* b0==1, read data ready */
rdat[I++] = inportb(PORT+RDR); /* read data from RDR */
}
}
}
Содержание ASD-B2-1521-F
Страница 1: ......
Страница 20: ...ASDA B2 Chapter 1 Installation and Model Explanation Revision May 2018 1 7 1 4 Servo Drive Features...
Страница 81: ...Chapter 3 Wiring ASDA B2 3 42 Revision May 2018 This page is intentionally left blank...
Страница 103: ...Chapter 5 Trial Operation and Tuning ASDA B2 5 12 Revision May 2018 5 5 2 Inertia Estimation Flowchart with Mechanism...
Страница 124: ...ASDA B2 Chapter 6 Control Modes of Operation Revision May 2018 6 13...