HP (Hewlett-Packard) B Network Router User Manual


 
/* enable data to be read from memory and enable the address counter */
sprintf(command, "DIAG:PEEK? %ld, %d", base_addr+0x21,8);
IOOUTPUTS(CMD_MOD, command, strlen(command));
IOENTER(CMD_MOD, &bit_pat);
/* retain register settings, set memory control register bits 2 - 0 */
/* to ’1 1 0’ */
bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 : -.5));
bit_reg = (bit_reg & 0xF8) | 0x06;
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x21,8,bit_reg);
IOOUTPUTS(CMD_MOD, command, strlen(command));
/* set digitizer memory as the high-speed bus data source and the */
/* pulse register as the clock source */
sprintf(command, "DIAG:PEEK? %ld, %d", base_addr+0x02,8);
IOOUTPUTS(CMD_MOD, command, strlen(command));
IOENTER(CMD_MOD, &bit_pat);
/* retain register settings, set the data source and clock source */
bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 : -.5));
bit_reg = (bit_reg & 0xF0) | 0x03;
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x02,8,bit_reg);
IOOUTPUTS(CMD_MOD, command, strlen(command));
/* Send a clock pulse to the internal high-speed bus */
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x08,8,0);
IOOUTPUTS(CMD_MOD, command, strlen(command));
/* write the terminal (ending) address to the terminal address register */
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x2B,8,255);
IOOUTPUTS(CMD_MOD, command, strlen(command));
/* set the base (starting) address - most significant byte */
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x2D,8,255);
IOOUTPUTS(CMD_MOD, command, strlen(command));
/* set the base (starting) address - least significant byte */
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x2F,8,251);
IOOUTPUTS(CMD_MOD, command, strlen(command));
Continued on Next Page
400 Register Programming Appendix C