TechSpot

How to perform 32 bit IO Opertion on 16 bit machine

By rajesh.v
Dec 3, 2006
  1. Hello,


    I want to perform a IO write of 32 bits on a 16 bit machine. So, I tried
    to IO write 16 bits in 2 cycle using outport function i.e.

    outport(port, ValueLower);
    outport(port + 2, ValueHigher);


    In doing so, only the value written during the second cycle is in effect i.e the
    value (ValueHigher) written to (port + 2) exists. But, the value (ValueLower)
    written to (port) does not exists (...some junk value is present at the lower 2 bytes).

    Is there any way I can perform a 32 bit IO Operation on a 16 bit machine.

    Thanks in Advance,
    Rajesh.V
     
  2. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    It would sort of help if we knew what kind of machine and hardware you are talking about and what kind of development environment..
     
  3. rajesh.v

    rajesh.v TS Rookie Topic Starter

    Hi,

    I am using DOS system/ 8086 processor and turbo C compiler. The IO device which is used is ethernet controller "Reatek 8139".
     
  4. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    First, x86 hardware IO does not look like memory. A word written to port X does not magically appear in ports X and X+1. When you write to a port, the port address goes on the address bus and the data goes on the data bus. When a device see its own IO address on the address bus, it grabs the data from the data bus and copies it to its internal register.

    It looks like the 8139 is a 32-bit chip, so you can't interface it directly with a 16-bit bus. You'd need some sort of glue logic that would take the high word from port address X and the low word from port X+1 for example.
     
  5. rajesh.v

    rajesh.v TS Rookie Topic Starter

    Thanks for your response....

    I don't understand what was the glue logic which is spoken about...

    Moreover, I am using a PCI bus which is 32 bit... so, doesn't this help me to interface with the 8139 chip...
     
  6. Nodsu

    Nodsu TS Rookie Posts: 5,837   +6

    And how have you connected the 32-bit PCI bus to your 16-bit CPU? Don't you have many wires left over? :p

    Any other "minor" hardware you haven't mentioned?

    Maybe you should just say what exactly you want to achieve and what hardware you have. Down to the last chip and PCB..
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...