Author Topic: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL  (Read 3374 times)

0 Members and 1 Guest are viewing this topic.

Offline grips03Topic starter

  • Contributor
  • Posts: 40
I have a small logic circuit using Xilinx CPLD that is used for a video game controller. I would like to add rapid fire in the CPLD if that is possible.

Logic:
Rapid fire button = pulled high
Rapid fire button pressed (ground)
then output pin 6 and 8 would go low, then high Z, then low, then high Z....repeat

Outputs are high Z today. I just need something that goes high and low at a certain frequency and then feed it into the OR gates that control the logic.
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4263
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #1 on: October 06, 2013, 08:10:23 am »
I don't doubt it's possible unless all the logic cells in the CPLD are already in use - but we'll need to know a bit more about what it is you need before anyone can usefully help.

What experience do you have programming CPLDs? Do you already have the Xilinx tool chain installed, experience in VHDL or Verilog, and access to the existing source code? Do you first need to reverse-engineer and replicate the behaviour of the existing device?

Offline arkanix38

  • Contributor
  • Posts: 11
  • Country: au
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #2 on: October 06, 2013, 11:23:51 pm »
You don't necessarily have to utilise the CPLD to do the job. If you are using PWM on an LED in the controller you can just have a switch running in parallel to the ground of the firing switch. This is a common method in Xbox360 controllers.

Alternately you can have a 555 timer (perhaps emulated in the CPLD?) to allow a varying firing rate.
 

Offline grips03Topic starter

  • Contributor
  • Posts: 40
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #3 on: October 07, 2013, 12:46:06 am »
I can program Altera and Xilinx CPLDs as I have tools and I've used them before - this weekend in fact, but again only for digital logic stuff - not, or, nand, and, etc. Today I use the schematic editor as I don't know Verilog or VHDL. I suppose I could learn if it made the project easier to implement.

For this controller I have one spare pin on the cpld. Plan was to use this an input, i.e. press button on this input and it would provide rapid fire. I'm just not certain how to use the internal clock to drive this or how to change the clock frequency. I guess if I had a CPLD designable circuit that could generate and change the clock frequency I could adjust to meet the requirement.
 

Offline NoNRG

  • Newbie
  • Posts: 6
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #4 on: October 07, 2013, 04:57:40 am »
For this controller I have one spare pin on the cpld. Plan was to use this an input, i.e. press button on this input and it would provide rapid fire. I'm just not certain how to use the internal clock to drive this or how to change the clock frequency. I guess if I had a CPLD designable circuit that could generate and change the clock frequency I could adjust to meet the requirement.

The internal clock can be tied to a process that includes the push button input. Are you trying to decrease or increase the clock rate? Either is possible, but decreasing the clock is easier (simple clock divider).
 

Online AndyC_772

  • Super Contributor
  • ***
  • Posts: 4263
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #5 on: October 07, 2013, 06:27:50 am »
Using the schematic editor is making life difficult for yourself, you'll find learning VHDL or Verilog will ultimately save you a lot of time and give you much better control over what's going on inside the device. I highly recommend it as a worthwhile exercise.

Before you can add features to the CPLD you'll need the current firmware as a starting point. Without this, you'll need to first reverse-engineer everything else it's doing and produce yourself a schematic (or, preferably, HDL source code). Once you have that, adding the extra feature you want will be trivial.

Offline grips03Topic starter

  • Contributor
  • Posts: 40
Re: rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
« Reply #6 on: October 07, 2013, 01:22:46 pm »
I have the current software in Verilog and in schematic form as I made the PCB and designed the current circuit. This is just adding one more feature.

I'm going to check out Xilinx website I bet the have an example of using the internal clock.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf