PIC Microcontroller RGB Video – Animations!

Update: For those who are interested in seeing how this is done, I have posted schematics and source along with some technical details about this project.  Click here to learn more.

After two days of straight coding, this is the result – two more aliens and an animation routine that toggles between 2 images for each alien and changes aliens every n frames.  The alien selection routine is implemented as a state machine and uses way too many instructions, but fit within a blank line of video so I called it good.  The hardest part again was maintaining a constant number of clock cycles regardless of the program flow through the display loop.  This is required to maintain the video timing and keep the LCD happy.

I also changed the image lookup table routine so that the image to be displayed is loaded during the blanking interval above the top of the visible screen.  This makes the pixel display much more efficient during the field but at the cost of a bunch of memory.  Now instead of execution time during the horizontal line limiting the max resolution, it’s memory instead…  sometimes you can’t win.  If I encoded color more efficiently the memory limitation would go away.

I need to clean up the code and add some more comments, but I’ll post the source in case anyone else is interested in learning how to generate RGB video with a PIC or wants to try a similar project.

Update: The LCD display I am using is a Sharp 4L-U4EB I bought surplus years ago.  I haven’t been able to find any more of them since, does anyone have a source?

Here are some still images showing the animation sequence for each alien.  Click on each for a bigger version.

Still images from space invaders animation Red!

Still images from space invaders animation Green!

Still images from space invaders animation Blue!

Previous posts related to this project:

https://mightyohm.com/blog/2008/09/space-invaders/

https://mightyohm.com/blog/2008/09/generating-analog-rgb-video-with-a-pic-microcontroller/

Also check out my flickr set, PIC Microcontroller RGB Video.

6 thoughts on “PIC Microcontroller RGB Video – Animations!”

  1. I’m using an analog LCD, with 3 pins for Vr, Vg, Vb (0>5v for the intensity).
    My guess is that for digital LCDs, with 8bits per colour, you “just” have to use some kind of shift register to output the color information from the MCU, but that’s for a future case (sparkfun’s 1$ QVGA LCD)
    I still have to find more infos on what the pinout is (actually, I have the full pinout from the datasheet, but there are some things I don’t understand).
    Thanks for your help, looking forward to this new post ^^

  2. This LCD takes analog RGB so the video signal similar to NTSC composite video, except each color has a separate wire and the sync is also separate. Does your LCD have an analog or digital interface (8 bit bus or something similar?)

    I will post a full writeup with schematics and source, keep watching the blog.

  3. I’d really like to see a post about how you timed everything, which lines on the LCD you are using, etc…
    I’m currently working on a PVI LCD, and I really have hard time figuring this kind of thing out ^^
    (by the way, I work with an Arduino, so Atmel ^^)

  4. That’s the basic idea. Actually when I had originally envisioned this project, I was thinking of buying one of those track lighting systems from Ikea, and hanging these LCDs down, powered by the tracks. I bought two LCDs at the time, with the intention of buying several more if I ever made them work.

Leave a Reply