AN 494: GPIO Pin Expansion Using I2C Bus Interface in Altera MAX Series

ID 683261
Date 9/22/2014
Public

1.3.1. Design Demonstration on the MDN-B2 Demo Board

To demonstrate this design on the MDN-B2 demo board, perform the following steps:

  1. Turn on the power to the demo board using the slide switch SW1.
  2. Download the design to the device through the JTAG header JP5 on the demo board and a conventional programming cable (ByteBlaster™ II or USB-Blaster™).
  3. Keep SW4 on the demo board pressed before and during the start of the programming process. After programming, turn off the power and remove the JTAG connector.
  4. To set up a parallel port driven I2C environment on your PC, perform the following:
    1. Download a software utility, such as the Maxim parallel port utility, to communicate with the slave in the I2C defined protocol. Install the parallel port software. (The ParDS2W.exe program downloaded from parallel port software from Direct-IO is used in this example.)
    2. You must install a parallel port driver to enable access to the parallel port in Windows XP or Windows 2000 for this parallel port utility.
    3. After installation, you must configure the Direct-IO program. Open the Windows control panel and click the Direct IO icon. Enter the Begin and End addresses of your parallel port (normally, this is 378 through 37F; however, confirm your PC's parallel port address by looking at the settings in Control Panel/System/Hardware/Device Manager/Ports/ECP Printer port (LPT)/Resources
    4. Configure the parallel port to ECP by changing the BIOS settings when you start up your PC.
    5. Next, select the Security tab of the Direct IO control panel and browse to the directory path of the ParDS2W.exe program. Click Open and then click Add to add the program. The path of this utility is shown in the Allowed Processes field. Click OK.
    6. Attach the parallel port I2C dongle that is supplied along with the MDN-B2 demo board. Use an extension chord, if necessary, to extend the parallel port connection closer to your demo board.
    7. Attach the 4-pin socket on the pig tail of the I2C parallel port dongle to the I2C header (JP3) of the demo board so that the red mark on the socket meets pin 1 on the JP3 header.
    8. Open the ParDS2W program, select the appropriate parallel port address of your PC (as seen when configuring Direct IO) and set the 2-Wire Device Address to 00h.
    9. Finally, you can test the I2C setup on the Test Circuit tab to see if you have a Test PASS message in the Status window. If you do, the I2C environment is set.
  5. With the parallel port utility you can now perform write and read operations in I2C using the 2-Wire Functions.
  6. To perform a write I2C operation, click Start and then click Write Byte. Enter a hex byte in the field adjacent to Write Data and click Write Data. Observe the corresponding value on the eight red LEDs. Click Stop after each write operation.
  7. Similarly, a read operation is performed by clicking Start and then Read Byte. The Read window displays the settings on the SW5 dip switch on the demo board. Click Stop after each read operation.