Composite video on AVR, part three

2012
29
April

After a few tweaks and a couple of minor changes, the video "driver" now supports two modes, graphics and now: text.

I'll admit it's not the most impressive text mode to this day, but it has 15x13 chars and supports smooth horizontal scrolling. Vertical scrolling will be implemented too, as well as various colors and a character set usable for "ascii art".

AVR video text mode

Now, more silence awaits. I'm off to a weeks vacation in VesterĂ¥len and won't be posting any updates for a while. Don't worry, I'll bring a laptop and will code some C64 demo effects while I'm there.


Composite video on AVR, part deux

2012
27
April

Now we're talking. The VSYNC is now rock steady, and the resolution is increased. Let's put the issue with variable pixel size aside, and gaze at this:

ATmega128 composite video

This is the beautiful Emma Stone, as seen in a 116x107 pixels framebuffer. I had to fight to squeeze all the data fit in 4K SRAM, so each byte stores four pixels, two bits each - AABBCCDD, consuming 3.1K in total. This is decoded and rendered 50 frames per second by the ATmega128.

As for visual size, I think this is as far as I can push it, considering that I need an actual uncompressed framebuffer to play with. With a little aspect correction, this should be perfect.


Composite video on AVR

2012
27
April

It's been a long time since I played with composite video signals. I usually only play with VGA signals, but last night I got a crazy idea (which I will outline later) where composite video was required.

I'm using a small 2.5 inch LCD monitor I bought several years ago. My micro controller is as always the trustworthy ATmega128, with two pins dedicated for video; PA0 with 1K resistor, and PA1 with 500R. Together the form a very simple DAC which provides four signals: HSYNC (0V), black (0.3V), grey (0.7V) and white (1.0V).

After a quick round in GIMP, I converted an image to a C header file with 3 colors. It's stored in RAM, so the image is actually a placeholder for the video buffer, which I will make use of later.

Here's the result after 1 hour worth of hacking. Not too shabby, although my VSYNC apparently needs some work, as you can see the upper part of the image is slightly skewed. The current resolution is 92x230 pixels using unoptimized C code on the ATmega128@16MHz.

It's a dream to work with composite video, compared to VGA.


What's new?

2012
27
April

I've been quiet for a while now, because I've been busy with various projects. Some at work, some at home.

Last week I joined a few friends and attended the Ludum Dare's 23rd competition with this entry. For those of you who don't know what I'm talking about, it's a competition where you make a game from scratch in 72 hours. I didn't feel like programming this time, so I did the musical score for the game.

I've also done some upgrades at home. I've started indexing all my components (and that's a hell of a job!) as well as fixing the little things that have been annoying me for the past months.

Such as the A600 chipset, which tends to get very hot. I clamped heatsinks on the hottest components, as well as a fan to assist the cooling further.

Amiga 600 with internal fan


6502 on the ATmega128

2012
18
April

I recently read about the chap who emulated an ARM on his ATmega and was able to run Linux on it. Even though it may be useless, it's still extremely fascinating work. Inspired by this, I lowered the bar and set course for emulating a 6502-based computer on an ATmega128. I'm not expecting nor aiming for full emulation - some text output would be more than sufficient for me. Just knowing that it works is enough.

I started coding on this two hours ago, and lo and behold, here is the first prototype:

ATmega128, external RAM

This is an ATmega128 with 32kb external RAM. Inside the flash memory is the code for a 6502 CPU emulator (based on the 6502asm emulator I wrote many years ago) along with a 16kb ROM image from an old computer called Oric-1. My dad bought me a 48k Oric-1 when I was 9, and that little thing is responsible for what I am today.

Anyway, everything's still pretty fresh, but the code is definitely doing something. It's running, it's peeking and poking the RAM, so if I'm not mistaken there's a working computer inside there. I'm adding a serial port to it tomorrow, so I can receive some debug info as I continue working on it.


Subscribe to Feed

Navigation

    Add to Google

search