Hein (fub) wrote,
Hein
fub

  • Mood:

LED matrix firmware

The problem with a 10 x 10 matrix is that you need 10 bits to describe the state of a single row of LEDs (either on or off). A byte is only 8 bits, so it doesn't line up.
Of course, you could simply round the number of bytes used per row up to the nearest whole number, but that would (potentially) give us lots of unused space. The charm of programming in assembly is precisely the way you can optimise your program to get the most out of the space available...

So today I wrote a function that treats a block of memory as a bit stream. New bytes are fetched from memory when needed, not just at the start of a new row. This saves a relatively large memory space, and it does scale to longer rows quite easily. And not a single bit of space is wasted!

The next step is to create a PC program that allows you to create 'frames', which are then sent to the controller board via RS232. The bit-stream is saved in a buffer, which is then copied over the 'work space' of the matrix. I've done stuff like that before, in the firmware for the MACH F display, so I don't expect too many problems there.
Tags: electronics project
Subscribe

  • Sinterklaas & rhymes

    On a whim, I had bought chocolate capitals for the two colleagues who are in my project, plus for the key people at the client. I wrote Sinterklaas…

  • BlinkenLEDs -- the final frontier

    This evening, I produced the final version of the firmware for the single-matrix BlinkenLEDs circuit. This one has it all. If you recall, I have two…

  • Another day, another blinkenLEDs mode

    So I had this idea yesterday... if I make a large display with multiple LED matrices on top of eachother, wouldn't it be cool to have a…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments