beautypg.com

Programming, Programming model – Sensoray 518 User Manual

Page 11

background image

10

Programming

Programming of the 518 is achieved via a set of built-in commands. Commands are
sent from the PC104 master (aka “host”) to the 518. Some commands cause
responses from the 518; these responses are sent from 518 to the host. This chapter
explains the mechanism behind this bi-directional communication and describes the
coprocessor command set in detail.

Programming Model

The coprocessor occupies four consecutive addresses in the host’s I/O space, of
which only the lower two addresses are actually used. Both of these addresses may
be written to and read from, but each address has a distinctly different function for
read and write operations.

The base port (518 board low port address) forms the data path between 518 and
host processors. Commands are sent to the 518 and command responses are passed
back to the host through this port.

The data port (base address) consists of two hardware registers: command and data.
When the host sends a command to the 518, it is really storing a byte in the
command register. When the host reads a command response from the 518, it is
reading a byte from the data register. Because the command register is write-only
and the data register read-only, they are able to share the same I/O address.

The control port (base address + 1) consists of the read-only status register and
write-only control register. As the name implies, the status register supplies
coprocessor status information to the host. The control register is used to invoke
518 soft resets and to enable and disable host interrupts.

Programming model

Port Address

Read

Write

Base + 0: Data

Data Register

Command Register

Base + 1: Control

Status Register

Control Register