PI

From Fpga4u

Jump to: navigation, search

Let's complicate things and use the parallel port. First the input, then the output and finally the two at the same time.

  1. Add a PIO with SOPC Builder: Other -> PIO and select inputs only

  2. PIsopc.jpg


  3. Select Quartus for the pin assignment, generate
  4. Update the block diagram, correct the inputs and outputs (they have moved after reloading). Add 8 switches on inputs; analyze, assign the remaining pins (use the excel file)

  5. PIblock.jpg


  6. Program the FPGA
  7. Modify the NIOS II IDE project to read the the switches and display the result on the stdout:
    1. include the "system.h" file
    2. add a pointer on the PIO base register (you can find all necessary information into the driver file: in the left frame, open "Device Drivers [SOPC Builder]" -> "altera_avalon_pio" -> "inc" -> "altera_avalon_pio_regs.h"
    3. print the value of the register

  8. PInios.jpg


Next: Parallel output (8 bits, leds)
Personal tools