Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20705 Discussions

How to read data from expansion headers on DE2

Altera_Forum
Honored Contributor II
1,096 Views

Does anyone know how to read data from the expansion ports on the DE2 board? The expansion port has 36 data pins but in Quartus II, I can only configure a PIO port to be 32 bits wide. Does each bit correspond to a expansion port pin (ie GPIO_0[0])? 

 

Simply put, how do I write or read a 1 or 0 on just one data pin on the expansion port (ie GPIO_0[0])? 

 

Thanks!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
261 Views

 

--- Quote Start ---  

Does anyone know how to read data from the expansion ports on the DE2 board? The expansion port has 36 data pins but in Quartus II, I can only configure a PIO port to be 32 bits wide. Does each bit correspond to a expansion port pin (ie GPIO_0[0])? 

 

Simply put, how do I write or read a 1 or 0 on just one data pin on the expansion port (ie GPIO_0[0])? 

 

--- Quote End ---  

The SOPC builder component may only allow you to configure a single PIO component as 32-bits wide, since that is the width of processor accesses. However, there is nothing to stop you having more than one PIO port in your design. For example, you can have a 32-bit port plus a 4-bit port, or you could have multiple 8-bit ports. Its up to you. 

 

To control 1-bit, create a 1-bit PIO, or a 32-bit PIO, and just wire 1-bit to the GPIO pins. 

 

Keep in mind than an SOPC system is just a component, and you can connect it to anything you like, so if you have an example working that can toggle an LED, just change the pio_led port to control pins in gpio_a (or whatever the GPIO pins are called in your design top-level file). 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
261 Views

Thanks for the reply!

0 Kudos
Reply