The microcontrollers of today are in many ways superior to the simple eight bit computers that I learned to program as a teenager, but one way in which most of them are decidedly inferior is that they have only a very limited number of actual peripherals. After all, even my simplest Atari 400 back in 1980 could be hooked to a television and display text and graphics. But there is something good about these microcontrollers: they are quite a bit faster than these old chips, and they are lots cheaper.
This means that it’s possible to generate video not by the usual method of having dedicated computer hardware, but by “bit-banging” the video signal directly with carefully written code with timing. Many Arduino users have seen the “TV out” library for the Arduino, which does precisely this, if you haven’t check out this old video of mine where I demonstrate it.
But that library has two major problems. It’s very low resolution, and it’s hard to use with libraries that may screw up it’s video timing (such as the library that allows you to read PS/2 keyboards).
But there is another cool idea: use a separate Atmel AVR chip as a dedicated processor to generate video. This is the approach that the Batsocks Tellymate Shield uses. If you want, you can buy a kit from them for an Arduino shield, which would be very convenient. It basically implements a simple serial terminal which implements VT-52 like command codes, which makes it very simple to program. And because it is entirely separate from the main Arduino, it generates stable video without any of the timing problems that using TVout can have. Oh, and because it is very cleverly written, it can do higher resolution video (25 lines of 38 characters).
A very cute gadget. What’s even more awesome is that you can breadboard one of these things very, very simply. I had an old ATmega88 sitting in a drawer. If you don’t need full RS232 voltage levels (like, for instance, driving it from the Arduino serial ports) then the only thing you need are two resistors, two diodes, and a smattering of capacitors. I programmed my Arduino to serve as the ISP, flashed the firmware into the chip (the authors nicely include versions for a wide variety of Arduino chips), reprogrammed the fuses to use the external crystal, and then breadboarded it up. And then, after powering it up, well, nothing. I hauled out my scope. Was serial data going to the board? Yep. Anything like a signal coming out? Nope. Wait, it looks like something varying from 4.5 to 5.5 volts? Ooops. Loose ground wire. Fixed that. Working? Nope. Recheck pins. Doh! Outputs are on pins 15 and 17, not 16 and 18. Fixed that, and….
It works.
Success!Breadboarded a Tellymate and hooked it to my #arduino. twitter.com/brainwagon/sta…
— Mark VandeWettering (@brainwagon) March 7, 2012
If you need a simple video interface for an Arduino project, you can easily build this interface on a breadboard, a chunk of protoboard, or you can get various version with differing capabilities from the creators. But try it out: it’s a cool little gadget.
Obligatory Propeller rant.
It turns out that each of the 8 cores in the Propeller chip has a bit of video hardware associated with it. You don’t need an extra micro to generate video – it’s already there.
And hey, a datasheet! I hadn’t noticed this before.
http://www.parallax.com/portals/0/help/P8X32A/Propeller%20P8X32A%20Datasheet%20v1.4.pdf
Yeah Doug, a Propeller has all sorts of stuff useful for generating video signals. They are so good at that in fact that I’m pondering dedicating a propeller for that purpose if I ever get my “homebrew sixty five oh two” project off the ground. The basic idea would be to use a modern, 14Mhz 6502 as the main processor, but to implement most of the peripherals (keyboard, video, and maybe even flash disk) as software on the Prop.
That sounds pretty cool!
Are you aiming at emulating the 8-bit Atari computers eventually?
This could be a display, maybe:
BTW, I used a Gadget Gangster’s Boss Board to build my sounding rocket payload. It was just the thing – lots of prototyping space.
Sorry, malformed link.
This could be a display, maybe:
http://www.gadgetgangster.com/index.php?option=com_content&view=article&id=56&projectnum=162