Intranet Catprocess
  1. news...
  2. about Blackvoxel
  3. download
  4. manual
  5. videos
  6. about us
  1. ZVPIA Circuit

     

    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.

    VPIA Circuit Registers.

    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.

    VPIA_DATA (Base address+0x0)

    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.

    VPIA_DIRECTION(Base address+0x4)

    Each bit in this register set the direction of a communication line. Setting the bit to :

    • 0 : Set the corresponding line to Input mode.
    • 1 : Set the corresponding line to Output mode.

    At circuit start or reset, this register is set to 0, so all lines are set by default to input mode.

    VPIA_INTERRUPTEN(Base address+0x8)

    Each bit in this register enable or disable interrupts for the corresponding communication line.

    • 0 : Disable interrupts for the corresponding line.
    • 1 : Enable interrupts for the corresponding 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.

    VPIA_INTERRUPTLEVEL(Base address+0xC)

    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.

    • 0 : Interrupt on transition from high to low.
    • 1 : Interrupt on transition from low to high.

    At circuit start or reset, this register is set to 0.

    VPIA_CONTROL (Base address + 0x10)

    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.

    • 0 : Interrupts disabled
    • 1 : Interrupts enabled
    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.

     

     

     
  2. Google+