Specifications
EPC-8 Hardware Reference
5 5
5-6
Microsoft C code for Example 1 -
#define WORD unsigned short
#define LWORD unsigned long
WORD addr; /* 16-bit A16 address */
WORD data;
WORD far * wptr;
outp(0x8102,(inp(0x8102)|2)); /* set VME E-page enable access bit */
outp(0x8151,0xCA); /* Set address modifier to A16 supervisory access */
wptr = (WORD far *) (0xE0000000L + addr);
data = *wptr; /* Read through window */
Example #2
Example #2 performs a byte (8-bit) write into the VMEbus A32 space. Here the
upper 16 bits of the VME address need to be stored in the appropriate registers.
1. Set the VME E-page enable bit in Register 8102.
2. Set register 8150 with the value corresponding to the 8 high-order address bits.
VMEbus Address bits 31-24 WA31-24
3. Determine the correct address modifier for A32 supervisory access.
4. Calculate the value and set register 8151 as follows:
VME WA23-22 BORD IACK AM5 AM4 AM2 AM1
Bits 7 & 6 VME address bits 23-22
Bit 5 BORD = 0
Bit 4 IACK = 0
Bits 3-0 Bit 3 (Address Modifier bit 5)
Bit 2 (Address Modifier bit 4)
Bit 1 (Address Modifier bit 2)
Bit 0 (Address Modifier bit 1)
5. Set register 8130 with the value corresponding to bits 21-16 of the VMEbus
address with the two low order bits of the register set to 0.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com