The VPIA (Virtual Parallel Interface Adapter) is a circuit designed to provide parallel communication lines between the computer and external circuits. Each VPIA circuit provide 32 bidirectionnal communication lines. Each line can be set individualy to input or output. A full support for interrupts is provided and can be set individually for each communication lines.
As a generic circuit, the functions activated by the communication lines depends how they are connected in the computer. The interrupt triggered depends also on the cabling. See bellow to understand how the different VPIA are used in the Blackvoxel ASM 1.0 Virtual Machine.
Offset | Dir | Register name | Function |
---|---|---|---|
0 | r/w |
VPIA_DATA | Data register for input/output |
4 | r/w |
VPIA_DIRECTION | Each bit in the direction register set whether the corresponding line is an input or an output. 0 = input, 1 = output. |
8 | r/w |
VPIA_INTERRUPTEN | Each bit in this register enable interrupts for the corresponding line. |
12 | r/w | VPIA_INTERRUPTLEVEL | Each bit in this register set the logic level triggering an interrupt. |
16 | r/w | VPIA_CONTROL | Some control function. |
Note : The offset should be added to the base address of the circuit. As an exemple, if the base address of the VPIA is 0x80000000, you must use the address 0x80000004 to access to the xxx register.
The data register for input/output. Reading from this register give you the state of the input communication lines. Writting to this register will change the output communication lines accordingly to the written data. At circuit start or reset, this register is set to 0xFFFFFFFF.
Each bit in this register set the direction of a communication line. Setting the bit to :
At circuit start or reset, this register is set to 0, so all lines are set by default to input mode.
Each bit in this register enable or disable interrupts for the corresponding communication line.
For interrupts to be enabled, you must also set the master interrupt switch in the VPIA_CONTROL register.
At circuit start or reset, this register is set to 0, so no interrupts will occur by default.
Each bit in this register set the logic level triggering an interrupt for each communication line. The interrupt are triggered on the transition to the indicated level.
At circuit start or reset, this register is set to 0.
This register control some of the functions of the VPIA. At circuit start or reset, this register is set with the value 0, so interrupts aren't activated.
Bit | function | Behavior |
0 |
Interrupt master switch |
Control wheter interupts are enabled or disabled.
|
1 | Interrupt Triggered Flag |
This bit is set to 1 when an interrupt is triggered. The interrupt processing program must reset it to 0 in order to clear the interrupt. |