Go to notes and algorithms index. ~ Go to home page.

dsPIC Simple B&W PAL Video output Assembler Program. 30MIPS.


This is a simple assembler program to produce a test black and white video output from a dsPIC mircocontroller. It doesn't do anything apart from that but it would be a good start for anyone who wanted to develop video applications on dsPIC chips as the interlaced video timings are quite tricky to get right.

I wrote this program to see if it was possible to produce video output pretty much by software alone from a dsPIC chip without any extra video chips etc (except for a simple D to A converter)... partly just for the hell of it.... plus the fact that it would open-up possibilities for making more ammusing gadgets...for example a remote control unit for your telly with on screen confirmations and acknowedgements...

... what I really fancied doing with this project (but I'll probably not ever get the time to do) is to use it to make a gen-lock device that sits between your free-view or setelite receiver box and your TV. IT would have a SCART in and a SCART out and work off, and add to, the RGB signal. It would be the 'base station' for a TV remote control system. The hand unit that send the infra-red signal to change TV channels etc would also be a light gun (like you use on video games like Virtua Cop). The hand unit would not only allow you to change channel but if some charater on some bad soap opera is annoying you you can simply shoot them! When you shoot the gen-lock unit in the base station would put an explosion or something like that in that position....it would be very satisfying I think to 'shoot' polititions you don't like or add you hot led to a western shoot-out. I don't think it would be difficult to get it to use hardware interrupts controlled by the video and line sync from the set-top box for timing instead of using timers.

The output is 1bit B&W, and making a colour composite video signal would be a lot more involved, and anyway, in the UK atleast, colour composite video is going out of fashion fast... RGB is much prefered (if the video signal is to be analogue at all that is), so if I was to further develop the project to be colour I would have gone the RGB route (a lot easier -- like 3 monchrome signals).

To my surprise someone else, Rickard Gunée, had done this many years before me and made some one chip video games -- see Rickard's web site for a real treat. The PIC Ricakrd used was probably the fastest one available at that time, the newer dsPIC chip I used is is faster and has more features and it does not really need to be over-clocked for a reasonable resolution black and white output, but probably could do with over clocking if you want to output colour RGB (in which case the timings in my program would have to be changed).

I used the method of wiring-up the monochrome video ouput via a couple of resitors from Rickard's web site, since I never really found a simple D to A converter that exactly fitted my requirements.

This assember program is written under the Microchip assembler IDE for dsPIC chips. I used the dsPIC development board to test it. I seem to remember it ran at 30 MIPs I'll write some more explaination on this when I get time and do a simple curcuit diagram. I'll take a screen-shot of the ouput and stuff too... but in the meanwhile if you have any questions about it drop me an email and I'll dig some stuff-up about it.

Down load source files.