This is where i got the inspiration for the pic VGA game console. Pretty crazy stuff that kid is doing... I just want to get something somewhat cool and interactive going.
So i have this thought: art through computer engineering. I'd like to create works of art that are smart, interactive, and programmable. Think of a coffee table sculpture version of pong. Or "Brazil"-esque terminal. One off, hand made systems. The possibilities are endless. Robots, got to do robots(cannibalistic of course;)... Just some thoughts as to where i'd like to go with my evilness.
Monday, January 12, 2009
PIC VGA update

So the pic wouldn't work on any monitor but my own. My monitor must be especially leniant because i was doing all of the timing wrong. WRONG!!
After a looking at the problem long and hard I came to realize i had missed something very important about VGA. The horizontal sync pulse must happen every 38.1 micro seconds, even in between active draw time. Before this realization, I was only pulsing HS during the 480 lines of active video and forgetting it during the vertical sync period.
A good example of this can be seen in this photo from http://martin.hinner.info/vga/640x480_60.html
So to remedy this i had to implement all the timing with a TMR0 interrupt. So every 381 instructions, TMR0 fires an interrupt, I pull HS low for 3.8 micro seconds, draw lines when needed, and pulse VS at the right time. Now the timing is very consistent and works on every monitor I have tried.
Another nice thing about using interrupts is that my program logic does not have to worry about timing. The logic just waits for drawing to stop with a loop. Then does its thing. Then waits in another loop for drawing to start.
Now I have a working pong game. It needs work, but this is a lot of progress in a few days...
Sunday, January 11, 2009
PIC madness
After enjoying home cooked setan cutlets stir fried with mushrooms with Nicole, she told me that after all: All Robots are Vegan! I like that. I'm not totally a vegan, or vegetarian by any stretch of the imagination. But i enjoy vegan food. It just makes you feel so good about yourself...
I've been working on a PIC based game console since thursday. After much tribulation, I have nice VGA output and input!
I used this info for the timing. My pic is a pic18f4550. It is running at 40mhz. So that makes every instruction cycle .1 micro seconds. I have it timed almost exactly to the specs. I used a scope to check it out at first. I found that microchip's ide's stopwatch was awesome for working out the exact timing.
Now to get pong or something going. YAY. I have about 14000 spare cycles during VSYNC. this should be enough to do some fun stuff. I'm running at 64X60 pixels. Stored bit by bit in 480 8bit registers.
more later...
I've been working on a PIC based game console since thursday. After much tribulation, I have nice VGA output and input!
I used this info for the timing. My pic is a pic18f4550. It is running at 40mhz. So that makes every instruction cycle .1 micro seconds. I have it timed almost exactly to the specs. I used a scope to check it out at first. I found that microchip's ide's stopwatch was awesome for working out the exact timing.
Now to get pong or something going. YAY. I have about 14000 spare cycles during VSYNC. this should be enough to do some fun stuff. I'm running at 64X60 pixels. Stored bit by bit in 480 8bit registers.
more later...
Subscribe to:
Posts (Atom)