Delta Electronics ASDA-A2 Series User Manual page 481

High resolution ac servo drive for network communication applications
Table of Contents

Advertisement

Call 1(800)985-6929 for Sales
unsigned char tdat[60]={':','0','1','0','3','0','2','0','0','0','0','0','2','F','8','\r','\n'};
void main() {
int I;
outportb(PORT+MCR,0x08);
outportb(PORT+IER,0x01);
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);
for( I = 0; I<=16; I++ ) {
while( !(inportb(PORT+LSR) & 0x20) );
outportb(PORT+THR,tdat[I]);
}
I = 0;
while( !kbhit() ) {
if( inportb(PORT+LSR)&0x01 ) { /* b0==1, read data ready */
rdat[I++] = inportb(PORT+RDR); /* read data from RDR */
}
}
}
9-16
Call 1(800)985-6929 for Sales
deltaacdrives.com
/* interrupt enable */
/* interrupt as data in */
/* set prorocol
<7,E,1> = 1AH,
<8,N,2> = 07H
<8,O,1> = 0BH
/* wait until THR empty */
/* send data to THR */
deltaacdrives.com
sales@deltaacdrives.com
Chapter 9 Communications
<7,O,1> = 0AH
<8,E,1> = 1BH
*/
Revision January 2011
sales@deltaacdrives.com

Advertisement

Table of Contents
loading

Table of Contents