
/* initialize the memory control register by setting bits 2 - 0 to ’0’*/
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 ’0’ */
bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 :
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x21,8,bit_reg); 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));
/* enable memory to be written to and enable the address counter */ /* by setting bits 2 - 0 to ’1 0 1’. */
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 and 0 */ /* to ’1’ */
bit_reg = (int)(bit_pat + ((bit_pat >= 0) ? .5 :
sprintf(command, "DIAG:POKE %ld, %d, %d", base_addr+0x21,8,bit_reg); IOOUTPUTS(CMD_MOD, command, strlen(command));
}
Continued on Next Page
Appendix C | Register Programming 395 |