[newbie] logicstart megawing: not enough input switches (i need more!)


flag26838

Recommended Posts

As the subject says, i'm a newbie learning fpga and vhdl programming and i need more than the 8 input switches provided by my logicstart megawing and i was wondering if anyone had already faced this problem and how you solved it.

 

These are some ideas that i had to increase my "input bus" width:

 

1) first i thought about connecting some switches to the adc connectors, but in that case i would need a working spi decoder first - this one it might end up being a good vhdl coding exercise

 

2) i can use the mini joystick as another source of inputs (4 positions => 2 input bits)

 

3) ???

 

 i would love to reach 12 or even 16 bits of input without resorting to soldering or any other permanent mods, do you have any idea how to achieve it?

Link to comment
Share on other sites

Some ideas, many of them depend on what you want to do with those extra slide switches, and on how advanced you are in all this.

 

1. You can get more than 2, up to 5 bits out of the mini joystick if you're willing to put up with some inconvenience to the user (you), and losing some of your LEDs.  The idea would be to have "virtual slide switches" (registers on the FPGA) and each of the five momentary contacts would flip the corresponding switch.  The two main requirements are: (i) debounce (so that they don't flip twice) and (ii) use an LED to show the state of each virtual switch.

2. If you just want to get data in (or out) of the Papilio, and don't need it to be switches, buttons, etc, then one option is to go over the USB cable from your PC.  Implementing a serial port from scratch might be a little tricky, but there are also pre-made cores available for that.  You might look at http://opencores.org/project,uart2bus; I haven't tried it myself, but it seems similar to (and a bit better than) what I've been using.  The idea is that UART-to-Bus treats your design like memory; you then decode, this address refers to one of your signals, that address refers to another one, and so on.

3. Regarding your ADC idea, you can also get a working SPI implementation from somewhere if you don't want to make your own.  For instance, there's one in chapter 24 of Hamster's "Introducing the Spartan 3E FPGA and VHDL" ebook.

 

I'm curious what you want to use all those slide switches for.

Link to comment
Share on other sites

The virtual instruments proposed for implementation in DesignLab might help? It would be switches on your computer monitor that would communicate to your board over the JTAG port and would show up in your circuit as a schematic symbol you can connect to. 

 

It is something that I have put on the back burner for DesignLab while I work on getting everything else in place. If it is something that you can really use then I can put together a DesignLab library for you but I don't have much time to provide support for it yet...

 

Jack.

Link to comment
Share on other sites

You can do this - http://forum.gadgetfactory.net/index.php?/page/articles.html/_/papilio/logicstart-megawing/using-just-the-switches-and-leds-on-the-logicst-r56 - and then you have 16 spare I/O pins where you can connect up more switches and LEDs using jumper wires (or Button wings).

 

Amazing, i didn't know i could hook it that way, i'll give it a shot!

Link to comment
Share on other sites

Some ideas, many of them depend on what you want to do with those extra slide switches, and on how advanced you are in all this.

 

1. You can get more than 2, up to 5 bits out of the mini joystick if you're willing to put up with some inconvenience to the user (you), and losing some of your LEDs.  The idea would be to have "virtual slide switches" (registers on the FPGA) and each of the five momentary contacts would flip the corresponding switch.  The two main requirements are: (i) debounce (so that they don't flip twice) and (ii) use an LED to show the state of each virtual switch.

2. If you just want to get data in (or out) of the Papilio, and don't need it to be switches, buttons, etc, then one option is to go over the USB cable from your PC.  Implementing a serial port from scratch might be a little tricky, but there are also pre-made cores available for that.  You might look at http://opencores.org/project,uart2bus; I haven't tried it myself, but it seems similar to (and a bit better than) what I've been using.  The idea is that UART-to-Bus treats your design like memory; you then decode, this address refers to one of your signals, that address refers to another one, and so on.

3. Regarding your ADC idea, you can also get a working SPI implementation from somewhere if you don't want to make your own.  For instance, there's one in chapter 24 of Hamster's "Introducing the Spartan 3E FPGA and VHDL" ebook.

 

I'm curious what you want to use all those slide switches for.

 

1 is doable but is a bit tedious to use

 

2 is overkill for my learning exercises

 

3 i'll give it a look

 

i need more inputs to implement the exercises found in the book "FPGA PROTOTYPING BY VHDL EXAMPLES" from Pong Chu - registers, primitive data type (fifo, stack, etc), silly examples using the ssegs, etc - i'm still at chapter 4 :)

Link to comment
Share on other sites

The virtual instruments proposed for implementation in DesignLab might help? It would be switches on your computer monitor that would communicate to your board over the JTAG port and would show up in your circuit as a schematic symbol you can connect to. 

 

It is something that I have put on the back burner for DesignLab while I work on getting everything else in place. If it is something that you can really use then I can put together a DesignLab library for you but I don't have much time to provide support for it yet...

 

Jack.

 

Thanks Jack, but don't waste your time, i was able to squeeze in more bits using the mini jostick and so far i'm good 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.