NETUS-Bee
=========

The main design is based around two chips, the RTL8019AS for EtherNET and the ISP1160 for USB.  They are selected via Atari address pin A15.  Set A15 to 0 for Network, or set A15 to 1 for USB.

Read and Writes are done to these chips must only be done with read cycles when writing the driver programs.  To write a read is done, while passing data over the address lines.  As a general rule, reads take place on 0xFAxxxx and writes on 0xFBxxxx.

        NETWORK           USB
      ===========       =======

A15   0 for Network     1 for USB

A14   no function       1 for USB Command or 0 for USB Data access

A13   Network a4        no function 
A12   Network a3	no function 
A11   Network a2	no function 
A10   Network a1        no function 
A9    Network a0        no function 

A8    write data d7     write data d7(d15)
A7    write data d6     write data d6(d14)
A6    write data d5     write data d5(d13)
A5    write data d4     write data d4(d12)
A4    write data d3     write data d3(d11)
A3    write data d2     write data d2(d10)
A2    write data d1     write data d1(d9)
A1    write data d0     write data d0(d8)

A0    unused            unused


Network Data Reads
==================

Reads from network are done at base address 0xFA0000 (activating a read cycle) as a 8bit byte.  Data appears on D8-15.


Network Data Writes
===================

Reads at base address 0xFB0000 actually cause data to be written.  Your data should be placed on the address bus from A1-A8.  Your 8 bits of data needs to be shifted left once and added to 0xFB0000 to make it appear on A1-A8.


Network Register/Command Reads
==============================

The lower 5 bits (0x00-0x1F) of the RTL8019AS are connected to the Atari A9-13 as they are used to access registers inside the RTL8019AS.  Any addresses to access registers need to be left shifted by 9.  Any data read back, ie status will appear on D8-15.
Base address is 0xFA0000


Network Register/Command Writes
===============================

The lower 5 bits (0x00-0x1F) of the RTL8019AS are connected to the Atari A9-13 as they are used to access registers inside the RTL8019AS.  Any addresses to access registers need to be left shifted by 9.  Any data to be written with the register access should be placed on A1-A8.  Base address is 0xFB0000



USB Data Reads
==============

Data Reads from USB are done at base address 0xFA8000 (activating a read cycle) as a 16bit word.  Data appears on D8-15 as most significant byte, and D0-7 as least significant byte.  Notice how A15 has to be set to 1 to make it a USB cycle.


USB Data Writes
===============

Data reads at base address 0xFB8000 actually cause data to be written.  As the write interface is only 8 bits wide, the 16bits of data must be passed through this "8 bit window".  The Least Signifant Byte is transferred first by left shifting data once and added to 0xFA8000.  This is followed by the Most significant byte, transferred by left shifting data once and then added to 0xFB8000.  On this last cycle is where the transfer is actually done.  Notice how A15 has to be set to 1 to make it a USB cycle.



USB Command Writes
===========================

Data reads at base address 0xFBC000 actually cause a register/command to be written. The 8bit byte is transferred by left shifting data once and added to 0xFBC000. Notice how A15 has to be set to 1 to make it a USB cycle, and A14 set to make it a register/command access.


USB Driver Please note:
A small delay in the region of 300ns should be given between a register/command and data access on USB.  This can simply be a couple of NOPs.


On the USB, a complete register access comprises of a command phase then a data phase.





