flag26838

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

8 posts in this topic

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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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 :)

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now