/* DA_INT.C * * Analog Output Routines for the SBC1190 with 4 Channel D/A option * * This example uses the special Micro/sys system interrupt to * write to the onboard D/A convertor. * * 8/3/98 */ #include #include #include /*-----------------------------------------------------------------------* * analogwr(int chan, int dta) * * This function writes to an analog output given a channel * * number of 0 to 3 * * Return value : nothing * *-----------------------------------------------------------------------*/ void analogwr(int chan, int dta) { union REGS regs86; regs86.h.ah = 0xDD; /* special Micro/sys system function */ regs86.h.al = 0x30; /* output to D/A convertor */ regs86.h.bl = chan; regs86.x.cx = dta; int86(0x1A, ®s86, ®s86); } void main(void) { unsigned n; for(;;) { /* output all values from 0 to 0xFFF */ for(n=0;n<0x1000;n++) { analogwr(0, n); /* channel 0 */ analogwr(1, n); /* channel 1 */ analogwr(2, n); /* channel 2 */ analogwr(3, n); /* channel 3 */ } } }