NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Huffman coding

November 04, 2011
by Hexorg
Hexorg's Avatar

Hello everyone! Nerdkits' staff just posted a great tutorial about audio-on-chip, and a Huffman coding. That gave me an idea of implementing it in my video screen project, that I'm working on right now. However I have a few questions about it.

In my project, each pixel is represented by 3 bits (RGB), and there are 200x400 pixels on the screen. At some point I have to transmit 200x400x3 bits to the screen circuitry (240 KBits). If my uC is at 20MHz, and SPI is set to 1/2 of that. then I can transmit the whole image at 20e6/(2* 240e3) = 41.6Hz refresh rate. It's an OK rate, but I'd like to have it closer to 60Hz.

Since my "character" size is only 3 bits. Will it be useful at all to try and compress it?

(Also if anyone has a better idea of transmitting images, you are welcome to pitch in) :)

Once again, thank you for all your help. Hexorg.

November 04, 2011
by BobaMosfet
BobaMosfet's Avatar


It is not necessary to transmit all the data for every frame. Just transmit only what has changed. The trick, of course, is figuring out a way that can encode what else you need that is now missing, without it being equal to, or larger than, simply accounting for every pixel. It probably won't be ideal all of the time of course, but may be for the 75% of the time that really matters.

Just a suggestion.


Post a Reply

Please log in to post a reply.

Did you know that a piezoelectric buzzer can be used to play music with your microcontroller? Learn more...