    RE VANESSA and Hostmode                   Translation by G0KIU @ GB7MAM

    To:  DG9FU Henning
         DB8AS Jochen

    Hello Henning and Jochen

    Here once more that which I have delivered to Reinhard a year ago.
    In the meantime I have not gone further with this Project, had a 
    holiday and other Problems.  HI. 

    Additionally, I am sending you a description of the Interface as well 
    as the EPROM Code for the VANESSA.

    The Files have the following meaning:
    - PC_HOST: Test Program, simple Terminal-Program, that communicates 
               with the Vanessa via the DP-RAM, will be installed on the 
               PC. 

    -VAN_HOST.EXE Hostmode Code (EPROM) for Hostmode VANESSA, self 
               extracting 
           
    -VAN_HOST.TXT Hostmode Interface Description

    After the Start of the VANESSA / PC, the Serial Port on Vanessa is 
    active. By connection with the COM Port the VANESSA can be operated as 
    a normal TNC. 

    The PC_HOST expects a VANESSA with the HOST-Mode Firmware to be at the 
    Memory Address D000:0 (All DIP SW = ON) and toggles the Data output on 
    the DP-RAM. After that common TNC Commands are possible.

    -----------------------------------------------------------------------
    finally it is so far: VANESSA understands the Hostmode!

    In the last few days I could port TF 2.4 successfully on the VANESSA 
    and accommodate the L1 on the Hardware. With that way it stands clear 
    to realise a Driver for DieBox.
    The Hostmode Firmware VAN_HOST can communicate via the Serial Port  
    (Debug mode) or the Dual Port Ram with the Host Computer. 

    The Structure within the DP RAM has been fixed provisionally as 
    follows:

 
    ----------------------------------------------------------------
    #define DP_BASE     0xD0000000L     /* 0xD000 1. CRAM       */
    #define DP_BLOCK    4096            /* CRAM SIZE            */
    #define  MAGIC      0x4711

    #define LED_OFF 0                   /* Vanessa LED          */
    #define LED_ON  0xff                /* vanessa LED          */

    #define HORXFL      260
    #define HOTXFL      260

    #define  USBYTE unsigned short char
    #define  USINT  unsigned int

    /* Data type definitions ----------------------------------- */

    struct dp_record{
      USINT     dp_MAGIC,
                dp_VERSION;            /* Host sw version */
      USBYTE    dp_RS232_ON;           /* rs 232 switch */
      USINT     dp_HORXCC;             /* RX "character count" */
      USBYTE    dp_HORXFI[HORXFL];     /* RX "fifo" */
      USINT     dp_HORXIP,             /* RX "input pointer" */
                dp_HORXOP,             /* RX "output pointer" */
                dp_HOTXCC;             /* TX "character count" */
      USBYTE    dp_HOTXFI[HOTXFL];     /* TX "fifo" */
      USINT     dp_HOTXIP,             /* TX "input pointer" */
                dp_HOTXOP;             /* TX "output pointer" */
      USBYTE    dp_space[xxx],
                dp_parameter_portA[xxxx],
                dp_parameter_portB[xxxx],
                dp_reserve[xxx],
    };  /* total 8 kb */

    typedef union {
      struct dp_record dprec;
      unsigned char dpflat[DP_BLOCK];
    } dpram_type;

    /* VANESSA specific addresses            */

    int ledio_adr[] = {0x306,0x307,0x30E,0x30F,0x316,0x317,0x31e,0x31f,
                  0x126,0x127,0x12E,0x12F,0x136,0x137,0x13E,0x13F};

    --------------------------------------------------------------------
    For the understanding are the following declarations:
    Per Host-Computer a maximum 8 Vanessa Cards can be addressed in Address 
    Space 0xD000:0 to 0xDFFF:F. Each Vanessa occupies 8 kb (0X1fff) DP-Ram 
    Per Vanessa 2 AX25 Channels (Port A,B) can be addressed. All odd 
    Channel Numbers go to Port A, all even to Port B. With that is possible 
    in an elementary manner, to select the desired Channel. 
    Each 2 AX25 Channels (A,B) employ the same Ring-Buffer in the DP RAM 
    (HORXFI,HOTXFI). The two Pointers HO?XIP,HO?XOP designate the Offset to 
    the beginning of the Buffer. The character series HO?XCC will not be 
    used! 


 
    Parameter
    ---------
    The transfer of the Parameters (TX Delay etc.) do not follow via 
    Hostmode Commands but parallel in the DP RAM Structure, separated per 
    Port. For Debug purposes are placed a few interesting Variable (e.g. 
    free Buffers), so that the Host Computer can taken over directly. As an 
    additional Parameter is planned the die Bit-Rate per Port, which then 
    can be set from the Host in the range 1200 - 19200 bps. 


    I ask you for a comment and eventually further inspirations to the 
    Theme. I will send you directly the Eprom Code as well as my Test-
    Routines by Disk in the next few days. 

    vy 73 de Peter HB9PAE @ HB9AJ    

    1. General
    ----------

    In the following an Interface Protocol VANESSA - PC (Host) Computer 
    will be described. Based on the existing Hardware VANESSA from the 
    SEPRAN of the SWISS ARTG an efficient TNC substitute for applications 
    such as DieBox or as TNC substitute for Users should be developed. As 
    Firmware the Vanessa Front-End-Computer will input a Host Mode 
    compatible Software. 

    2. Data Exchange
    ----------------

    The exchange of Data between Host Computer and Vanessa follows via the 
    DUAL PORT RAM, on which both Processors (PC and Vanessa) have access.
    
    The Data will be delivered in two circular Ring-Buffers. For the Data 
    direction HOST > VANESSA is planned the IN_BUFFER and for the direction 
    VANESSA > HOST the OUT_Buffer. 
        
    3. Hardware
    -----------

    This is available 8 kB DP-RAM per Vanessa, which is mapped in the PC 
    Address Area from )xD000:0. On grounds of the existing Address Logic 
    a maximum of 8 Vanessa Boards are possible (corresponds to 16 physical 
    AX25 Channels). 

    As an external optical Status display each Board has 2 LED's activated 
    via I/O Addresses.

    Per DP RAM Block will serve 2 physical AX25 Ports.



    4. Hardware Addresses
    =====================

    4.1 DP-RAM
    ----------

    Vanessa Board No. 0 0xD000:0 - 0xD000:2FFF

    Vanessa Board No. 1 0xD200:0 - 0xD200:2FFF

    Vanessa Board No. 2 0xD400:0 - 0xD400:2FFF

    Vanessa Board No. 3 0xD600:0 - 0xD600:2FFF

    Vanessa Board No. 4 0xD800:0 - 0xD800:2FFF

    Vanessa Board No. 5 0xDA00:0 - 0xDA00:2FFF

    Vanessa Board No. 6 0xDC00:0 - 0xDC00:2FFF

    Vanessa Board No. 7 0xDE00:0 - 0xDE00:2FFF

    
    4.2 LED Addresses
    -----------------  

    LED 1     Board No. 0...3:    0x306 + (Board No. * 0x08) 
              Board No. 4...7:    0x106 + (Board No. * 0x08)

    LED 2     Board No. 0...3:    0x307 + (Board No. * 0x08) 
              Board No. 4...7:    0x107 + (Board No. * 0x08)

    [Board No: 0...7]


    5. DP-RAM Structure
    ===================

    The Data Structure of the DP-RAM for each 2 physical Channels is 
    partitioned as follows: 



    struct DP_RAM
         int  MAGIC_No,           /* Magic word */
              Version,            /* Firmware Version */
              IN_Head_Ptr,        /* Write Pointer IN_Buffer */
              IN_Tail_Ptr:        /* Read Pointer IN_Buffer */
         char IN_Buffer[2048];    /* VANESSA > HOST */
         int  spare;

         int  OUT_Head_Ptr,       /* Write Pointer OUT Buffer */
              OUT_Tail_Ptr;       /* Read Pointer OUT Buffer */
         char OUT_Buffer[2048];   /* HOST > VANESSA */
         int  spare;                   

         int  Param_PortA[50],    /* Persist, TX Delay ect */
              Param_PortB[50];

         int  Status_PortA[50],   /* Status der logischen Kanle*/
              Status_PortB[50];        

         int  Status_Common[50];  /* common Status, buffers ect */

    Total 8192 Bytes


    6. Buffer Organisation
    ======================
    The Organisation of the Data Buffer follows with the Head and Tail
    Pointer. The Head- / Tail-Pointer indicates the actual Position 
    within the individual Data Buffers relative to the Buffer-Beginning. 
    The OUT_Head_Ptr as well as the IN_Tail_Ptr will be exclusively 
    altered from the HOST Processor, the OUT_Tail_Ptr and the IN_Head_Ptr 
    from the FP VANESSA. 

    Data from the Host to the die VANESSA will be passed to the OUT_Buffer 
    and the OUT_Head_Ptr passed afterwards. Data to the Host Computer will 
    be passed afterwards from the FP to the IN_Buffer and the IN_Head_Ptr.
    
    Convention

    Buffer empty   IN_Head_Ptr    ==   IN_Tail_Ptr
                   OUT_Head_Ptr   ==   OUT_Tail_Ptr
       
    Bufer full     IN_Head_Ptr  + 1    ==   IN_Tail_Ptr
                   OUT_Head_Ptr + 1    ==   OUT_Tail_Ptr

    The Pointer designates the last read (Tail) respectively the next to 
    last described (Head) Buffer Position.

    
    7. AX25 Channel Allocation
    ==========================

    Each FP VANESSA occupy 2 physical AX25 Channels (A und B). The Data 
    exchange with the Host Processor follows via the same Buffer-Block in 
    the DP-RAM Block. Each physical Channel by that is assigned 10 logical 
    Channels so that a total of 20 Logical Channels can be addressed. Out 
    of sight of the Host Computer all even Channel Numbers (0,2,4..) will 
    be conducted to Channel A all odd Numbers to Channel B. Channel 0 is 
    the Monitor Channel.

    Translated by G0KIU @ GB7MAM
