News Button Separator General Button Separator   Tutorials Page Side Products Page Side Gallery   Button Forum Button About
General


GamerTheGreat.com - The Best Flash Games/Animations Portal for Great Gamers. Are you Great enough?



 
 

Pic-n-Pic TV Graphics/Game System


........................................
By VirusFree




Pic-n-Pic system is a simple project i did for my microprocessor course ( university of Patras )
The system uses 2 microcontrollers to render graphics and games on a TV using PAL format
Full source + the compiled file can be downloaded... Have fun :o)



 
1. Software does the job. Minimun hardware is needed

My goal in this project was to move the control of the rendering system entirelly to software.
Software handles everything, from syncronization pulses and clocks to the actual ouput of data.
What you need basicaly is 2 pic16f877a ( 40 pins ) , 2 small resistors , and a 20Mhz resonator/crystal


2. Why two microcontrollers?
Well , for speed. The thing works like nvidia's SLI. You get 2 separated processing units , that cooperate to get
the graphics drawn ( or calculated ). With a 20Mhz crystal and with the pic16f877a having 4 CPI ( cycles per
instruction), i can squeeze about 5 MIPS ( million instructions per second ) out of it, which is very low for our
purpose. Every scanline last for about 52us (microsecond) and during that time if the pic does nothing else other
than to draw a pixel on the screen using 2 instructions per pixel ( one to get it and one to draw ), it can draw about
100 pixels. But that leaves no time for anything else like calculating the next line , or any game/dynamic(sprites) stuff.
This is where the other pic comes in.. while the first pic is dedicated in drawing it's line , the second one calculates
what the next line will be.. once the first one is done , they switch control of the TV and the second one
starts drawing it's calculated line , while the first one is now calculating the next line that it will draw.

 

3. How do the two microcontrollers communicate?
The two microcontrollers use the hardware MSSP module that the pic16f877a offers, plus some signals for vertical and
horizontal syncronization . MSSP stands for Master Slave Syncronous Protocol , and it's a serial communication ( wire connections can be seen on schematics ). When the two microcontrollers run a game , they must syncronize there input
and game state. thats what happening during the little cycles of TV syncronization when there is some spare time until the
TV moves its electrone beam (CRT TVs) to the start of the frame.

 
4. How to achive analog voltages like 0 , 0.3 , 07 or 1 Volts?
You need this voltages for syncronization ( 0 - 0.3V) and drawing ( 0.3V black -> 1V white ).
I used two resistors to form a voltage divider, so depending on the combination of the voltages
the PICs give (0V and 5 V) it can achive these voltages.
 
 
The schematics
fgh
 
And a little video demonstration
.
 
 
 
fgh      Download Videos      fghj
 
 

fgh      Download Source Code & Compiled & Information      fgh

 


 



Basic Info about PAL

I used the europian PAL format. you can see a nice pic with it's basic specifications bellow



(i don't remember where i got this , so i can't link it )

Horizontal Syncronization








Vertical Syncronization




 
 



    Comments
 

 VirusFree - 3/20/2007 12:21:54 AM
   
 Post here any comments you may have about the project
 
 
   
 
 
 
 
Post Comment
You need to be a registered user to post a comment
 


Your Comment :

Your post may only
contain the [url],[img]
[quote] tags and smiles.

Syntax :
[url]address[/url]
[url=address]anchor[/url]
[img]address[/img]
[quote="nick"]text[/quote]

You are NOT logged in. You can Login or Register to phoenixbit.com


 
 

 
 





Tags : software, computer security , software developers , software programming , freeware programs , online games
.
 Copyright © 2007 PhoenixBit. All rights reserved
.