Delta ASD-A2 Series User Manual page 562

Table of Contents

Advertisement

Chapter 9 Communications
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 */
}
}
}
Revision February, 2017
/* 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 */
ASDA-A2
<7,O,1> = 0AH
<8,E,1> = 1BH
*/
9-17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents