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

  • Update

    Wow, what with one thing and another, I haven’t posted on here in a month! Time to give a short update on what’s been happening.…

  • Final RPG-a-Day: Thank

    The last prompt for RPG-a-Day this year is ‘Thank’. If you have read every entry of this year’s RPG-a-Day, then I certainly…

  • Next-to-last RPG-a-Day: Mention

    Today’s prompt is ‘Mention’. I guess this is where I mention people I look up to, or websites I frequent? Ok, here’s…

  • 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