Product Information  
Product Groups Price/Buy Shopping List Home
Back button   Next button
 
IOTester-USB Example 2
Enabling the External bus

The program example configures IOTester-USB pins for use as an external "processor bus" with these characteristics:

  • 8-bit data bus
  • 8080 bus type control signals using /RD, /WR clocks
  • /CS chip select
  • /RES negative reset
  • Only the 8 lsb bits of 24 possible address bus bits are routed to external pins (saving pins for other purposes)
  • An alternativ bus layout configuration is used. Enable all 20 external bus signals to be located one the same connector.
  • The remaining IOTester pins are I/O port pins (default)


#include <iotester.h> // Define IOTester functions and symbolic names for internal registers
void main(void)
   {
   // Init IOTESTER driver, search for any IOTester connected to the PC
   if (iot_init(0))
      return; // Could not connect

   // IOTester connection OK
   // Configure IOTester for an External bus mode (all bus signals located on J1).
   // 8 bit data, 8080 bus type, 8 bit external address bus, alternative pin layout
   iot_wr( IOT_PIN_MODE_REG, DBUS8 | DBUS8080 | ADRBUSSIZE(8) | ALTBUS);

   // The reset pin is an I/O pin pre-configured to be output.
   // Toggle the pin low and high to reset any external hardware.
   iot_wr( IOT_IOCLR_REG1, ~IOT_RESET_BIT ); // /RES pin is low

   // Perhaps add some delay here

   iot_wr( IOT_IOSET_REG1, IOT_RESET_BIT ); // /RES pin is high

   // Loop and write to device on external bus
   for (;;)
      {
      iot_wr( 0x00, 0xff ); // Write 0xff to address 0
      iot_wr( 0x23, 0x00 ); // Write 0x00 to address 0x23
      }
   }


Links to:
IOTester tool description
Example 1: Start using IOTester I/O port pins - "Single chip mode"
Example 2: Enabling the External bus
Example 3: Using Internal Devices and External bus.
Example 4: Using Target Interrupt.
Example 5: Writing portable I/O driver source code with <iohw.h>
Example 6: <iohw.h> implementation methods and definition of I/O registers
Example 7: Swapping source code between PC and target platforms

 
  Copyright © 2010 RAMTEX International ApS. All rights reserved.