video game system on pic18 ucontroller

22
Students: David Passov & Vladimir Gorelov Supervisor: Boaz Mizrachi Video Game System on PIC18 uController

Upload: felix

Post on 24-Feb-2016

42 views

Category:

Documents


5 download

DESCRIPTION

Video Game System on PIC18 uController. Students: David Passov & Vladimir Gorelov Supervisor: Boaz Mizrachi. Inspiration. UZEbox. The game institute - Hydra. Victor Timofeevs game console. Project Goals. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Video Game System on PIC18  uController

Students: David Passov & Vladimir GorelovSupervisor: Boaz Mizrachi

Video Game System on PIC18 uController

Page 2: Video Game System on PIC18  uController

Inspiration

The game institute - Hydra

UZEbox

Victor Timofeevs game console

Page 3: Video Game System on PIC18  uController

Building video game system capable of creating graphics and polyphonic sound using PIC18 microcontroller

Programming an old school Socoban game for the system ,creating image and sound using the above platform.

Project Goals

Page 4: Video Game System on PIC18  uController

uController Inputs and Outputs

Con

trol

s

Audio out

Video out

5V

supp

ly

Page 5: Video Game System on PIC18  uController

A highly popular Microchips PIC18 family controller was chosen for the task.

reducing line frequency required PLL support leaving us with PIC18F258, PIC18F2580 ,PIC18F2550 (which was chosen)

PIC18 family have maximum frequency of 10 – 12 MIPS, making the use of wire wrap method of construction possible instead manufacturing a PCB .

Choosing the Hardware

Page 6: Video Game System on PIC18  uController

Producing game video - raster scanVGA is normally operated at 60Hz rate.Each scan is composed from 525 lines from

which 480 carry image information.

Page 7: Video Game System on PIC18  uController

For a typical 60Hz VGA update rate and 525 scan lines, a single line scan time is given by: 1/60/525 = 31.74 µsec (25.17 µs for actual video data)

for operation frequency of 10 MIPS single instruction is carried out in 100 nsec ,so we can demand maximum horizontal resolution of 25.17/0.1 = 251 pixels per line

Producing game video

Page 8: Video Game System on PIC18  uController

Wait! At least one more instruction is needed to prepare each pixel before sending it to the monitor so the maximum horizontal resolution is cut by half!

Solution: using the USART built in module to store information about 8 pixels during 2 cycles and then use the remaining 6 to concurrently perform calculations .

Producing game video

Page 9: Video Game System on PIC18  uController

We choose to use tiles as the basic screen element (instead of a single pixel)

By considering the above we have chosen to uses tile size of 16x16 pixels.

Total tile number 30 x 15 tiles set on screen.

Producing game video – tiles

Page 10: Video Game System on PIC18  uController

We use the PWM module together with second order LPF as DAC to produce the game music and sound effects.

Digitized linear combination of sines is used to produce less artificial sounding audio.

Producing game audio

Page 11: Video Game System on PIC18  uController

Putting it all together-schematic

Page 12: Video Game System on PIC18  uController

Putting it all together-block diagram

controls

VGA out

Audio out

POR

Page 13: Video Game System on PIC18  uController

As mentioned ,the timing is critical for several tasks such as video output and sound generation.

A decision was made to use OSA open source OS.

A combination of interrupts and OS handled task is needed for providing desired results.

Software – os

Page 14: Video Game System on PIC18  uController

Aspects handled by interrupts Synch pulse generationRGB signal generationSound generationButtons read and de - bouncing

Aspects handled by RTOSAnimation formationGame algorithmSound change

Software – functional responsibility

Page 15: Video Game System on PIC18  uController

Software – block diagram

OSA RTOS

Task_Game

Task_sound

Task_Animate

Task_Music

Interrupt handler

Sync pulse

RGB signal

Sound generation

Buttons read and debounce

Page 16: Video Game System on PIC18  uController

Building -Hacking the PS2 mini wheel

Page 17: Video Game System on PIC18  uController
Page 18: Video Game System on PIC18  uController
Page 19: Video Game System on PIC18  uController

Task name Start finish statusProject definition

16.11 16.11 completed

Architecture characterization

16.11 23.11 completed

Design (Hardware & software)

23.11 14.12 Completed

Construction 14.12 26.2 In progressMidterm presentation

16.1 16.1 -

Hardware testing

26.2 5.2 -

Software development

26.2 20.3 -

Schedule

Page 20: Video Game System on PIC18  uController

Task name Start finish statusIntegration testing

20.3 31.3 -

Final presentation

10.4 10.4 -

Schedule

Page 21: Video Game System on PIC18  uController

For handling task rich embedded systems using concurrency and OS handled prioritized tasks is an elegant and useful solution.

Study main result

Page 22: Video Game System on PIC18  uController

Questions?