Overview of Register Accesses from Computers

NI-VISA

Overview of Register Accesses from Computers

Before learning about the LLA operations, first consider how a computer can perform a register access to an external device. There are two possible ways to perform this access. The first and more obvious, although primitive, is to have some hardware on the computer that communicates with the external device.

You would have to follow these steps:

  1. Write the address you want.
  2. Specify the data to send.
  3. Send the command to perform the access.

As you can see, this method involves a great deal of communication with the local hardware.

The National Instruments MXI plug-in cards and embedded VXI computers use a second, much more efficient method. This method involves taking a section of the computer's address space and mapping this space to another space, such as the VXI A16 space. Most PXI devices also have registers that are memory mapped into your computer.

To understand how mapping works, you must first remember that memory and address space are two different things. For example, most 32-bit CPUs have 4 GB of address space, but have memory measured in megabytes. This means that the CPU can put out over 232 possible addresses onto the local bus, but only a small portion of that corresponds to memory. In most cases, the memory chips in the computer will respond to these addresses. However, because there is less memory in the computer than address space, National Instruments can add hardware that responds to other addresses. This hardware can then modify the address, according to the mapping that it has, to a VXI address and perform the access on the VXIbus automatically. The result is that the computer acts as if it is performing a local access, but in reality the access has been mapped out of the computer and to the VXIbus.

You may wonder what the difference is between the efficient method and the primitive method. They seem to be telling the hardware the same information. However, there are two important differences. In the primitive method, the communication described must take place for each access. However, the efficient method requires only occasional communication with the hardware. Only when you want a different address space or an address outside of the window do you need to reprogram the hardware. In addition, when you have set up your hardware, you can use standard memory access methods, such as pointer dereferences in C, to access the registers.