HP 34401A User Manual page 195

Hide thumbs Also See for 34401A:
Table of Contents

Advertisement

Chapter 6 Application Programs
RS-232 Operation Using Turbo C
RS-232 Operation Using Turbo C (continued)
void interrupt int_char_in(void)
{
enable();
if(int_buf_count < INT_BUF_size) {
*int_buf_in++ = inportb(RDR);
int_buf_count++;
if(int_buf_in >= int_buf + INT_BUF_size) int_buf_in = int_buf;
int_buf_ovfl = 0;
}
else {
inportb(RDR);
int_buf_ovfl = 1;
}
outportb(INT_controller,End_of_interrupt);
}
void send_ctlc(void)
{
outportb(MCR,0x8);
delay(10);
while(!(inportb(LSR) & 0x20)) ;
outportb(THR,0x3);
while(!(inportb(LSR) & 0x40)) ;
int_buf_in = int_buf_out = int_buf;
int_buf_count = int_buf_ovfl = 0;
delay(20);
outportb(MCR,0x9);
}
196
/* Enable hardware interrupts */
/* Read byte from UART */
/* Clear UART interrupt */
/* Non-specific EOI */
/* De-assert DTR */
/* Wait 10 mS for stray characters */
/* Wait on transmitter register */
/* Send ^C */
/* Wait for ^C to be sent */
/* Clear int_char_in buffer */
/* 20mS for HP 34401 to clean up */
/* Assert DTR */

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents