Pong Game

FPGA projects on this site, or abroad

Pong Game

Postby Ravi Kumar » Thu Oct 26, 2006 1:50 pm

Hello All,

I just started designing the Pong Game on FPGA. I need help from people who know how to implement it on FPGA and also the pitfalls faced.

I'll be eagerly waiting for your response.
Thank you all.
Ravi Kumar
 
Posts: 4
Joined: Wed Oct 25, 2006 4:54 am
Location: India

Postby Kristallo » Fri Oct 27, 2006 3:03 pm

Kristallo
 
Posts: 203
Joined: Mon Sep 20, 2004 3:25 am

Hi There,

Postby sandra » Sat Oct 28, 2006 5:44 am

Its nice to see some activity going here on Pong game....i am well into the development with some modifications...

1. what should be the clock frequency when i use 1024X768 resolution screen?

2.Can i Use the Laptop screen for displaying the game. If so, what r the precautions do i need to take.

3.How the refresh is done when there is a simultaneous request from the mouse and display.

4. Do we need any RAM to store the display information.

These r the things which r worring me since the past few days.....need some help!!!
sandra
 
Posts: 3
Joined: Sat Oct 28, 2006 5:30 am
Location: Illinois

Postby Kristallo » Sat Oct 28, 2006 12:24 pm

The frequency depends on the framerate. Google knows all about it.

You can use any screen you like but since you have to ask I doubt it is a good idea since it can be quite complicated to interface to it.

The refresh is done correctly.

You don't need RAM for pong unless the screen is updated in the wrong order. Pong was implemented with a handful of TTL chips originally.


It does not seem like either of you have read the page about pong or have understood how it works. Replicate exactly what is done on the page, don't change anything until it is working and you understand every part of it.
Kristallo
 
Posts: 203
Joined: Mon Sep 20, 2004 3:25 am

Postby Ravi Kumar » Mon Oct 30, 2006 8:59 am

I just went through the each and every aspect of the design. But I still got some doubts :

The working of the mouse is modified by using a NAND gate to generate the Quad Signals. If I have to use the normal mouse PS/2, how should i interface it to the Cyclone FPGA.
Ravi Kumar
 
Posts: 4
Joined: Wed Oct 25, 2006 4:54 am
Location: India

Postby Kristallo » Mon Oct 30, 2006 11:13 am

There is a reason the mouse was modified, it made everything much simpler. A PS/2 mouse uses a serial protocol that is a lot more difficult to decode. many people have done it before you so you should be able to find the code on Google.

http://www.google.com/search?q=ps%2F2+m ... ga+verilog
Kristallo
 
Posts: 203
Joined: Mon Sep 20, 2004 3:25 am

Postby Ravi Kumar » Tue Oct 31, 2006 4:50 am

Thank You Mr.Kristallo, You have been very helpful for me since i started working on the project.
The thing is, I have to submit this project to the course instructor by Nov-15th....Now i have finished all the theoretical work on this and i will dive into the real implementation on FPGA...

I want to make the paddle moment using 2 switches placed on the breadboard and connect them to the : Quad A and Quad B Signals.

What do u say about this!...I think it works right.

Waiting for u'r reply
Ravi Kumar
 
Posts: 4
Joined: Wed Oct 25, 2006 4:54 am
Location: India

Postby Kristallo » Tue Oct 31, 2006 10:27 pm

Using two swithes is an excellent idea that will work very well.

You need to divide down the system clock to get a suitable speed of movement. 50 Hz would be a suitable frequency to start with, it would make sure the paddle is controllable.

At every rising edge of the divided clock you check the buttons, if button 1 is pressed then PaddlePosition <= PaddlePosition - 1 if button 2 is pressed then PaddlePosition <= PaddlePosition + 1.
Kristallo
 
Posts: 203
Joined: Mon Sep 20, 2004 3:25 am

you r making the tasks simpler!

Postby sandra » Wed Nov 01, 2006 5:34 am

Hello all,

I did some home work by going thro the sites mentioned.I am keeping track of the things happening in this project.

The idea of using 2 swithces is nice but, I have some doubt in dividing the system frequency from 25MHz to 50 Hz....

How it can be achieved? can anyone suggest me a solution!

I am excited to know the solution, and I will try to implement using that procedure.

Thank u
sandra
 
Posts: 3
Joined: Sat Oct 28, 2006 5:30 am
Location: Illinois

Postby Ravi Kumar » Thu Nov 02, 2006 3:36 am

Its very easy to implement :

1. Use Frequency Dividers,
2. Counters

if u have any doubts u can feel free to ask me.
Ravi Kumar
 
Posts: 4
Joined: Wed Oct 25, 2006 4:54 am
Location: India

Postby Kristallo » Sat Nov 04, 2006 1:50 am

25 000 000 / 50 = 500 000
The nearest power of two is 2^19 = 524 288
So make a 19 bit counter and use the most significant bit as the clock for the buttons.
Kristallo
 
Posts: 203
Joined: Mon Sep 20, 2004 3:25 am

Multiple Ball Implementation

Postby sandra » Sun Nov 12, 2006 3:59 am

Hi There,

I need some suggestions:

1. How to Configure the IO pins of the FPGA [Cyclone-II], so that I can Connect the Push Buttons.

2. How to implement the multiple ball.

Please I need the information very urgently. There is no time left for me to submit the project in the School.

Thank u

sandra
sandra
 
Posts: 3
Joined: Sat Oct 28, 2006 5:30 am
Location: Illinois

Postby Flyan » Mon Oct 20, 2008 1:39 pm

THANKS FOR YOUR GAME!
I have a problem about these expressions:
if(~&PaddlePosition) PaddlePosition <= PaddlePosition + 1;
if(|PaddlePosition) PaddlePosition <= PaddlePosition - 1;
What do they mean?At which condition will the expression be ture?

Thank U!!!
Flyan
 
Posts: 1
Joined: Sun Oct 19, 2008 1:41 pm

programming pong

Postby omgineedhelpwithpong » Wed Dec 03, 2008 10:07 pm

hey so i am in a pickle. I have an Altera DE2 fpga board and am using the quartus 2 software. I'm using an lcd monitor and checked it with the fpga control panel to make sure it works fine. I got the code for the pong game from your site and compiled it fine but when i program it to the board nothing happens. any suggestions?!
omgineedhelpwithpong
 
Posts: 1
Joined: Wed Dec 03, 2008 10:03 pm


Return to General projects