Electronics > FPGA
rapid fire for video game controller - in a Xilinx CPLD XCR3064XL
grips03:
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.
AndyC_772:
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?
arkanix38:
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.
grips03:
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.
NoNRG:
--- Quote from: grips03 on October 07, 2013, 12:46:06 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.
--- End quote ---
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).
Navigation
[0] Message Index
[#] Next page
Go to full version